1<!DOCTYPE html> 2<html lang="en"> 3 4<head> 5 <meta charset="UTF-8"> 6 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 7 <!-- google auth --> 8 <meta name="google-signin-scope" content="profile email"> 9 <!-- <meta name="google-signin-client_id" content="17497386457-mqhn9rs4ch5grrh860l88hc3mfjrur73.apps.googleusercontent.com"> --> 10 <meta name="google-signin-client_id" content="854889139379-bg69h5pnqh2e5qaptfsnpq07v30534jc.apps.googleusercontent.com"> 11 <title>Sign In</title> 12 <!-- flavicon --> 13 <link rel="icon" type="image/png" sizes="16x16" href="https://www.bharattaxi.com/assets/favicon/favicon_ico.png"> 14 <link rel="apple-touch-icon" sizes="180x180" href="https://www.bharattaxi.com/assets/favicon/apple-touch-icon.png"> 15 <link rel="icon" type="image/png" sizes="16x16" href="https://www.bharattaxi.com/assets/favicon/favicon_ico.png"> 16 <link rel="icon" type="image/png" sizes="16x16" href="https://www.bharattaxi.com/assets/favicon/favicon-16x16.png"> 17
17<script src="https://accounts.google.com/gsi/client" async defer></script>
17 18
18<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
18 19 <!-----bootstrap5 --> 20 <link href="https://www.bharattaxi.com/assets/dashboard/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"> 21 <!------external css--> 22 <link rel="stylesheet" href="https://www.bharattaxi.com/assets/dashboard/style/style.css"> 23 <link rel="stylesheet" href="https://www.bharattaxi.com/assets/dashboard/style/login.css"> 24 <!-- Parsley js and cdn --> 25 <link href="https://cdn.jsdelivr.net/npm/[email protected]/src/parsley.min.css" rel="stylesheet"> 26</head> 27 28<body> 29 <Section> 30 <div class="container-fluid"> 31 <div class="row" style="height: 100vh;"> 32 <div class="col-md-6 d-md-block d-none px-0"> 33 <div id="login_left" class="pb-0 px-0 d-lg-block d-done"> 34 <!-- Header Section --> 35 <header> 36 <div class="container"> 37 <nav class="navbar navbar-expand-md"> 38 <a class="navbar-brand ms-md-5" href="https://www.bharattaxi.com/"> 39 <img src="https://www.bharattaxi.com/assets/dashboard/images/logo.svg" class="img-fluid logo_size" alt="Logo"> 40 </a> 41 </nav> 42 43 </div> 44 </header> 45 46 <!----------end of header section--------------> 47 <div class="container-fluid"> 48 <div class="border-bottom"></div> 49 </div> 50 51 <div class="container d-md-block d-none"> 52 <a href="https://www.bharattaxi.com/support" class="search_icon"> 53 <img src="https://www.bharattaxi.com/assets/dashboard/svg/search_icon.svg" class="img-fluid me-2"> 54 Support 55 </a> 56 </div> 57 </div> 58 </div> 59 <div class="col-md-6" id="login_right"> 60 <div class="container d-flex flex-column min-vh-100"> 61 <div class="d-md-none d-block mb-3"> 62 <a class="navbar-brand" href="https://www.bharattaxi.com/"> 63 <img src="https://www.bharattaxi.com/assets/dashboard/images/logo.svg" class="img-fluid logo_size" alt="Logo"> 64 </a> 65 </div> 66 67 <form data-parsley-validate="" id="loginForm" class="mt-auto"> 68 <div class="mb-4"> 69 <h1>Welcome Back!</h1> 70 <span>Enter your email and password to access account.</span> 71 </div> 72 <input type="hidden" name="refer_code" value=""> 73 <!-----email--------> 74 <div class="input-group reg_input-group mt-auto"> 75 <span class="input-icon-left"> 76 <img src="https://www.bharattaxi.com/assets/dashboard/svg/loginemil.svg" alt="email icon"> 77 </span> 78 <input type="text" class="form-control py-3" name="user_name" id="user_name" placeholder="Email ID" data-parsley-required="true" data-parsley-name="Email" data-parsley-pattern="^(?![!_.-])[a-zA-Z][a-zA-Z0-9._-]*(?=.*[0-9])?@[a-zA-Z.-]+\.[a-zA-Z]{2,}$"> 79 <small class="text-danger" id="user_name_error"></small> 80 </div> 81 <!-----password--------> 82 <div class="input-group reg_input-group mb-2"> 83 <span class="input-icon-left"> 84 <img src="https://www.bharattaxi.com/assets/dashboard/svg/password-check.svg" alt="Password Icon"> 85 </span> 86 87 <input type="password" class="form-control py-3" name="password" id="password" placeholder="Password" data-parsley-required="true" data-parsley-name="Password"> 88
89 <span class="input-icon-right" id="togglePassword"> 90 <img src="https://www.bharattaxi.com/assets/dashboard/svg/passwordprotect.svg" alt="Password Icon" id="eye-icon"> 91 </span> 92 <small class="text-danger" id="password_error"></small> 93 </div> 94 95 <div class="d-flex flex-wrap justify-content-between input-group2 align-items-center"> 96 97 <div class=""> 98 <input type="checkbox" name="remember_me" id="remember_me" class="d-none customCheckbox"> 99 <!-- Add the checked attribute here --> 100 <label for="remember_me" class="custom-checkbox-label d-flex align-items-center cursor-pointer"> 101 <span class="checkbox-icon me-2 mt-0"></span> 102 <h6 class="remberme mb-0">Remember me</h6> 103 </label> 104 </div> 105 <div> 106 <h6 class="mb-0"><a href="https://www.bharattaxi.com/forgot">Forgot Password?</a></h6> 107 </div> 108 </div> 109 <div class="text-center"><button class="sign_in_btn register-btn" type="button" id="loginBtn">Sign 110 In</button></div> 111 <div class="d-flex align-items-center dashed_lines my-md-4 my-2"> 112 <div class="flex-grow-1 border-dotted"></div> 113 <span class="mx-2 mt-0">OR</span> 114 <div class="flex-grow-1 border-dotted"></div> 115 </div> 116 <div class="d-flex justify-content-center google_btn_row"> 117 118 <!-- <button id="login_via_google" class="google_btn g-signin2" data-onsuccess="onSignIn" type="button"><img src="https://www.bharattaxi.com/assets/dashboard/svg/Google-Original.svg" class="img-fluid me-2"> 119 Goggle 120 </button> --> 121 <div id="g_id_onload" data-client_id="854889139379-bg69h5pnqh2e5qaptfsnpq07v30534jc.apps.googleusercontent.com" data-callback="handleCredentialResponse" data-auto_prompt="false"> 122 </div> 123 124 <div class="g_id_signin" data-type="standard" data-shape="rectangular" data-theme="outline" data-text="signin_with" data-size="large" data-logo_alignment="left"> 125 </div> 126 127 </div> 128 </form> 129 <div class="footer mt-auto"> 130 <div> 131 <h5>Don't have an account? <a href="https://www.bharattaxi.com/register">Sign Up for Free</a> 132 </h5> 133 <h6 class="mt-md-4 mt-3">©2026 <span>Bharat Taxi</span></h6> 134 </div> 135 </div> 136 </div> 137 </div> 138 </div> 139 </div> 140 <div class="modal fade" id="myModal" tabindex="-1" aria-labelledby="myModalLabel" aria-hidden="true"> 141 <div class="modal-dialog"> 142 <div class="modal-content shadow"> 143 <div class="modal-header"> 144 <h5 class="modal-title">Update Mobile Number</h5> 145 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> 146 </div> 147 <div class="modal-body"> 148 <form action="https://www.bharattaxi.com/login" class="needs-validation" novalidate method="POST" accept-charset="utf-8"> 149 <div class="row"> 150 <div class="col-12"> 151 <input type="hidden" name="user_id" id="user_id" required> 152 <label for="mobileno" class="form-label text-primary fw-semibold">Enter Mobile No:</label> 153 <input type="tel" maxlength="10" class="form-control border border-2 py-2 rounded-2" pattern="^\d{10}$" id="txt_mobile" placeholder="Enter your mobile number" name="mobileno" required> 154 <div class="valid-feedback"></div> 155 <div class="invalid-tooltip">Please enter 10 digit mobile number </div> 156 <div class="invalid-feedback">Please fill out this field.</div> 157 <div class="text-danger" id="errrr"></div> 158 </div> 159 </div> 160 </div> 161 162 <!-- Modal footer --> 163 <div class="modal-footer"> 164 <button id="btn_update_mobile" type="submit" class="btn btn-primary">
164Update</button> 165 <button type="button" class="btn btn-danger" data-bs-dismiss="modal" aria-label="Close">Close</button> 166 </div> 167 </form> </div> 168 </div> 169 </div> 170 <!-- error modal --> 171 <div class="modal fade successModal" id="ErrorModal" tabindex="-1" aria-labelledby="successModalLabel" aria-hidden="true"> 172 <div class="modal-dialog modal-dialog-centered px-3 ms-sm-auto ms-0"> 173 <div class="modal-content sucess-modal" id="sucess-modal"> 174 <!-- Tick icon and heading --> 175 <div class="modal-body"> 176 <div> 177 <svg width="62" height="62" viewBox="0 0 62 62" fill="none" xmlns="http://www.w3.org/2000/svg"> 178 <circle cx="31" cy="31" r="31" fill="#FDE3E5" /> 179 <path d="M48.2804 39.2297L35.6684 17.3848C33.6084 13.776 28.3991 13.776 26.3465 17.3848L13.7271 39.2297C11.6671 42.8385 14.231 47.3216 18.3881 47.3216H43.575C47.7321 47.3216 50.3404 42.794 48.2804 39.2297ZM31.0001 42.4754C29.9034 42.4754 28.9919 41.5639 28.9919 40.4672C28.9919 39.3705 29.9034 38.4591 31.0001 38.4591C32.0968 38.4591 33.0082 39.3705 32.9637 40.5191C33.0156 41.5639 32.0523 42.4754 31.0001 42.4754ZM32.8304 29.4929C32.7414 31.049 32.6451 32.5977 32.5562 34.1538C32.5117 34.6577 32.5117 35.1171 32.5117 35.6136C32.4673 36.4361 31.8226 37.0734 31.0001 37.0734C30.1775 37.0734 29.5403 36.4806 29.4884 35.6581C29.355 33.235 29.2142 30.8563 29.0808 28.4332C29.0364 27.796 28.9919 27.1513 28.9401 26.514C28.9401 25.4618 29.5329 24.5948 30.4962 24.3206C31.4595 24.0909 32.4154 24.5503 32.8304 25.4618C32.9712 25.7804 33.0156 26.099 33.0156 26.4696C32.9712 27.4847 32.8748 28.4925 32.8304 29.4929Z" fill="#E63A48" /> 180 </svg> 181 182 </div> 183 <h5 class="modal-title" id="successModalLabel"> 184 Error 185 </h5> 186 <span id="error_message" class="text-center">Please try again later</span> 187 <button type="button" class="btn-sucess" style="background-color: #E63A48;" data-bs-dismiss="modal" aria-label="Close" style="font-size: 12px;" onclick="$('#ErrorModal').modal('hide')">Ok</button> 188 </div> 189 </div> 190 </div> 191 </div> 192 <!-- end error modal --> 193 </Section> 194 <!-- Link to external JavaScript files --> 195
195<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/parsley.min.js"></script>
195 196 <!--bootstrap5-----> 197
197<script src="https://www.bharattaxi.com/assets/dashboard/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
197 198 199 <!-- swal cdn --> 200
200<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
200 201 202
202<script> 203 $(document).ready(function() { 204 checkRememberedCredentials(); 205 $('#loginBtn').on('click', function(e) { 206 e.preventDefault(); 207 const rememberCheckbox = $('#remember_me'); 208 const email = $('#user_name').val(); 209 const password = $('#password').val(); 210 211 if (rememberCheckbox.is(':checked')) { 212 // Set cookie for 30 days 213 setCookie('remembered_email', email, 30); 214 setCookie('remembered_password', password, 30); 215 // console.log("Cookie set for email:", email); // Debugging log 216 } else { 217 // Clear cookie if unchecked 218 deleteCookie('remembered_email'); 219 deleteCookie('remembered_password'); 220 // console.log("Cookie deleted for email."); // Debugging log 221 } 222 223 224 // Iterate through each input field in the form 225 $('#loginForm input').each(function() { 226 if ($(this).val() === '') { 227 $(this).focus(); // Set focus to the first empty field 228 return false; // Break out of the each loop 229 } 230 }); 231 // clear previous error message 232 $(".form-control").siblings('.text-danger').text(''); 233 var $this = $(this); // Reference to the button 234 var $caption = $this.html(); // Store the original button text 235 // Get form data 236 if ($("#loginForm").parsley().isValid()) { 237 var data = $("#loginForm").serialize(); 238 $.ajax({
239 type: "POST", 240 url: "https://www.bharattaxi.com/login", 241 data: data, 242 beforeSend: function() { 243 // Disable the button and change its text 244 $this.attr('disabled', true).html("Signing In..."); 245 }, 246 success: function(response) { 247 248 if (response.success) { 249 // Re-enable the button and restore its original text after a delay 250 setTimeout(function() { 251 $this.attr('disabled', false).html( 252 $caption); // Restore original text after delay 253 }, 2000); // Adjust the delay as needed (2000 ms = 2 seconds) 254 window.location.href = response.url; 255 } else { 256 $this.attr('disabled', false).html($caption); 257 if (response.error) { // if login failed 258 $("#error_message").text(response.error); 259 $("#ErrorModal").modal('show'); 260 $('#password').val(''); 261 } else { // default validation message 262 $.each(response.errors, function(key, value) { 263 $("#" + key + "_error").text(value) 264 }); 265 266 } 267 268 } 269 } 270 }); 271 } else { 272 // Collect error messages 273 let errorMessages = []; 274 // Check for required fields first 275 $('#loginForm').find('[data-parsley-required]').each(function() { 276 var $field = $(this); 277 var fieldName = $field.attr('data-parsley-name') || $field.attr('name'); 278 // var value = $field.val(); // Get the value of the field 279 var value = $field.val(); // Get the value of the field 280 // Check if the field is empty 281 if (!value) { 282 errorMessages.push(fieldName + " field is required."); 283 $field.siblings('.text-danger').text(fieldName + 284 " is required."); // Show error below the field 285 hasError = true; // Set error flag 286 } else { 287 value = value.trim(); // Trim the value after checking for null 288 289 // Check for minimum length 290 var minLength = $field.data('parsley-minlength'); 291 if (minLength && value.length < minLength) { 292 errorMessages.push(fieldName + " must be at least " + minLength + 293 " characters long."); 294 $field.siblings('.text-danger').text(fieldName + " must be at least " + 295 minLength + " characters long."); // Show error below the field 296 297 hasError = true; // Set error flag 298 } 299 300 // Check for maximum length 301 var maxLength = $field.data('parsley-maxlength'); 302 if (maxLength && value.length > maxLength) { 303 errorMessages.push(fieldName + " must be no more than " + maxLength + 304 " characters long."); 305 306 $field.siblings('.text-danger').text(fieldName + 307 " must be no more than " + maxLength + " characters long." 308 ); // Show error below the field 309 310 hasError = true; // Set error flag 311 } 312 313 // Check for pattern validation
314 if ($field.data('parsley-pattern') && !new RegExp($field.data( 315 'parsley-pattern')).test(value)) { 316 errorMessages.push(fieldName + " is invalid."); 317 // Determine where to show the error message 318 319 $field.siblings('.text-danger').text(fieldName + 320 " is invalid."); // Show error below the field 321 322 hasError = true; // Set error flag 323 } 324 } 325 326 327 328 // Clear error messages if no errors 329 if (!hasError) { 330 $field.siblings('.text-danger').text(''); // Clear error below the field 331 } 332 }); 333 } 334 }); 335 336 // Cookie functions 337 function setCookie(name, value, days) { 338 const date = new Date(); 339 date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); 340 const expires = "expires=" + date.toUTCString(); 341 document.cookie = `${name}=${value};${expires};path=/;`; // Removed Secure for testing 342 } 343 344 function getCookie(name) { 345 const cookieName = name + "="; 346 const decodedCookie = decodeURIComponent(document.cookie); 347 const cookieArray = decodedCookie.split(';'); 348 349 for (let i = 0; i < cookieArray.length; i++) { 350 let cookie = cookieArray[i]; 351 while (cookie.charAt(0) === ' ') { 352 cookie = cookie.substring(1); 353 } 354 if (cookie.indexOf(cookieName) === 0) { 355 return cookie.substring(cookieName.length, cookie.length); 356 } 357 } 358 return ""; 359 } 360 361 function deleteCookie(name) { 362 document.cookie = `${name}=;expires=Thu, 01 Jan 1970 00:00:00 UTC;path=/;`; 363 } 364 365 function checkRememberedCredentials() { 366 const rememberedEmail = getCookie('remembered_email'); 367 const rememberedPassword = getCookie('remembered_password'); 368 if (rememberedEmail && rememberedPassword) { 369 $('#user_name').val(rememberedEmail); 370 $('#password').val(rememberedPassword); 371 $('#remember_me').prop('checked', true); 372 } 373 } 374 375 }) 376 // show and hide password 377 $('#togglePassword').click(function() { 378 const passwordField = $('#password'); 379 const eyeIcon = $('#eye-icon'); 380 381 // Check the current type of the password field 382 if (passwordField.attr('type') === 'password') { 383 // If it's password, change to text and show eye-slash icon 384 passwordField.attr('type', 'text'); 385 var imgUrl = "https://www.bharattaxi.com/assets/dashboard/svg/eye-slash.svg"; 386 eyeIcon.attr('src', imgUrl); 387 } else { 388 // If it's text, change to password and show eye icon 389 passwordField.attr('type', 'password'); 390 var imgUrl = "https://www.bharattaxi.com/assets/dashboard/svg/passwordprotect.svg"; 391 eyeIcon.attr('src', imgUrl); 392 393 } 394 }); 395 </script>
395 396 397 <!-- update mobile number script --> 398
398<script> 399 $("#btn_update_mobile").click(function() { 400 var user_id = $("#user_id").val(); 401 var mobile = $("#txt_mobile").val(); 402 var leng = $("#txt_mobile").val().length; 403 var filter = 404 /^((\+[1-9]{1,4}[ \-]*)|(\([0-9]{2,3}\)[ \-]*)|([0-9]{2,4})[ \-]*)*?[0-9]{3,4}?[ \-]*[0-9]{3,4}?$/; 405 if (mobile == "") { 406 $("#errrr").text("PLease enter mobile no!"); 407 return false; 408 } 409 if (leng == 10) { 410 if (filter.test(mobile)) { 411 $.ajax({ 412 url: "update-mobile", 413 method: "POST", 414 dataType: "JSON", 415 data: { 416 user_id: user_id, 417 mobile: mobile 418 }, 419 success: function(response) { 420 421 if (response.status == 2) { 422 $("#errrr").text(response.msg); 423 return false; 424 } else if (response.status == 1) { 425 window.location.href = "users"; 426 } else { 427 return false; 428 } 429 } 430 }); 431 } 432 } 433 return false; 434 }); 435 </script>
435 436 437 <!-- old google sign in script --> 438 <!--
438<script> 439 function onSignIn(googleUser) { 440 var profile = googleUser.getBasicProfile(); 441 var id_token = googleUser.getAuthResponse().id_token; 442 $.ajax({ 443 url: "https://www.bharattaxi.com/login-with-google", 444 method: "POST", 445 data: { 446 id: profile.getId(), 447 email: profile.getEmail(), 448 image: profile.getImageUrl(), 449 full_name: profile.getName() 450 }, 451 dataType: "JSON", 452 success: function(response) { 453 if (response.login == 1 && response.update_mobile == 1) { 454 $("#user_id").val(response.user_id); 455 $("#myModal").modal('show'); 456 } else if (response.login == 1 && response.update_mobile == 0) { 457 window.location.href = "users"; 458 } else { 459 alert("Something Went Wrong!"); 460 } 461 } 462 }); 463 } 464 465 function signOut() { 466 var auth2 = gapi.auth2.getAuthInstance(); 467 auth2.signOut().then(function() { 468 console.log('User signed out.'); 469 }); 470 } 471 472 function onLoad() { 473 gapi.load('auth2', function() { 474 gapi.auth2.init(); 475 }); 476 } 477 // Only call onLoad if needed, but avoid auto-triggering 478 window.onload = function() { 479 onLoad(); // This initializes, but won't prompt unless interacted with 480 }; 481 </script>
481 --> 482 <!-- new google login script --> 483
483<script> 484 // This function is automatically called when the user signs in 485 function handleCredentialResponse(response) { 486 // Decode the credential (JWT token) to extract user info 487 const data = parseJwt(response.credential); 488 489 // Extract user info 490 const profile = { 491 id: data.sub, // Google user ID 492 email: data.email, 493 image: data.picture, 494 full_name: data.name 495 }; 496 497 // Send data to your backend via AJAX 498 $.ajax({ 499 url: "https://www.bharattaxi.com/login-with-google", 500 method: "POST", 501 data: profile, 502 dataType: "JSON", 503 success: function(response) { 504 if (response.login == 1 && response.update_mobile == 1) { 505 $("#user_id").val(response.user_id); 506 $("#myModal").modal('show'); 507 } else if (response.login == 1 && response.update_mobile == 0) { 508 window.location.href = "users"; 509 } else { 510 alert("Something Went Wrong!"); 511 } 512 }, 513 error: function() { 514 alert("Failed to connect to server."); 515 } 516 }); 517 } 518 519 // Helper function to decode the JWT token returned by Google 520 function parseJwt(token) { 521 const base64Url = token.split('.')[1]; 522 const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/'); 523 const jsonPayload = decodeURIComponent( 524 atob(base64) 525 .split('') 526 .map(c => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2)) 527 .join('') 528 ); 529 return JSON.parse(jsonPayload); 530 } 531 </script>
531 532</body> 533 534</html>
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.