forked from edlcn/cs306db
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathattends_d.php
More file actions
43 lines (30 loc) · 975 Bytes
/
attends_d.php
File metadata and controls
43 lines (30 loc) · 975 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
38
39
40
41
42
43
<?php
include "config.php";
if (!empty($_GET["ids"])){
$eid = $_GET["ids"];
$sql_comment = "DELETE FROM attends WHERE e_id = '".$eid."' ";
if (!empty($_GET["pids"])){
$pid = $_GET["pids"];
$sql_comment .= " AND p_id = '".$pid."' ";
$myresult = mysqli_query($db,$sql_comment);
echo "The relationship between Doctor $eid AND Patient $pid is deleted.";
}
else {
$myresult = mysqli_query($db,$sql_comment);
echo "All attend relations of Doctor withID no: $eid is deleted.";
}
}
else {
$sql_comment = "DELETE FROM attends";
if (!empty($_GET["pids"])){
$pid = $_GET["pids"];
$sql_comment .= " WHERE p_id = '".$pid."' ";
$myresult = mysqli_query($db,$sql_comment);
echo "All relationships of patient with ID: $pid is deleted.";
}
else {
$myresult = mysqli_query($db,$sql_comment);
echo "all attend relations are deleted.";
}
}
?>