45 lines
		
	
	
		
			986 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			45 lines
		
	
	
		
			986 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php 
 | |
| require_once './model/forum/Thread.php';
 | |
| require_once './model/forum/Reply.php';
 | |
| require_once './model/forum/User.php';
 | |
| //$thread = new Thread();
 | |
| $thread = MVCController::$viewData['thread'];
 | |
| $replies = $thread->getReplies();
 | |
| ?>
 | |
| <table>
 | |
| 	<h1>
 | |
| 		<?=$thread->getTitle()?>
 | |
| 	</h1>
 | |
| 	<tr>
 | |
| 		<th width="10%">user</th>
 | |
| 		<th width="80%">content</th>
 | |
| 		<th width="10%">date</th>
 | |
| 	</tr>
 | |
| 	<tr>
 | |
| 		<td>
 | |
| 			<?=$thread->getOwner()->getUsername();?>
 | |
| 		</td>
 | |
| 		<td>
 | |
| 			<?=$thread->getContent()?>
 | |
| 		</td>
 | |
| 		<td>
 | |
| 			<?=$thread->getDate_created()->format("Y M d H:i:s")?>
 | |
| 		</td>
 | |
| 	</tr>
 | |
| <?php 
 | |
| foreach($replies as $reply){
 | |
| 	$owner = $reply->getOwner()->getUsername();
 | |
| 	$content = $reply->getContent();
 | |
| 	$date_created = $reply->getDate()->format("Y M d H:i:s");
 | |
| 	echo("<tr>");
 | |
| 	echo("<td>$owner</td>");
 | |
| 	echo("<td>$content</td>");
 | |
| 	echo("<td>$date_created</td>");
 | |
| 	echo("</tr>");
 | |
| }
 | |
| ?>
 | |
| </table>
 | |
| <?php
 | |
| $threadID = $thread->getId();
 | |
| echo "<a href=\"?p=createreply&thread=$threadID\">Create Reply</a>"
 | |
| ?>
 |