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
54
55
56
57
58
59
60
61
62
63
64
65
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
|
<?php $GLOBALS["datetimepicker"] = 1; $GLOBALS["select2"] = 1;
$page_setting = array( 'controller' => current_controller(), 'table' => $table, 'languages' => $languages, 'permission' => $permission, 'page' => $page, );
validate_user_access(array($page_setting['permission']['view']), 0);
include_once 'templates/top.php'; ?>
<!-- Content Header (Page header) --> <section class="content-header"> <h1> <?php echo __(ucfirst(str_replace('_', ' ', $table))); ?> </h1> <ol class="breadcrumb"> <li><a href="<?php echo admin_url(''); ?>"><?php echo __('Home'); ?></a></li> <li><a href="<?php echo admin_url($page_setting['controller']); ?>"><?php echo __(ucfirst(str_replace('_', ' ', $table))); ?></a></li> </ol> </section>
<!-- Main content --> <section class="content mt-10"> <div class="box box-default"> <div class="box-body"> <div class="row mt-30"> <div class="col-md-12"> <?php if(!in_array('sort', $block_methods)){ echo form_open(admin_url($page_setting['controller'] .'/sort/' . $page_setting['page']), 'class="form-horizontal"'); } ?> <div class="row"> <div class="col-sm-12"> <?php if (validate_user_access(array($page_setting['permission']['create'])) && !in_array('create', $block_methods)) {?> <button onclick="window.location.href='<?php echo admin_url($page_setting['controller'] . '/create'); ?>'" type="button" class="btn btn-primary pull-right" style="margin-bottom: 10px;"> <?php echo __('Create'); ?> </button> <?php }?>
<?php if (validate_user_access(array($page_setting['permission']['update'])) && !in_array('sort', $block_methods)) {?> <button type="submit" class="btn btn-warning pull-right" style="margin-bottom: 10px;"> <?php echo __('Update Sort'); ?> </button> <?php } ?> </div> </div>
<div class="row"> <?php echo $page_links; ?> </div>
<div class="box-body table-responsive no-padding"> <table class="table table-hover"> <tbody> <tr> <?php if(!in_array('sort', $block_methods)){ ?> <th style="width: 5%;"><?php echo __('Sort'); ?></th> <?php } ?>
<?php foreach ($loop_fields = array('name') as $field){ ?> <th><?php echo $name_fields[$field]; ?></th> <?php } ?>
<th><?php echo __('Action'); ?></th> </tr>
<?php foreach ($model as $row) { $modify_onclick = validate_user_access(array($page_setting['permission']['update'])) && !in_array('modify', $block_methods) ? 'onclick="window.location.href=\'' . admin_url($page_setting['controller'] . '/modify/' . $row['id'], 'webadmin') .'\'"' : ''; ?> <tr> <?php if(!in_array('sort', $block_methods)){ ?> <td> <input type="number" name="sort[<?php echo $row['id'] ?>]" min="1" value="<?php echo $row["sort"] ?>" style="width: 50px;"/> </td> <?php } ?>
<?php foreach ($loop_fields as $field){ ?> <?php if (in_array($field, ['nominee_member_id', 'nominator_member_id'])) { $display = Member_model::get_certain($row[$field])->email; } else if (in_array($field, ['nominee_submitted', 'nominator_submitted'])){ $display = $row[$field] ? 'Yes' : 'No'; } else { $display = $row[$field]; } ?> <td> <?php echo $display; ?> </td> <?php } ?>
<td class="controls" style="width: 1px; white-space: nowrap;"> <?php if (validate_user_access(array($page_setting['permission']['update']))) {?> <?php if(!in_array('modify', $block_methods)){ ?> <button <?php echo $modify_onclick; ?> title="<?php echo __('Modify'); ?>" type="button" class="btn btn-primary"> <i class="fa fa-edit"></i> </button> <?php } ?>
<?php } ?>
<?php if (validate_user_access(array($page_setting['permission']['delete']))) { ?> <?php if(!in_array('status', $block_methods)){ ?> <button type="button" onclick="window.location.href='<?php echo admin_url($page_setting['controller'] . '/status/' . $row['id'] . '/'. ($row["status"] == 1 ? 0 : 1) .'/' . $page_setting['page']); ?>'" title="<?php echo __($row["status"] == 1 ? 'Active' : 'Inactive'); ?>" class="btn btn-<?php echo $row["status"] == 1 ? 'success' : 'warning'; ?>"> <i class="fa fa-<?php echo $row["status"] == 1 ? 'check' : 'close'; ?>"></i> </button> <?php } ?>
<?php if(!in_array('delete', $block_methods)){ ?> <button title="<?php echo __('Delete'); ?>" type="button" class="btn btn-danger" onclick="confirm_delete('<?php echo admin_url($page_setting['controller'] . '/delete/' . $row['id'] . '/' . $page_setting['page']); ?>');"> <i class="fa fa-trash"></i> </button> <?php } ?> <?php } ?> </td> </tr> <?php }?> </tbody> </table> </div> <?php if(!in_array('sort', $block_methods)){ echo form_close(); } ?> <div class="row"> <?php echo $page_links; ?> </div> </div> </div> </div> <div class="clear"> </div> </div> </section> <!-- /.content -->
<?php include_once 'templates/bottom.php'; ?>
|