-
Notifications
You must be signed in to change notification settings - Fork 3
/
Selpay.php
250 lines (210 loc) · 5.58 KB
/
Selpay.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
<?php session_start(); ?>
<style type="text/css">
/* Variables
–––––––––––––––––––––––––––––––––––––––––––––––––– */
:root {
--primary-c: #2196F3;
--secondary-c: #B2D7F5;
--white: #FDFBFB;
--text: #082943;
--bg: var(--primary-c);
}
/* Basic Config
–––––––––––––––––––––––––––––––––––––––––––––––––– */
html, body {
height: 100%;
padding: 0;
margin: 0;
}
body {
background-image: url('1.jpg');
display: flex;
justify-content: center;
align-items: center;
font-family: 'Raleway', sans-serif;
color: var(--text);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
ul {
list-style-type: none;
padding-left: 50px;
margin: 0;
}
li {
display: block;
position: relative;
padding: 20px 0px;
}
h2 {
margin: 10px 0;
font-weight: 900;
}
/* Card
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.card {
display: flex;
flex-direction: column;
background: var(--white);
width: 300px;
padding: 20px 25px;
border-radius: 20px;
box-shadow: 0 19px 38px rgba(0, 0, 0, 0.13);
}
/* Radio Button
–––––––––––––––––––––––––––––––––––––––––––––––––– */
input[type=radio] {
position: absolute;
visibility: hidden;
}
label {
cursor: pointer;
font-weight: 400;
}
.check {
width: 30px; height: 30px;
position: absolute;
border-radius: 50%;
transition: transform .6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
.reveal-if-active {
opacity: 0;
max-height: 0;
overflow: hidden;
}
input[type="radio"]:checked ~ .reveal-if-active {
opacity: 1;
max-height: 100px; /* little bit of a magic number :( */
overflow: visible;
}
/* Reset */
input#one ~ .check {
transform: translate(-50px, -25px);
background: var(--secondary-c);
}
input#two ~ .check {
transform: translate(-50px, -215px);
background: var(--primary-c);
box-shadow: 0 6px 12px rgba(33, 150, 243, 0.35);
}
/* Radio Input #1 */
input#one:checked ~ .check { transform: translate(-50px, 165px); }
/* Radio Input #2 */
input#two:checked ~ .check { transform: translate(-50px, -25px); }
input[type=text]:focus {
border: 2px solid #555;
border-radius: 6px;
}
input[type=password]:focus {
border: 2px solid #555;
border-radius: 6px;
}
.button {
-webkit-transition-duration: 0.4s; /* Safari */
transition-duration: 0.4s;
border-radius: 4px;
font-size: 12px;
display: inline;
max-width: 300px;
margin: auto;
background-color: #2196F3;
}
.button:hover {
background-color: #2196F3; /* Green */
color: white;
}
.container {
position: relative;
}
.topright {
position: absolute;
top: 8px;
right: 16px;
font-size: 18px;
}
</style>
<script type="text/javascript">
var FormStuff = {
init: function() {
// kick it off once, in case the radio is already checked when the page loads
this.applyConditionalRequired();
this.bindUIActions();
},
bindUIActions: function() {
// when a radio or checkbox changes value, click or otherwise
$("input[type='radio']").on("change", this.applyConditionalRequired);
},
applyConditionalRequired: function() {
// find each input that may be hidden or not
$(".require-if-active").each(function() {
var el = $(this);
// find the pairing radio or checkbox
if ($(el.data("require-pair")).is(":checked")) {
// if its checked, the field should be required
el.prop("required", true);
} else {
// otherwise it should not
el.prop("required", false);
}
});
}
};
FormStuff.init();
</script>
<script type="text/javascript">
function validate()
{
var id=document.getElementById("upiid");
var pin=document.getElementById("upipin");
var atpos = id.value.indexOf("@");
if (atpos<1)
{
alert("Please enter a valid UPI ID!");
return false;
}
if(pin.value.length != 4 && pin.value.length != 6 )
{
alert("Please enter a valid of UPI pin!");
return false;
}
if (confirm("Do you want to submit your details?") == true) {}
else
{
return false;
}
return true;
}
</script>
<body>
<div class="card">
<h2>How do you want to pay? </h2>
<ul>
<li>
<input type="radio" name="radios" id="one" onclick="FormStuff.bindUIActions();FormStuff.applyConditionalRequired();" />
<label for="one">G Pay</label>
<div class="check"></div>
</br>
</br>
<form class="reveal-if-active" method="POST" action="Selpay.php" onsubmit="return validate()">
<input class="require-if-active" type="text" class="input" name="upiid" id="upiid" placeholder="Enter your UPI ID" pattern="[a-z0-9]+[@][a-z]+" autocomplete="off" style="border-radius: 6px;" required>
</br>
</br>
<input class="require-if-active" type="password" class="input" name="upipin" id="upipin" placeholder="Enter your UPI Pin" pattern="[0-9]+" autocomplete="off" style="border-radius: 6px;" required>
</br>
</br>
<input type="submit" align="center" class="button" data-loading-text="Payment Processing.." value="Checkout!">
</form>
</li>
<li>
<input type="radio" name="radios" id="two" checked />
<label for="two">Cash On Delivery</label>
<div class="check"></div>
</br>
</br>
<div class="reveal-if-active">
<input type="submit" align="center" class="button" data-loading-text="Payment Processing.." value="Checkout!">
</div>
</li>
</ul>
</div>
</body>