0e473524 by Kevin Burton

notifications updates

1 parent e2cc03a6
......@@ -194,8 +194,11 @@ function display_page() {
, 'meta_value' => 'pending'
);
$entries = get_posts($args);
foreach(get_posts($args) as $entry) {
foreach($entries as $entry) {
$id = $entry->ID;
$details = get_post_meta($id,'details',true);
......
......@@ -47,12 +47,13 @@ print "</pre>";
<tr>
<td><?php echo $entry->post_title; ?></td>
<td><?php echo date("M j, Y @ h:i A",strtotime($entry->execute_date)); ?></td>
<td><?php echo $sendto; ?></td>
<td><?php echo ucwords($sendto); ?></td>
<td><?php if ($entry->is_email): ?><img src="<?php echo Tools\url('assets/images/accept.png', __FILE__)?>" /><?php endif;?></td>
<td><?php if ($entry->is_system): ?><img src="<?php echo Tools\url('assets/images/accept.png', __FILE__)?>" /><?php endif;?></td>
<td>
<?php
if (strtotime($entry->execute_date) > time()):?>
<a href="/wp-admin/admin.php?page=notifications&action=edit&page_id=<?php echo $entry->ID; ?>">edit</a>
| <a href="/wp-admin/admin.php?page=notifications&action=delete&page_id=<?php echo $entry->ID; ?>" onclick="return confirm('Are you sure?');">delete</a></td>
......
......@@ -64,6 +64,11 @@ use Tz\WordPress\Tools;
<td>Sent To:</td>
<td>
<?php
if ($entry->details['sendto'] == "report" ): ?>
<input type="hidden" name="sendto" value="<?php echo $entry->details['sendto']; ?>"/>
&nbsp;<span style="color:#999;"><em>Report Generated</em></span>
<?php else: ?>
<select name="sendto" class="wide-input-field">
<option value="allusers" <?php echo ($validation->set_value('sendto',$entry->details['sendto'])=="allusers") ? 'selected="selected"' : "";?>>All Users</option>
<optgroup label="By Group:">
......@@ -72,6 +77,7 @@ use Tz\WordPress\Tools;
<?php endforeach; ?>
</optgroup>
</select>
<?php endif; ?>
<?php echo $validation->form_error('sendto');?>
......