-
Notifications
You must be signed in to change notification settings - Fork 0
/
payment.php
127 lines (117 loc) · 5.29 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./css/payment.css">
<title>Payment Options</title>
</head>
<body>
<?php
include('connection.php');
$sql="INSERT into payment (payid,uniqueid,bid,price,packid) values ('1','5','2','30000','4')";
$result=mysqli_query($conn,$sql);
?>
<div class="container">
<div class="payment-options">
<div class="payment-option" onclick="showCreditCard()">
<img src="./images/credit.jpg" alt="Credit Card" class="payment-icon">
<span class="payment-label">Credit Card</span>
</div>
<div class="payment-option" onclick="showGPay()">
<img src="./images/gpay.jpg" alt="GPay" class="payment-icon">
<span class="payment-label">GPay</span>
</div>
<div class="payment-option" onclick="showPhonePay()">
<img src="./images/phonepe.jpg" alt="PhonePay" class="payment-icon">
<span class="payment-label">PhonePay</span>
</div>
<div class="payment-option" onclick="showPaytm()">
<img src="./images/paytm.jpg" alt="Paytm" class="payment-icon">
<span class="payment-label">Paytm</span>
</div>
</div>
<div class="payment-form" id="creditCardForm" style="display: none;">
<form action="final.php"<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?> method="post">
<h2>Enter Card Details</h2>
<label for="cardNumber">Card Number:</label>
<input type="text" id="cardName" name="cardName" required>
<label for="expiryDate">Expiry Date:</label>
<input type="date" id="expiryDate" name="expiryDate" required>
<label for="cvc">CVC:</label>
<input type="number" id="cvc" name="cvc" required>
<button type="submit">Pay Now</button>
</form>
</div>
<div class="payment-form" id="gpayForm" style="display: none;">
<form action="final.php"<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?> method="post">
<h2>Enter GPay UPI ID</h2>
<label for="gpayId">GPay UPI ID:</label>
<input type="text" id="gpayId" name="gpayId" required>
<button type="submit">Pay Now</button>
</form>
</div>
<div class="payment-form" id="phonePayForm" style="display: none;">
<form action="final.php"<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?> method="post">
<h2>Enter PhonePay UPI ID</h2>
<label for="phonePayId">PhonePay UPI ID:</label>
<input type="text" id="phonePayId" name="phonePayId" required>
<button type="submit">Pay Now</button>
</form>
</div>
<div class="payment-form" id="paytmForm" style="display: none;">
<form action="final.php"<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method="post">
<h2>Enter Paytm UPI ID</h2>
<label for="paytmId">Paytm UPI ID:</label>
<input type="text" id="paytmId" name="paytmId" required>
<button type="submit">Pay Now</button>
</form>
</div>
</div>
<script>
function showCreditCard() {
hideAllForms();
document.getElementById('creditCardForm').style.display = 'block';
}
function showGPay() {
hideAllForms();
document.getElementById('gpayForm').style.display = 'block';
}
function showPhonePay() {
hideAllForms();
document.getElementById('phonePayForm').style.display = 'block';
}
function showPaytm() {
hideAllForms();
document.getElementById('paytmForm').style.display = 'block';
}
function hideAllForms() {
document.getElementById('creditCardForm').style.display = 'none';
document.getElementById('gpayForm').style.display = 'none';
document.getElementById('phonePayForm').style.display = 'none';
document.getElementById('paytmForm').style.display = 'none';
}
</script>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (isset($_POST["cardNumber"])) {
// Process credit card details
// Your processing logic here for credit card
echo "<script>alert('Credit Card Payment Processed!');</script>";
} elseif (isset($_POST["gpayId"])) {
// Process GPay UPI ID
// Your processing logic here for GPay UPI ID
echo "<script>alert('GPay Payment Processed!');</script>";
} elseif (isset($_POST["phonePayId"])) {
// Process PhonePay UPI ID
// Your processing logic here for PhonePay UPI ID
echo "<script>alert('PhonePay Payment Processed!');</script>";
} elseif (isset($_POST["paytmId"])) {
// Process Paytm UPI ID
// Your processing logic here for Paytm UPI ID
echo "<script>alert('Paytm Payment Processed!');</script>";
}
}
?>
</body>
</html>