-
Notifications
You must be signed in to change notification settings - Fork 0
/
payment.php
76 lines (67 loc) · 2.22 KB
/
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
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
75
76
<!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 rel="stylesheet" href="payment.css?v=<?php echo time(); ?>" media="screen">
<title>Ödeme Ekranı</title>
</head>
<body>
<?php
session_start();
ob_start();
include "databaseTicket.php";
include "databaseUser.php";
$id = $_GET['id'];
$sorgu = mysqli_query($con, "SELECT * FROM tickets_info WHERE id=$id");
while ($str = mysqli_fetch_assoc($sorgu)) {
$name = $str['name'];
$price = $str['price'];
}
echo '
<h2>Ödeme Bilgileri</h2>
<div class="payment">
<form method="POST" action="">
<table>
<tr>
<td>Bilet alınan etkinlik</td>
<td><p>' . $name . '</p></td>
</tr>
<tr>
<td>Ödenecek Tutar</td>
<td><p>' . $price . '₺</p></td>
</tr>
<tr>
<td>Ad Soyad</td>
<td><input type="text" name="name" required="required" /></td>
</tr>
<tr>
<td>Kart Numarası</td>
<td><input type="text" name="card_no" pattern="(4\d{12}(?:\d{3})?)" required="required"/></td>
</tr>
<tr>
<td>Son Kullanım Tarihi (aa/yy)</td>
<td><input type="text" pattern="(?:0[1-9]|1[0-2])/[0-9]{2}" title="AA/YY formatında giriniz!" name="last_date" required="required"/></td>
</tr>
<tr>
<td>CVV</td>
<td><input type="text" name="cvv" required="required" /></td>
</tr>
</table>
<input class="btn" type="submit" name="gonder" value="Öde"/>
</form>
</div>';
if (isset($_POST["gonder"])) {
$name = $_POST["name"];
$card_no = $_POST["card_no"];
$last_date = $_POST["last_date"];
$cvv = $_POST["cvv"];
$update = mysqli_query($con, "UPDATE tickets_info SET quantity=quantity-1 WHERE id=$id");
header('Location:Etkinlikler/Biletler.php');
}
mysqli_close($con);
ob_end_flush();
?>
</body>
</html>