-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathadd-timetable.php
147 lines (127 loc) · 3.45 KB
/
add-timetable.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
<?php
require_once 'inc/func.inc.php';
$field_type_string = "<option value='break'>Break</option><option value='lunch break'>Lunch Break</option><option value='theory'>Theory</option><option value='lab'>Lab</option>";
$DAY_OF_WEEK = array("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun");
if(!loggedIn())
header('Location: index.php');
include 'inc/public/meta.inc.php';
?>
<script type="text/javascript">
<?php
$current_url = explode('/', returnCurrentURL());
unset($current_url[count($current_url) - 1 ]);
echo "\t\tconfig_api_url = '" . implode('/', $current_url) . "/api/';" . PHP_EOL;
?>
</script>
<style type="text/css">
.empty {
background-color: #ffcccc;
}
</style>
</head>
<body>
<?php
include 'inc/public/header.inc.php';
?>
<div class="container">
<div class="row">
<div class="col-md-4 text-center select-label-text">Branch</div>
<div class="col-md-4 text-center select-label-text">Semester</div>
<div class="col-md-4 text-center select-label-text">Section</div>
</div>
<div class="row">
<form class="form-horizontal">
<div class="form-group">
<div class="col-md-4">
<select class="form-control" id="branch_select">
<option value="0">Select</option>
<option value="1">COE</option>
<option value="2">IT</option>
<option value="3">ECE</option>
<option value="4">MPAE</option>
<option value="5">ICE</option>
<option value="6">BT</option>
<option value="7">ME</option>
</select>
</div>
<div class="col-md-4">
<select class="form-control" id="semester_select"><option value="0">Select</option>
<?php
for($i=1; $i<=8; $i++){
echo '<option value="' . $i . '">' . romanic_number($i) . '</option>' . PHP_EOL;
}
?>
</select>
</div>
<div class="col-md-4">
<select class="form-control" id="section_select"><option value="0">Select</option>
<?php
for($i=1; $i<=3; $i++){
echo '<option value="' . $i . '">' . romanic_number($i) . '</option>' . PHP_EOL;
}
?>
</select>
</div>
</div>
</form>
</div>
<div class="row" id="submit_message"></div>
</div>
<hr>
<div class="col-md-12">
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<th>Day</th>
<th>8:30 - 9:30</th>
<th>9:30 - 10:30</th>
<th>10:30 - 11:30</th>
<th>11:30 - 12:30</th>
<th>12:30 - 1:30</th>
<th>1:30 - 2:30</th>
<th>2:30 - 3:30</th>
<th>3:30 - 4:30</th>
<th>4:30 - 5:30</th>
<th>5:30 - 6:30</th>
</tr>
</thead>
<tbody>
<?php
$key = 0;
foreach($DAY_OF_WEEK as $day){
echo '<tr><th scope="row">' . $day . '</th>';
for($i=0; $i<10; $i++){
echo '
<td>
<select class="js-example-basic-single" data-field-name="' . $key . '/' . $i . '">' . $field_type_string . '</select>
<div></div>
</td>';
}
echo '</tr>';
$key++;
}
?>
</tbody>
</table>
</div>
</div>
<div class="clearfix"></div>
<div class="container">
<div class="btn-group pull-right" role="group">
<button type="button" class="btn btn-default" id="refresh-button">Refresh</button>
<button type="button" class="btn btn-success" id="submit-button">Submit</button>
</div>
</div>
<hr>
<script src="js/jquery-2.2.2.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/select2.min.js"></script>
<script type="text/javascript" src="js/custom.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$(".js-example-basic-single").select2();
});
</script>
</body>
</html>