-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcalendar.php
203 lines (194 loc) · 7.48 KB
/
calendar.php
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
<?php
/**
* Calendar
*
* @package Visible Polls
* @author Alan Kawamara
* @copyright 2016
*/
if (!defined("_VALID_PHP"))
die('Direct access to this location is not allowed.');
?>
<?php switch(Filter::$action): case "attendance": ?>
<?php $row = $core->getRowById(Leaders::scTable, Filter::$id);?>
<div class="corporato form segment">
<div class="corporato top right attached label">Attendance Records / <?php echo Filter::dodate("short_date", $row->date);?></div>
<form id="corporato_form" name="corporato_form" method="post">
<div class="field">
<label>Check names of members present on <?php echo Filter::dodate("short_date", $row->date);?></label>
<?php echo $core->getCheckBoxList($leader->getLeaders(), "leader_id", "");?>
</div>
<div class="corporato fitted divider"></div>
<button type="button" name="dosubmit" class="corporato button">Update attendance register</button>
<a href="index.php?do=calendar" class="corporato basic button">Cancel edit</a>
<input name="processAttendance" type="hidden" value="1">
<input name="sitting_id" type="hidden" value="<?php echo Filter::$id;?>" />
</form>
</div>
<div id="msgholder"></div>
<script type="text/javascript">
// <![CDATA[
$(document).ready(function () {
$("#filter").on("keyup", function() {
var filter = $(this).val(),
count = 0;
$("#fsearch .row").each(function() {
if ($(this).text().search(new RegExp(filter, "i")) < 0) {
$(this).fadeOut();
} else {
$(this).show();
count++;
}
});
});
});
// ]]>
</script>
<?php break;?>
<?php case "edit": ?>
<?php $row = $core->getRowById(Leaders::scTable, Filter::$id);?>
<div class="corporato form segment">
<div class="corporato top right attached label">Editing Sitting Date / <?php echo Filter::dodate("short_date", $row->date);?></div>
<form id="corporato_form" name="corporato_form" method="post">
<div class="three fields">
<div class="field">
<label>Calendar year</label>
<label class="input"><i class="icon-append icon asterisk"></i>
<input type="text" name="year" value="<?php echo $row->year;?>">
</label>
</div>
<div class="field">
<label>Sitting date</label>
<input type="date" name="date" value="<?php echo $row->date;?>">
</div>
<div class="field">
<label>Sitting type</label>
<select name="stype">
<option value="0">--- Select sitting type ---</option>
<option value="1"<?php if ($row->stype == 1) echo " selected=\"selected\"";?>>House session</option>
<option value="2"<?php if ($row->stype == 2) echo " selected=\"selected\"";?>>Committee session</option>
<option value="3"<?php if ($row->stype == 3) echo " selected=\"selected\"";?>>Budget session</option>
</select>
</div>
</div>
<div class="corporato fitted divider"></div>
<button type="button" name="dosubmit" class="corporato button">Update caledar</button>
<a href="index.php?do=calendar" class="corporato basic button">Cancel edit</a>
<input name="processCalendar" type="hidden" value="1">
<input name="id" type="hidden" value="<?php echo Filter::$id;?>" />
</form>
</div>
<div id="msgholder"></div>
<script type="text/javascript">
// <![CDATA[
$(document).ready(function () {
$("#filter").on("keyup", function() {
var filter = $(this).val(),
count = 0;
$("#fsearch .row").each(function() {
if ($(this).text().search(new RegExp(filter, "i")) < 0) {
$(this).fadeOut();
} else {
$(this).show();
count++;
}
});
});
});
// ]]>
</script>
<?php break;?>
<?php case"add": ?>
<div class="corporato form segment">
<div class="corporato top right attached label">Add a sitting date</div>
<form id="corporato_form" name="corporato_form" method="post">
<div class="three fields">
<div class="field">
<label>Calendar year</label>
<label class="input"><i class="icon-append icon asterisk"></i>
<input type="text" name="year" placeholder="Calendar year">
</label>
</div>
<div class="field">
<label>Sitting date</label>
<div class="corporato input"> <i class="icon-prepend icon calendar"></i>
<input name="date" type="text" data-datepicker="true" placeholder="Meeting date" />
</div>
</div>
<div class="field">
<label>Sitting type</label>
<select name="stype">
<option value="0">--- Select sitting type ---</option>
<option value="1">House session</option>
<option value="2">Committee session</option>
<option value="2">Budget session</option>
</select>
</div>
</div>
<div class="corporato fitted divider"></div>
<button type="button" name="dosubmit" class="corporato button">Add sitting date</button>
<a href="index.php?do=calendar" class="corporato basic button">Cancel</a>
<input name="processCalendar" type="hidden" value="1">
</form>
</div>
<div id="msgholder"></div>
<script type="text/javascript">
// <![CDATA[
$(document).ready(function () {
$("#filter").on("keyup", function() {
var filter = $(this).val(),
count = 0;
$("#fsearch .row").each(function() {
if ($(this).text().search(new RegExp(filter, "i")) < 0) {
$(this).fadeOut();
} else {
$(this).show();
count++;
}
});
});
});
// ]]>
</script>
<?php break;?>
<?php default: ?>
<?php $calendarrow = $leader->getSittingCalendar();?>
<div class="corporato basic segment">
<div class="header"><a class="corporato button push-right" href="index.php?do=calendar&action=add"><i class="icon add"></i> Add Sitting Date</a><span>Viewing Sitting Calendar</span> </div>
<table class="corporato basic sortable table">
<thead>
<tr>
<th data-sort="string">Date</th>
<th data-sort="string">Year</th>
<th data-sort="string">Sitting type</th>
<th class="disabled push-right"><?php echo Lang::$word->ACTIONS;?></th>
</tr>
</thead>
<tbody>
<?php if(!$calendarrow):?>
<tr>
<td colspan="6"><?php echo Filter::msgSingleAlert("No sitting dates listed on the platform yet.");?></td>
</tr>
<?php else:?>
<?php foreach ($calendarrow as $row):?>
<tr>
<td><?php echo Filter::dodate("short_date", $row->date);?></td>
<td><?php echo $row->year;?></td>
<td><?php echo getSType($row->sitting_type);?></td>
<td class="push-right"><a href="index.php?do=calendar&action=edit&id=<?php echo $row->id;?>"><i class="circular inverted success icon pencil link"></i></a> <a class="delete" data-title="Delete sitting date listing" data-option="deleteSittingDate" data-id="<?php echo $row->id;?>" data-name="<?php echo $row->id;?>"><i class="circular danger inverted remove icon link"></i></a> <a class="corporato basic button" href="index.php?do=calendar&action=attendance&id=<?php echo $row->id;?>">attendance register</a></td>
</tr>
<?php endforeach;?>
<?php unset($row);?>
<?php endif;?>
</tbody>
</table>
</div>
<div class="corporato divider"></div>
<div class="two columns">
<div class="row"> <span class="corporato label"><?php echo Lang::$word->TOTAL . ': ' . $pager->items_total;?> / <?php echo Lang::$word->CURPAGE . ': ' . $pager->current_page . ' ' . Lang::$word->OF . ' ' . $pager->num_pages;?></span> </div>
<div class="row">
<div class="push-right"><?php echo $pager->display_pages();?></div>
</div>
</div>
<?php break;?>
<?php endswitch;?>