-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathdeletedocfromdb.php
90 lines (90 loc) · 3.32 KB
/
deletedocfromdb.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
<?php
require_once("includes.html");
include 'DBconnect.php';
if(isset($_POST['submit1']))
{
$did=$_POST['did'];
$sql = "DELETE FROM doctor WHERE DID= $did ";
$sqlda = "DELETE FROM doctor_available WHERE DID= $did ";
if (mysqli_query($conn, $sql))
{
// echo "Record deleted successfully!!";
echo "<script>
swal({
title: 'Record deleted successfully!!',
text: '',
type: 'success'
},
function(){
window.location.href = 'deletedoctor.php';
});
</script>";
// header( "Refresh:3; url=deletedoctor.php");
}
else
{
echo "Error deleting record: " . mysqli_error($conn); }
if (mysqli_query($conn, $sqlda))
{
echo "<script>
swal({
title: 'Record deleted successfully!!',
text: '',
type: 'success'
},
function(){
window.location.href = 'deletedoctor.php';
});
</script>";
// echo "Record deleted successfully!!";
// header( "Refresh:3; url=deletedoctor.php");
}
else
{
echo "Error deleting record: " . mysqli_error($conn); }
}
if(isset($_POST['submit2']))
{
$did=$_POST['doctorname'];
$sql = "DELETE FROM doctor WHERE did = $did ";
$sqlda = "DELETE FROM doctor_available WHERE DID= $did ";
if (mysqli_query($conn, $sql))
{
// echo "Record deleted successfully!!";
// header( "Refresh:3; url=DeleteDoctor.php");
echo "<script>
swal({
title: 'Record deleted successfully!!',
text: '',
type: 'success'
},
function(){
window.location.href = 'deletedoctor.php';
});
</script>";
}
else
{
echo "Error deleting record: " . mysqli_error($conn);
}
if (mysqli_query($conn, $sqlda))
{
// echo "Record deleted successfully!!";
// header( "Refresh:3; url=DeleteDoctor.php");
echo "<script>
swal({
title: 'Record deleted successfully!!',
text: '',
type: 'success'
},
function(){
window.location.href = 'deletedoctor.php';
});
</script>";
}
else
{
echo "Error deleting record: " . mysqli_error($conn);
}
}
?>