Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<div class="pull-left" style="width:700;padding-top:5px;">
<h2><?php echo __('Roles'); ?></h2>
</div>
<div class="pull-right flush-right" style="padding-top:5px;padding-right:5px;">
<b><a href="roles.php?a=add" class="Icon list-add"><?php
echo __('Add New Role'); ?></a></b></div>
<div class="clear"></div>
<?php
$page = ($_GET['p'] && is_numeric($_GET['p'])) ? $_GET['p'] : 1;
$count = Role::objects()->count();
$pageNav = new Pagenate($count, $page, PAGE_LIMIT);
$pageNav->setURL('roles.php');
$showing=$pageNav->showing().' '._N('role', 'roles', $count);
?>
<form action="roles.php" method="POST" name="roles">
<?php csrf_token(); ?>
<input type="hidden" name="do" value="mass_process" >
<input type="hidden" id="action" name="a" value="" >
<table class="list" border="0" cellspacing="1" cellpadding="0" width="940">
<caption><?php echo $showing; ?></caption>
<thead>
<tr>
<th width="7"> </th>
<th><?php echo __('Name'); ?></th>
<th width="100"><?php echo __('Status'); ?></th>
<th width="200"><?php echo __('Created On') ?></th>
<th width="250"><?php echo __('Last Updated'); ?></th>
</tr>
</thead>
<tbody>
<?php foreach (Role::objects()->order_by('name')
->limit($pageNav->getLimit())
->offset($pageNav->getStart()) as $role) {
$id = $role->getId();
$sel = false;
if ($ids && in_array($id, $ids))
$sel = true; ?>
<tr>
<td>
<?php
if ($role->isDeleteable()) { ?>
<input width="7" type="checkbox" class="ckb" name="ids[]"
value="<?php echo $id; ?>"
<?php echo $sel?'checked="checked"':''; ?>>
<?php
} else {
echo ' ';
}
?>
</td>
<td><a href="?id=<?php echo $id; ?>"><?php echo
<td> <?php echo $role->isEnabled() ? __('Active') :
'<b>'.__('Disabled').'</b>'; ?></td>
<td><?php echo Format::date($role->getCreateDate()); ?></td>
<td><?php echo Format::datetime($role->getUpdateDate()); ?></td>
</tr>
<?php }
?>
</tbody>
<tfoot>
<tr>
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?php if($count){ ?>
<?php echo __('Select'); ?>:
<a id="selectAll" href="#ckb"><?php echo __('All'); ?></a>
<a id="selectNone" href="#ckb"><?php echo __('None'); ?></a>
<a id="selectToggle" href="#ckb"><?php echo __('Toggle'); ?></a>
<?php } else {
echo sprintf(__('No roles defined yet — %s add one %s!'),
'<a href="roles.php?a=add">','</a>');
} ?>
</td>
</tr>
</tfoot>
</table>
<?php
if ($count) //Show options..
echo '<div> '.__('Page').':'.$pageNav->getPageLinks().' </div>';
?>
<p class="centered" id="actions">
<input class="button" type="submit" name="enable" value="<?php echo
__('Enable'); ?>">
<input class="button" type="submit" name="disable" value="<?php echo
__('Disable'); ?>">
<input class="button" type="submit" name="delete" value="<?php echo
__('Delete'); ?>">
</p>
</form>
<div style="display:none;" class="dialog" id="confirm-action">
<h3><?php echo __('Please Confirm'); ?></h3>
<a class="close" href=""><i class="icon-remove-circle"></i></a>
<hr/>
<p class="confirm-action" style="display:none;" id="enable-confirm">
<?php echo sprintf(__('Are you sure want to <b>enable</b> %s?'),
_N('selected role', 'selected roles', 2));?>
</p>
<p class="confirm-action" style="display:none;" id="disable-confirm">
<?php echo sprintf(__('Are you sure want to <b>disable</b> %s?'),
_N('selected role', 'selected roles', 2));?>
</p>
<p class="confirm-action" style="display:none;" id="delete-confirm">
<font color="red"><strong><?php echo sprintf(
__('Are you sure you want to DELETE %s?'),
_N('selected role', 'selected roles', 2)); ?></strong></font>
<br><br><?php echo __('Deleted roles CANNOT be recovered.'); ?>
</p>
<div><?php echo __('Please confirm to continue.'); ?></div>
<hr style="margin-top:1em"/>
<p class="full-width">
<span class="buttons pull-left">
<input type="button" value="<?php echo __('No, Cancel'); ?>" class="close">
</span>
<span class="buttons pull-right">
<input type="button" value="<?php echo __('Yes, Do it!'); ?>" class="confirm">
</span>
</p>
<div class="clear"></div>
</div>