-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdel_customer.txt
34 lines (31 loc) · 917 Bytes
/
del_customer.txt
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
<?php
session_start();
require_once "config.php";
if(!isset($_SESSION['loggedin']) || $_SESSION['loggedin'] !==true){
header('Location: login.php');
exit;
} else{
if ($_SERVER['REQUEST_METHOD'] == "POST"){
$cin=$_POST['checkin'];
$cout=$_POST['checkout'];
$usr=$_SESSION["username"];
$sql="INSERT INTO reservations (username, name, room_no, checkin, checkout, number, paid) VALUES ('$usr',?, ?, '$cin', '$cout', ?, 0)";
$stmt=mysqli_prepare($conn, $sql);
if($stmt)
{
mysqli_stmt_bind_param($stmt,"sis",$para_name,$para_room,$para_number);
$para_number=$_POST['number'];
$para_room=$_POST['room_no'];
$para_name=$_POST['name'];
if (mysqli_stmt_execute($stmt))
{
echo "Room Booked!! Proceed for Payment";
header("location: billing.php");
}
else{
echo "Something went wrong...";
}
}
mysqli_close($conn);
}}
?>