This repository has been archived by the owner on Jul 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
createGroup.php
218 lines (195 loc) · 7.05 KB
/
createGroup.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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<?php session_start(); ?>
<!DOCTYPE html>
<html>
<head>
<title>Study Mates</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/profile-style.css">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<script src="js/jquery-min.js"></script>
<!--<script type="text/javascript" src="js/checkLogin.js"></script>
<script src="https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/markerclusterer.js"></script>-->
<!--<script type="text/javascript" src="js/changeLogin.js"></script>-->
<link rel="icon" type="image/png" href="image/logo.png" sizes="16x16">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, target-densitydpi=medium-dpi, user-scalable=0" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<?php include "nav.inc" ?>
<div class="container">
<form id="createGroup" method="post">
<div class="row">
<div class="col-xs-12 text-center">
<h2> Create Group</h2>
</div>
<div class="col-xs-12 col-sm-6">
<div class="form-group" >
<label for="Name">Group name </label>
<input type="text" class="form-control" name="Name" id="name">
</div>
</div>
<div class="col-xs-12 col-sm-6">
<div class="form-group" >
<label for="Courses">Course </label>
<select type="text" class="form-control" name="Courses" id="courses">
</select>
</div>
</div>
<div class="col-xs-12 col-sm-6">
<div class="form-group" >
<label for="Topic">Topic (optional) </label>
<input type="text" class="form-control" name="Topic" id="topic">
</div>
<div class="col-xs-12 col-sm-6">
<div class="col-xs-7 col-sm-7 col-sm-offset-1">
<div class="form-group" >
<label for="StartTime">From </label>
<input type="text" class="form-control" name="StartTime" id="startTime" placeholder="xx:xx">
</div>
</div>
<div class="col-xs-5 col-sm-4 ">
<div class="form-group">
<label for="AM/PM"></label>
<select class="form-control" name="AM/PM"id="am/pm" style="width: 80px; margin-top:5px; margin-left:-25px;">
<option>AM</option>
<option>PM</option>
</select>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6">
<div class="col-xs-7 col-sm-7 col-sm-offset-1">
<div class="form-group" >
<label for="FinishTime">To </label>
<input type="text" class="form-control" name="FinishTime" id="finishTime" placeholder="xx:xx">
</div>
</div>
<div class="col-xs-5 col-sm-4 ">
<div class="form-group">
<label for="AM/PM2"></label>
<select class="form-control" name="AM/PM2" id="am/pm2" style="width: 80px; margin-top:5px; margin-left:-25px;">
<option>AM</option>
<option>PM</option>
</select>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6">
<div class="form-group" >
<label for="Desc">Description </label>
<textarea rows ="4" class="form-control" name="Desc" id="desc"></textarea>
</div>
</div>
<div class="col-xs-12 col-sm-6">
<div class="form-group" >
<label for="name">Location</label>
<select type="text" class="form-control" name "Location" id="location">
</select>
</div>
</div>
<div class="col-xs-12 col-sm-6 ">
<div class="form-group" >
<label for="submit">Room Number</label>
<input type="text" class="form-control" id="room">
</div>
</div>
<div class="col-xs-12 col-sm-12">
<div class="col-xs-4 col-sm-1 col-sm-offset-5 col-xs-offset-2">
<div class="form-group" >
<button type="text" class="btn " id="clear">Clear</button>
</div>
</div>
<div class="col-xs-4 col-sm-5">
<div class="form-group" >
<button type="text" class="btn" id="submit">Create</button>
</div>
</div>
</div>
</div>
</form>
</div>
<script>
var coursesBackup = ["Discrete Maths", "C++"];
var courses = ["Discrete Maths", "C++"];
var loc = ["Forgan Smith (1)", "Axon Building (47)", "General Purpose South(78)"];
for (var i = 0; i< loc.length; i++){
var html = "<option>" + loc[i]+ "</option>";
$("#location").append(html);
}
function init(){
var count = 0;
$("#courses").empty();
for (var i=0; i < courses.length; i++){
if (courses[i] != null){
$("#courses").append('<option id="c'+count+'" class="c col-sm-4 col-sm-offset-1"><p>'+courses[i]+'</p></option>');
count++;
}
}
}
init();
$('#startTime').on("keyup", function(){
for (var i=0; i < $('#startTime').val().length; i++){
if ($('#startTime').val()[i] ==":"){
var str = $('#startTime').val().substr(0,i) + $('#startTime').val().substr(i+1);
$('#startTime').val(str);
}
}
if ($('#startTime').val().length >4){
var str = $('#startTime').val().substr(0,4);
$('#startTime').val(str);
}
if ($('#startTime').val()[0] >1){
var str = "1"+ $('#startTime').val().substr(1);
$('#startTime').val(str);
}
if ($('#startTime').val()[1] >1){
var str = $('#startTime').val().substr(0, 1) +"1"+ $('#startTime').val().substr(2);
$('#startTime').val(str);
}
if ($('#startTime').val()[3] >5){
var str = $('#startTime').val().substr(0, 2) +"5"+ $('#startTime').val().substr(3);
$('#startTime').val(str);
}
if ($('#startTime').val().length ==4){
var str = $('#startTime').val().substr(0, 2) + ":" + $('#startTime').val().substr(2);
$('#startTime').val(str);
}
});
$('#finishTime').on("keyup", function(){
for (var i=0; i < $('#finishTime').val().length; i++){
if ($('#finishTime').val()[i] ==":"){
var str = $('#finishTime').val().substr(0,i) + $('#finishTime').val().substr(i+1);
$('#finishTime').val(str);
}
}
if ($('#finishTime').val().length >4){
var str = $('#finishTime').val().substr(0,4);
$('#finishTime').val(str);
}
if ($('#finishTime').val()[0] >1){
var str = "1"+ $('#finishTime').val().substr(1);
$('#finishTime').val(str);
}
if ($('#finishTime').val()[1] >1){
var str = $('#finishTime').val().substr(0, 1) +"1"+ $('#finishTime').val().substr(2);
$('#finishTime').val(str);
}
if ($('#finishTime').val()[3] >5){
var str = $('#finishTime').val().substr(0, 2) +"5"+ $('#finishTime').val().substr(3);
$('#finishTime').val(str);
}
if ($('#finishTime').val().length ==4){
var str = $('#finishTime').val().substr(0, 2) + ":" + $('#finishTime').val().substr(2);
$('#finishTime').val(str);
}
});
$('#clear').on("click", function(){
startTime.val("");
finishTime.val("");
});
</script>
</body>
</html>