PageRenderTime 253ms CodeModel.GetById 140ms app.highlight 4ms RepoModel.GetById 107ms app.codeStats 0ms

/halogy/application/modules/blog/views/admin/comments.php

https://bitbucket.org/haloweb/halogy-1.0/
PHP | 43 lines | 34 code | 9 blank | 0 comment | 1 complexity | c29cd2f12efb55110bf18d635e91bdac MD5 | raw file
 1<h1>Blog comments</h1>
 2
 3<?php if ($comments): ?>
 4
 5<?php echo $this->pagination->create_links(); ?>
 6
 7<table class="default clear">
 8	<tr>
 9		<th>Date Posted</th>
10		<th>Post</th>
11		<th>Author</th>
12		<th>Email</th>
13		<th>Comment</th>	
14		<th>Status</th>
15		<th class="tiny">&nbsp;</th>
16		<th class="tiny">&nbsp;</th>
17	</tr>
18<?php foreach ($comments as $comment): ?>
19	<tr>
20		<td><?php echo dateFmt($comment['dateCreated']); ?></td>
21		<td><?php echo anchor('/blog/'.dateFmt($comment['uriDate'], 'Y/m/').$comment['uri'], $comment['postTitle']); ?></td>
22		<td><?php echo $comment['fullName']; ?></td>
23		<td><?php echo $comment['email']; ?></td>
24		<td><small><?php echo (strlen($comment['comment'] > 50)) ? htmlentities(substr($comment['comment'], 0, 50)).'...' : htmlentities($comment['comment']); ?></small></td>						
25		<td><?php echo ($comment['active']) ? '<span style="color:green;">Active</span>' : '<span style="color:orange;">Pending</span>'; ?></td>		
26		<td><?php echo (!$comment['active']) ? anchor('/admin/blog/approve_comment/'.$comment['commentID'], 'Approve') : ''; ?></td>
27		<td>
28			<?php echo anchor('/admin/blog/delete_comment/'.$comment['commentID'], 'Delete', 'onclick="return confirm(\'Are you sure you want to delete this?\')"'); ?>
29		</td>
30	</tr>
31<?php endforeach; ?>
32</table>
33
34<?php echo $this->pagination->create_links(); ?>
35
36<p style="text-align: right;"><a href="#" class="button grey" id="totop">Back to top</a></p>
37
38<?php else: ?>
39
40<p class="clear">There are no comments yet.</p>
41
42<?php endif; ?>
43