-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremovecustomer.php
More file actions
65 lines (56 loc) · 1.9 KB
/
removecustomer.php
File metadata and controls
65 lines (56 loc) · 1.9 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
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
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>remove customer</title>
<link rel="stylesheet" href="styles.css">
<script type="text/javascript" src="js/main.js"> </script>
</head>
<body>
<h1>parking management</h1>
<?php
session_start();
if(isset($_SESSION['username']))
echo 'Signed In as '.$_SESSION['username'].'<a href="userlog.php?userid='.$_SESSION['userid'].'&type=logout"> Log Out</a>';
else
{
echo "not logged in, please log in!!!!<br> <a href=\"login.php\">login</a>";
die();
}
?>
<h3>remove customer</h3>
<form action="removecustomer.php" name="searchForm" method="get">
<input type="text" name="ph_no" value="" placeholder="mobile number" required>
<button type="submit">Search</button>
</form>
<br><br><br><br><a href="main.php">Go To Home</a>
<?php
require 'dbConnect.php';
$conn=getConnection();
$isgot=0;
if(isset($_GET['ph_no']))
{
$ph_no=$_GET['ph_no'];
//echo $fName."<br>".$mName."<br>".$lName."<br>".$email."<br>".$password."<br>".$confirmPasss;
$stmt = $conn->prepare("DELETE FROM customer WHERE contact_no='$ph_no'");
$iswritten=false;
if($stmt->execute())
{
$isWritten=true;
$errorcode=100;
}
else
{
$isWritten=false;
$errorcode=100;
}
if($isWritten)
{
echo '<h1>DONE</h1><br><a href="main.php">Go To Home</a>';
}
else
{
echo '<h1>ERORR <br>referential integrity constrain voilation</h1><br><a href="main.php">Go To Home</a>';
}
}
?>