forked from StandeBoer/PvB
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModalEditStudent.php
More file actions
34 lines (34 loc) · 1.72 KB
/
ModalEditStudent.php
File metadata and controls
34 lines (34 loc) · 1.72 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
<div id="ModalEditStudent" class="modal">
<div class="modal-header" style="padding-left: 24px;">
<h5> Bewerken</h5>
</div>
<div class="modal-content">
<form method="POST">
<i class="material-icons prefix tiny">mode_edit</i><label>Om studentgegevens aan te passen voert u hier de wijziging in:</label>
<input type="hidden" class="form-control" style="border-radius: 0;" name="student_id" id="student_id">
<input type="text" class="form-control hide" style="border-radius: 0;" name="student_naam" id="student_naam" placeholder="Naam">
<input type="text" class="form-control hide" style="border-radius: 0;" name="student_email" id="student_email" placeholder="Emailadres"><br>
<button type="submit" name="edit_student_submit" class="btn btn-success" value="Opslaan">Opslaan</button>
<input type="submit" name="sluiten" class="btn btn-success data-dismiss" value="Annuleren">
</form>
</div>
</div>
<?php
if (isset($_POST["edit_student_submit"])) {
if (isset($_POST["student_naam"])) {
$edit_student_id = $_POST["student_id"];
//echo $edit_student_id;
$edit_student_naam = $_POST["student_naam"];
//echo $edit_student_naam;
$edit_student_emailadres = $_POST["student_email"];
//echo $edit_student_emailadres;
$edit_student = "UPDATE student SET student_naam='$edit_student_naam', student_emailadres='$edit_student_emailadres' WHERE student_id = $edit_student_id";
//echo $edit_student;
if ($conn->query($edit_student) === TRUE) {
//echo "Record updated successfully";
} else {
//echo "Error updating record: " . $conn->error;
}
}
}
?>