-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomplain.php
More file actions
28 lines (23 loc) · 1.12 KB
/
complain.php
File metadata and controls
28 lines (23 loc) · 1.12 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
<?php include 'basic.php';
try{
$staff_id = $_SESSION['staff_id'];
$rnumber = $_POST['rnumber'];
$complainment = $_POST['complainment'];
$detail = $_POST['detail'];
$q_staff_id = $db->quote($staff_id);
$q_rnumber = $db->quote($rnumber);
$q_complainment = $db->quote($complainment);
$q_detail = $db->quote($detail);
$str = "INSERT INTO complainment (ttime, rnumber, staff_id, complainment, detail, recept)
VALUE (NOW()," .$q_rnumber. "," .$q_staff_id. "," .$q_complainment. "," .$q_detail. ", 0)";
$str2 = "INSERT INTO task_log (ttime, rnumber, staff_id, tstatus)
VALUE (NOW()," .$q_rnumber. "," .$q_staff_id. ", 'COMPLAIN.REC.')";
$db->exec($str);
$db->exec($str2);
print "<script language=javascript> alert('Request has been registered.'); location.replace('receptionistT4.php'); </script>";
exit;
}catch(PDOException $ex){ ?>
<p>Sorry, a database error occurred. Please try again later.</p>
<p>(Error details: <?= $ex->getMessage() ?>)</p>
<?php }
?>