-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditStudent.php
113 lines (99 loc) · 4.58 KB
/
editStudent.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
<?php
require ("php/login.php");
validate_login();
$user = fetch_account($_SESSION["accountID"]);
if (!$user['priv']) {
header("HTTP/1.0 403 Forbidden");
die();
}
if ($_POST["ID"] != "NaN") {
$finduser = $db->prepare("SELECT `First Name`, `Last Name`, `Subject`, `Year`, `House`, `colNum` FROM students WHERE ID=?");
$finduser->bind_param("i", $_POST["ID"]);
$finduser->bind_result($fname, $sname, $subject, $year, $house, $colNum);
$finduser->execute();
$finduser->fetch();
$finduser->close();
}
?>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Subject Support</title>
<link rel="stylesheet" href="login.css"></link>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(window, document, undefined).ready(function() {
$('input').blur(function() {
var $this = $(this);
if ($this.val())
$this.addClass('used');
else
$this.removeClass('used');
});
var $ripples = $('.ripples');
$ripples.on('click.Ripples', function(e) {
var $this = $(this);
var $offset = $this.parent().offset();
var $circle = $this.find('.ripplesCircle');
var x = e.pageX - $offset.left;
var y = e.pageY - $offset.top;
$circle.css({
top: y + 'px',
left: x + 'px'
});
$this.addClass('is-active');
});
$ripples.on('animationend webkitAnimationEnd mozAnimationEnd oanimationend MSAnimationEnd', function(e) {
$(this).removeClass('is-active');
});
});
window.onload = function() {
$('input').each(function() {
var $this = $(this);
if ($this.val())
$this.addClass('used');
else
$this.removeClass('used');
});
}
</script>
</head>
<body>
<hgroup>
<h1><br></h1>
</hgroup>
<form action="./requests/editStudent.php" method="post">
<input type="hidden" name="ID" value="<?=$_POST['ID']?>">
<div class="group">
<input type="text" name="fname" value="<?php if ($_POST['ID'] != "NaN") { echo $fname; } ?>"><span class="highlight"></span><span class="bar"></span>
<label class="text">First Name</label>
</div>
<div class="group">
<input type="text" name="sname" value="<?php if ($_POST['ID'] != "NaN") { echo $sname; } ?>"><span class="highlight"></span><span class="bar"></span>
<label class="text">Last Name</label>
</div>
<div class="group">
<input type="number" name="colNum" value="<?php if ($_POST['ID'] != "NaN") { echo $colNum; } ?>"><span class="highlight"></span><span class="bar"></span>
<label class="text">College Number</label>
</div>
<div class="group">
<input type="text" name="subject" value="<?php if ($_POST['ID'] != "NaN") { echo $subject; } ?>"><span class="highlight"></span><span class="bar"></span>
<label class="text">Subject</label>
</div>
<div class="group">
<input type="number" name="year" value="<?php if ($_POST['ID'] != "NaN") { echo $year; } ?>"><span class="highlight"></span><span class="bar"></span>
<label class="text">Year</label>
</div>
<div class="group">
<input type="text" name="house" value="<?php if ($_POST['ID'] != "NaN") { echo $house; } ?>"><span class="highlight"></span><span class="bar"></span>
<label class="text">House</label>
</div>
<button type="submit" class="button buttonBlue">Submit
<div class="ripples buttonRipples"><span class="ripplesCircle"></span></div>
</button>
</form>
<footer>
<img src="./res/logo.png">
</footer>
</body>
</html>