-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathonair.php
More file actions
154 lines (128 loc) · 4.33 KB
/
onair.php
File metadata and controls
154 lines (128 loc) · 4.33 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
<?php include "./config.php"; ?>
<?php include "./session.php"; ?>
<!DOCTYPE html>
<html>
<head>
<title>On Air</title>
<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!--Import materialize.css-->
<link type="text/css" rel="stylesheet" href="css/materialize.min.css" media="screen,projection" />
<link rel="stylesheet" href="css/main.css">
<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="js/jquery-3.4.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
</head>
<style>
.header-button-div {
display: flex;
align-items: center;
justify-content: space-between;
}
}
</style>
<body>
<?php include "./sidebar.php"; ?>
<div class="right-side">
<div class="header-button-div">
<div class="flexbox-event">
<h3>On Air</h3>
<button data-target="modal1" class="btn modal-trigger">Live Paper</button>
</div>
<!-- Modal 1 -->
<div id="modal1" class="modal" style="width:600px; display:flex; justify-content:center;">
<div class="modal-content">
<h4>Live Paper</h4>
<form method="POST">
<div class="input-field col s12">
<select name='paperid' id='paperid' required>
<option value="" disabled selected>Select an exam to make it live</option>
<?php
foreach ($papersAll as $paper) {
if ($paper[6] == '0') {
echo "<option value='$paper[2]'>" . getSubjectName($paper[1]) . "($paper[2])</option>";
}
} ?>
</select>
<label for='paperid'>Paper ID</label>
</div>
<div>
<div class='input-field col s12'>
<input class='validate' type="text" name='start' id='start' placeholder="08:56:AM" required />
<label for='start'>Start Time</label>
</div>
</div>
<div>
<div class='input-field col s12'>
<input class='validate' type="text" name='end' id='end' placeholder="08:56:AM" required />
<label for='end'>End Time</label>
</div>
</div>
<div>
<div class='input-field col s12'>
<input class='validate' type="date" name='date' id='date' required />
<label for='date'>Date</label>
</div>
</div>
<br />
<div class='row' style="color:white;padding-bottom:10%;">
<button style="color:white;font-size: 1rem;" type='submit' name='btn_live' class='col s3 btn btn-small white waves-effect z-depth-1 y-depth-1 teal lighten-1'>Add</button>
</div>
<form>
</div>
</div>
<!-- End Modal 1 -->
</div>
<!-- right-side -->
<table>
<tr>
<th>Paper ID</th>
<th>Start</th>
<th>End</th>
<th>Date</th>
<th>URL</th>
</tr>
<?php
$onairAll = getData('onair', 6);
foreach ($onairAll as $onair) {
echo "<tr>
<td>$onair[1]</td>
<td>$onair[2]</td>
<td>$onair[3]</td>
<td>$onair[4]</td>
<td><a href='./view.php?onairID=$onair[5]'>View</a></td>
</tr>";
}
?>
</table>
</div>
<script>
(function($) {
$(function() {
$('.modal').modal();
$('#modal1').modal('open');
$('#modal1').modal('close');
$('#modal-trigger').modal();
});
})(jQuery);
document.addEventListener('DOMContentLoaded', function() {
var elems = document.querySelectorAll('select');
var instances = M.FormSelect.init(elems, options);
});
// Or with jQuery
$(document).ready(function() {
$('select').formSelect();
});
</script>
<!-- jQuery CDN -->
<script src="js/jquery-3.4.1.min.js"></script>
<!--JavaScript at end of body for optimized loading-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
</body>
</html>
<?php
if (isset($_POST['btn_live'])) {
setLive($_POST['paperid'], $_POST['start'], $_POST['end'], $_POST['date']);
}
?>