forked from jwnisbet/melodiesforus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
editGroup.php
61 lines (55 loc) · 1.92 KB
/
editGroup.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
<?php
// Continues running the experiment until the user has finished the group
include('config.php');
include('functions.php');
$message = '';
$db = db_connect();
if(isset($_POST['phase']) && $_POST['phase'] == 'updateGroup') {
// Get new group number
$newGroup = $_POST['group'];
$q = "UPDATE settings SET value = $newGroup WHERE name = 'CURRENT_GROUP' LIMIT 1";
runQuery($db, $q, false);
$message = "Update success!";
}
$q = "SELECT value FROM settings WHERE name = 'CURRENT_GROUP' LIMIT 1";
$result = runQuery($db, $q, true);
$currentGroup = $result[0]['value'];
}
?>
<!DOCTYPE html>
<head>
<title>Update Group</title>
<script src="//code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<script src="./eventRecorder.js"></script>
<link href="./assets/css/bootstrap.css" rel="stylesheet">
</head>
<body>
<?php
if($message) { echo "<p>$message</p>"; }
?>
<h1>Update Group</h1>
<p>
Please enter the desired group number below. This impacts
</p>
<form>
<fieldset>
<input type='hidden' name='phase' value='updateGroup' />
<label for='group'>Group Number:</label>
<input name='group' value='<?php echo $currentGroup; ?>' />
<input type='submit' value='Update Group' />
</fieldset>
</form>
<script src="./assets/js/bootstrap-transition.js"></script>
<script src="./assets/js/bootstrap-alert.js"></script>
<script src="./assets/js/bootstrap-modal.js"></script>
<script src="./assets/js/bootstrap-dropdown.js"></script>
<script src="./assets/js/bootstrap-scrollspy.js"></script>
<script src="./assets/js/bootstrap-tab.js"></script>
<script src="./assets/js/bootstrap-tooltip.js"></script>
<script src="./assets/js/bootstrap-popover.js"></script>
<script src="./assets/js/bootstrap-button.js"></script>
<script src="./assets/js/bootstrap-collapse.js"></script>
<script src="./assets/js/bootstrap-carousel.js"></script>
<script src="./assets/js/bootstrap-typeahead.js"></script>
</body>
</html>