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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
|
<?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"> <!-- start search --> <div class="row"> <?php echo form_open(admin_url($page_setting['controller'] . '/index'), 'id="search_form" class="form-horizontal"'); ?>
<?php $field = 'reference_no'; ?> <div class="col-md-4"> <h5 class="mb-5"><?php echo $name_fields[$field]; ?>:</h5> <input type="text" name="searches[<?php echo $field; ?>]" value="<?php echo empty($searches[$field]) ? '' : $searches[$field]; ?>" class="form-control"> </div>
<?php $field = 'nominee_member_id'; ?> <div class="col-md-4"> <h5 class="mb-5"><?php echo $name_fields[$field]; ?>:</h5> <select type="text" name="searches[<?php echo $field; ?>]" value="<?php echo empty($searches[$field]) ? '' : $searches[$field]; ?>" class="form-control select2"> <option value=""><?php echo __('All'); ?></option> <?php foreach ($members as $row) { ?> <?php $selected = ""; if ($searches[$field] == $row['id']) { $selected = "selected"; } ?> <option value="<?php echo $row['id']; ?>" <?php echo $selected; ?>><?php echo $row['email']; ?></option> <?php } ?> </select> </div>
<?php $field = 'nominator_member_id'; ?> <div class="col-md-4"> <h5 class="mb-5"><?php echo $name_fields[$field]; ?>:</h5> <select type="text" name="searches[<?php echo $field; ?>]" value="<?php echo empty($searches[$field]) ? '' : $searches[$field]; ?>" class="form-control select2"> <option value=""><?php echo __('All'); ?></option> <?php foreach ($members as $row) { ?> <?php $selected = ""; if ($searches[$field] == $row['id']) { $selected = "selected"; } ?> <option value="<?php echo $row['id']; ?>" <?php echo $selected; ?>><?php echo $row['email']; ?></option> <?php } ?> </select> </div>
<?php $field = 'nominee_submitted'; ?> <div class="col-md-4"> <h5 class="mb-5"><?php echo $name_fields[$field]; ?>:</h5> <select type="text" name="searches[<?php echo $field; ?>]" value="<?php echo empty($searches[$field]) ? '' : $searches[$field]; ?>" class="form-control"> <option value=""><?php echo __('All'); ?></option> <?php foreach (['1' => 'Yes', '0' => 'No'] as $key => $name) { ?> <?php $selected = ""; if ((string)$searches[$field] === (string)$key) { $selected = "selected"; } ?> <option value="<?php echo $key; ?>" <?php echo $selected; ?>><?php echo $name; ?></option> <?php } ?> </select> </div>
<?php $field = 'nominator_submitted'; ?> <div class="col-md-4"> <h5 class="mb-5"><?php echo $name_fields[$field]; ?>:</h5> <select type="text" name="searches[<?php echo $field; ?>]" value="<?php echo empty($searches[$field]) ? '' : $searches[$field]; ?>" class="form-control"> <option value=""><?php echo __('All'); ?></option> <?php foreach (['1' => 'Yes', '0' => 'No'] as $k => $n) { ?> <?php $selected = ""; if ((string)$searches[$field] === (string)$k) { $selected = "selected"; } ?> <option value="<?php echo $k; ?>" <?php echo $selected; ?>><?php echo $n; ?></option> <?php } ?> </select> </div>
<?php $field = 'group_id'; ?> <div class="col-md-4"> <h5 class="mb-5"><?php echo $name_fields[$field]; ?>:</h5> <select type="text" name="searches[<?php echo $field; ?>]" value="<?php echo empty($searches[$field]) ? '' : $searches[$field]; ?>" class="form-control select2"> <option value=""><?php echo __('All'); ?></option> <?php foreach ($groups as $row) { ?> <?php $selected = ""; if ($searches[$field] == $row['id']) { $selected = "selected"; } ?> <option value="<?php echo $row['id']; ?>" <?php echo $selected; ?>><?php echo $row['name']; ?></option> <?php } ?> </select> </div>
<?php $field = 'condition_master_id'; ?> <div class="col-md-4"> <h5 class="mb-5"><?php echo $name_fields[$field]; ?>:</h5> <select type="text" name="searches[<?php echo $field; ?>]" value="<?php echo empty($searches[$field]) ? '' : $searches[$field]; ?>" class="form-control select2"> <option value=""><?php echo __('All'); ?></option> <?php foreach ($master_application_conditions as $row) { ?> <?php $selected = ""; if ($searches[$field] == $row['id']) { $selected = "selected"; } ?> <option value="<?php echo $row['id']; ?>" <?php echo $selected; ?>><?php echo $row['name_' . get_wlang()]; ?></option> <?php } ?> </select> </div>
<div class="col-md-4"> <h5 class="mb-5"> </h5> <button type="submit" class="btn btn-primary" type="button"> <?php echo __('Search'); ?> </button> </div> <?php echo form_close(); ?> </div> <!-- end search -->
<br>
<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('reference_no', 'created_at', 'creator_membership', 'nominee_member_id', 'nominee_submitted', 'nominator_member_id', 'nominator_submitted', 'group_id', 'condition_master_id') 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] ? '<p>Yes</p>' : '<p style="color:red">No</p>'; } else if ($field == 'condition_master_id') { $display = Master_type_code_model::get_certain($row[$field])['name_' . get_wlang()]; } else if ($field == 'group_id') { $display = Group_model::get_certain($row[$field])['name']; } else { $display = $row[$field]; } ?> <td> <?php echo $display; ?> </td> <?php } ?>
<td class="controls nowrap"> <button onclick="confirm_box('<?php echo admin_url($page_setting['controller'] . '/email/nominee/' . $row['id']);?>', {msg: 'Confirm to send email?', ok: 'Send'})" title="<?php echo __('Resend email to Nominee'); ?>" type="button" class="btn btn-warning"> <i class="fa fa-envelope"></i> </button>
<button onclick="confirm_box('<?php echo admin_url($page_setting['controller'] . '/email/nominator/' . $row['id']);?>', {msg: 'Confirm to send email?', ok: 'Send'})" title="<?php echo __('Resend email to Nominator'); ?>" type="button" class="btn btn-danger"> <i class="fa fa-envelope"></i> </button>
<?php if (validate_user_access(array('view_score'))) { ?> <button onclick="window.location.href='<?php echo admin_url('bk_score/search_application/' . $row['id']); ?>'" title="<?php echo __('Score'); ?>" type="button" class="btn btn-default"> <i class="fa fa-legal"></i> </button> <?php } ?>
<?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 if (validate_user_access(array('update_application_file'))) { ?> <a href="<?= admin_url('bk_application_file/modify/' . $row['id']) ?>"> <button title="<?php echo __('Upload'); ?>" type="button" class="btn btn-info"> <i class="fa fa-upload"></i> </button> </a> <?php } ?> <?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'; ?>
|