-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathset_date.php
More file actions
37 lines (28 loc) · 723 Bytes
/
set_date.php
File metadata and controls
37 lines (28 loc) · 723 Bytes
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
<?php
// $title = "Disease Analysis";
require 'model/dbfunctions.php';
//check priviliges for sudo
if (!isset($_SESSION['staffid']) || $_SESSION['role'] != 'doctor') {
die('No appropriate rights to access the file');
}
$conn = dbconnect();
if ($conn) {
$pat = $_POST['pat'];
$date = $_POST['date'];
$sql = "UPDATE pattable SET next_visit=\"$date\" WHERE idnumber = \"$pat\"";
$results = addData($conn,$sql);
if ($results) {
echo "<script>
$('#set-date').html('Success! Date Set');
// $('#set-date').addClass('disabled');
$('#done').removeClass('hidden');
</script>";
} else {
echo "<script>
alert('Error while setting date.');
</script>";
}
} else {
die('Couldnt connect to db');
}
?>