-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdelete_patient_ad.php
74 lines (63 loc) · 2.24 KB
/
delete_patient_ad.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
<?php
if(isset($_POST['del_username'])){
$con = mysqli_connect('localhost','root','','patient_database');
if(!$con)
{
die("connection failed due to " . mysqli_connect_error());
}
else
{
//echo "connection to database is successful";
}
session_start();
if(!isset($_SESSION['adminloggedIn']) || $_SESSION['adminloggedIn'] = false)
{
header("Location: http://localhost/hms/admin login.php ");
exit;
}
$del_username = $_POST['del_username'];
$sql = "DELETE from patient where patient_ID = '$del_username'";
if ($con->query($sql) === TRUE) {
echo "<script> alert('deletion successful') </script>";
} else {
echo "Error deleting record: " . $conn->error;
}
$con->close();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<title>Delete Patient Info</title>
<style>
body{
background: url(https://img.freepik.com/free-photo/old-black-background-grunge-texture-blackboard-chalkboard-concrete_1258-52289.jpg?w=2000);
background-repeat: no-repeat;
background-size: cover;
color: white;
}
.container
{
margin-top: 200px;
}
</style>
</head>
<body>
<?php require('navbar_admin_panel.php') ?>;
<div class="container w-25">
<h3>Enter Patient Username</h3>
<form action="delete_patient_ad.php" method="post">
<div class="mb-3 mt-5">
<label for="exampleInputPassword1" class="form-label">Patient ID</label>
<input type="text" name="del_username" class="form-control" id="exampleInputPassword1">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
</body>
</html>