-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcourseAllocationList.php
More file actions
237 lines (184 loc) · 7.77 KB
/
courseAllocationList.php
File metadata and controls
237 lines (184 loc) · 7.77 KB
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
<div class="span8 center-spread">
<br/><br/><br/>
<fieldset>
<legend><b><h1>Course Allocation By Date</h1></b></legend>
<?php
if(count($allocationList->num_rows()) > 0)
{ ?>
<table class="table-striped table">
<thead>
<tr><th>DAY NO</th><th>EXAM DATE </th><th>VIEW</th><th>PDF</th>
</tr>
</thead>
<tbody>
<?php
$serial = 0;
$aIdArr = array();
//$venueArr = array();
//$deptArr = array();
$examdate = array();
$rr = 0;
foreach($allocationList->result() as $row)
{
//$deptArr[] = $row->department;
//$venueArr[] = $row->venue;
$examdate[] = $row->dayDate;
$aIdArr [] = $rr + 1;
}
if($click =="")
{
$end = 30 ;
$start = 0 ;
$TrackClick = $click;
}
elseif($click =="next")
{
$start = $end ;
$end = $start + 30;
$TrackClick = $click;
}
elseif($click =="previous")
{
$start = $end - 30;
if($end <= 30)
$TrackClick = "";
else
$TrackClick = $click;
}
//$serial = 0;
for($i = $start ; $i < $end; $i++ ) // page next previous
{
// do{
if($i >= count($aIdArr) )
{ break; }
$count = $i + 1;
echo '<tr>
<td>'.$count.'</td>
<td> '.strtoupper($examdate[$i]).' </td>
<td>'.anchor('admin/courseAllocationPreviewB/'.$examdate[$i]," View " , "['target' => '_blank']").' </td>
<td>'.anchor('admin/courseAllocationPreviewBrpt/'.$examdate[$i], " pdf ", "['target' => '_blank']").' </td>
</tr>';
}
if($start == 0)
{
echo anchor('admin/courseAllocationMasterList/0/?end='.$end.'&click=next&flag=next',"Next->") ;
}
elseif ($i > count($aIdArr) - 1 )
{
echo anchor('admin/courseAllocationMasterList/0/?end='.$start.'&click=previous&flag=previous',"<-Previous");
}
else
{
echo anchor('admin/courseAllocationMasterList/0/?end='.$end.'&click=next&flag=next',"Next->")." ".anchor('admin/venueAllocationMasterList/0/?end='.$start.'&click=previous&flag=previous',"<-Previous") ;
}
}
else
{
echo "<p>There are no Venue Allocated yet in this app to preview!</p>";
}
?>
</tbody>
</table>
<hr/>
</fieldset>
<div id="addDept" class="modal hide fade">
<div class="modal-header">
<a class="close" data-dismiss="modal" >×</a>
<h3>List of Unassiged Department</h3>
</div>
<div class="modal-body">
<?php
$attributes = array('class'=>'form-horizontal');
echo form_open_multipart("admin/allocateUnassigneVenueOrDept/D/?end=".$start."&click=".$TrackClick, $attributes);
echo form_hidden('totalValue',count($unassignDeptListArr))
?>
<table class="table-striped table">
<thead>
<tr><th>SN</th><th>Department </th><th> Venue </th><th><?php echo"Total: ".count($unassignDeptListArr); ?></th>
</tr>
</thead>
<tbody>
<?php
if(count($unassignDeptListArr > 0))
{
$count = 1;
foreach ( $unassignDeptListArr as $dept)
{
echo '<tr><td>'.$count.'</td><td>'.$dept.'</td>
<td><select class="input-large" id="'."venueList".$count.'" name="'."venueList".$count.'">';
foreach($VenueList as $row2)
{
echo '<option value="'.$dept.','.$row2->Name.'">'.$row2->Name.'</option>' ;
}
"</select></td></tr>";
$count++;
}
?>
<div class="modal-footer form-actions">
<?php
$attr = array('id'=>'submit', 'value'=>'Update','class'=>'btn btn-success');
echo "<tr><td colspan=\"3\" align=\"center\">".form_submit($attr)."</td></tr>";
?>
</div>
<?php
}
else
{
echo '<tr><th colspan="3"> There are '.count($unassignDeptListArr).' Department Left. All Department Has Heen Allocated</th></tr>';
}
?>
<?php echo form_close(); ?>
</tbody>
</table>
</div>
</div>
<div id="addVenue" class="modal hide fade">
<div class="modal-header">
<a class="close" data-dismiss="modal" >×</a>
<h3>List of Unassiged Venue</h3>
</div>
<div class="modal-body">
<table class="table-striped table">
<thead>
<tr><th>SN</th><th>Venue </th><th> Department </th><th><?php echo"Total: ".count($unassignVenListArr); ?></th>
</tr>
</thead>
<tbody>
<?php
$attributes = array('class'=>'form-horizontal');
echo form_open_multipart("admin/allocateUnassigneVenueOrDept/V/?end=".$start."&click=".$TrackClick, $attributes);
echo form_hidden('totalValue',count($unassignVenListArr))
?>
<?php
$count = 1;
if(count($unassignVenListArr) > 0 )
{
foreach ( $unassignVenListArr as $venue)
{
echo "<tr><td>".$count."</td><td>".$venue."</td>";
echo '<td><select class="input-small" id="'."deptCodeList".$count.'" name="'."deptCodeList".$count.'">';
foreach($DeptList as $row2)
{
echo '<option value="'.$venue.','.$row2->DeptCode.'" selected> '.$row2->DeptCode.'</option>' ;
}
echo "</select></td></tr>";
$count++;
}
?>
<div class="modal-footer form-actions">
<?php
$attr = array('id'=>'submit', 'value'=>'Update','class'=>'btn btn-success');
echo "<tr><td colspan=\"3\" align=\"center\">".form_submit($attr)."</td></tr>";
?>
</div>
<?php }
else
{
echo '<tr><th colspan="3"> There are '.count($unassignVenListArr).' Venues Left. All Venue Has Heen Allocated</th></tr>';
}
?>
<?php echo form_close(); ?>
</tbody>
<table>
</div>
</div>