-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnewcard.php
61 lines (59 loc) · 2.43 KB
/
newcard.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
<?php
include 'dbconn.php';
session_start();
if (isset($_SESSION['username']) && isset($_SESSION['user'])) {
$cardName = $_POST['cardName'];
$cardNumber = $_POST['cardNumber'];
$expdate = $_POST['expdate'];
$movie_id = $_POST["movieid"];
$theatre_ID = $_POST["theatreid"];
$showtime_ID = $_POST["showtimeid"];
$childNum = $_POST['childnum'];
$adultNum = $_POST['adultnum'];
$seniorNum = $_POST['seniornum'];
$totalprice = $_POST['totalprice'];
$bstreet = $_POST['bstreet'];
$bcity = $_POST['bcity'];
$bstate = $_POST['bstate'];
$bzip = $_POST['bzip'];
if (isset($_POST['saveBox'])) {
$save = 1;
} else {
$save = 0;
}
$sql = "INSERT INTO Payment_Info (B_Name, B_Street, B_City, B_State, B_ZIP, C_Num, C_Exp_Date, C_Saved, Username) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?);";
$stmt = $conn->prepare($sql);
$stmt->bind_param("sssssssss", $cardName, $bstreet, $bcity, $bstate, $bzip, $cardNumber, $expdate, $save, $_SESSION['username']);
if ($stmt->execute()) {
?>
<form name="name" id="name" method="post" action="/4400/confirmation.php" class="form-horizontal">
<input type='hidden' name='cnum' id='childnum' value='<?php echo $cardNumber?>'/>
<input type='hidden' name='childnum' id='childnum' value='<?php echo $childNum?>'/>
<input type='hidden' name='adultnum' id='adultnum' value='<?php echo $adultNum?>'/>
<input type='hidden' name='seniornum' id='seniornum' value='<?php echo $seniorNum?>'/>
<input type='hidden' name='totalprice' id='totalprice' value='<?php echo $totalprice?>'/>
<input type='hidden' name='theatreid' id='theatreid' value='<?php echo $theatre_ID?>'/>
<input type='hidden' name='showtimeid' id='showtimeid' value='<?php echo $showtime_ID?>'/>
<input type='hidden' name='movieid' id='movieid' value='<?php echo $movie_id?>'/>
</form>
<script type="text/javascript">
document.getElementById('name').submit(); // SUBMIT FORM
</script>
<?php
} else {
echo "Something went wrong, please try again";
echo "<b><a href='/4400/nowplaying.php'>Link to movies</a><b>";
}
} else {
?>
<html>
<body>
<div class="alert alert-danger">
<b> not logged in (as a user)</b>
</div>
<br>
<a href="/4400/login.html"> Please login here</a>
</body>
</html>
<?php
}