-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomplete_payment.php
47 lines (46 loc) · 1.78 KB
/
complete_payment.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
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<?php
session_start();
if(!isset($_SESSION['client']['status']))
{
header('location:login.php');
}
include('include/config.php');
extract($_POST);
$time=time();
$seatno[]=$_SESSION['seatno'];
$sno=implode(',',$seatno);
if($otp=="123456")
{
$bookid="BKID".rand(1000000,9999999);
mysqli_query($con,"insert into booking (b_bookid,b_theatre,b_unm,b_show,b_screen,b_seat,b_amt,b_date,b_time) values('$bookid','".$_SESSION['theatre']."','".$_SESSION['client']['uid']."','".$_SESSION['show']."','".$_SESSION['screen']."','".$_SESSION['seats']."','".$_SESSION['amount']."','".$_SESSION['date']."',$time)");
$seat= $_SESSION['seats'];
$showid= $_SESSION['show'];
$uq= "update shows set show_seat=(show_seat-$seat)
where show_id=$showid ";
mysqli_query($con,$uq);
$uq1= "update seat set
seat_uid='".$_SESSION['client']['uid']."'
where seat_id IN ($sno)";
mysqli_query($con,$uq1);
$mve=$seat.' Seats Booked ';
$uq1="insert into activity (ac_nm,ac_time) values('$mve','$time')";
mysqli_query($con,$uq1);
$_SESSION['success']="Booking Successfully Completed";
unset($_SESSION['seatno']);
unset($_SESSION['show']);
unset($_SESSION['screen']);
unset($_SESSION['seats']);
unset($_SESSION['amount']);
unset($_SESSION['date']);
}
else
{
$_SESSION['error']="Payment Failed";
}
?>
<body><table align='center'><tr><td><STRONG>Transaction is being processed,</STRONG></td></tr><tr><td><font color='blue'>Please wait <i class="fa fa-spinner fa-pulse fa-fw"></i>
<span class="sr-only"></font></td></tr><tr><td>(Please do not press 'Refresh' or 'Back' button )</td></tr></table><h2>
<script>
setTimeout(function(){ window.location="profile.php"; }, 5000);
</script>