/
home
/
u764571690
/
domains
/
savitrfoundation.com
/
public_html
/
/home/u764571690/domains/savitrfoundation.com/public_html
mkdir
upload
Name
Size
Mode
Actions
admin/
-
0755
rm
ajax/
-
0755
rm
api/
-
0755
rm
assets/
-
0755
rm
cache/
-
0755
rm
certificate_view/
-
0755
rm
css/
-
0755
rm
documents_upload/
-
0755
rm
F2/
-
0755
rm
finger data/
-
0755
rm
functions/
-
0755
rm
hts-cache/
-
0755
rm
js/
-
0755
rm
logs/
-
0755
rm
pages/
-
0755
rm
privacy policy/
-
0755
rm
savitrfoundation/
-
0755
rm
scholar/
-
0755
rm
terms and conditions/
-
0755
rm
tmp/
-
0755
rm
uploads/
-
0755
rm
.htaccess
3583
0644
edit
dl
rm
.htaccess.htaccess
9223
0644
edit
dl
rm
.user.ini
623
0644
edit
dl
rm
ads.txt
58
0644
edit
dl
rm
application.php
41647
0644
edit
dl
rm
backblue.gif
4243
0644
edit
dl
rm
careers.php
18402
0644
edit
dl
rm
fade.gif
828
0644
edit
dl
rm
how to apply.php
44852
0644
edit
dl
rm
hts-log.txt
2738
0644
edit
dl
rm
index.php
50
0644
edit
dl
rm
ngo_account_open.php
27984
0644
edit
dl
rm
our_scholars.php
11882
0644
edit
dl
rm
php.ini
617
0644
edit
dl
rm
reupload_document.php
6038
0644
edit
dl
rm
robots.txt
291
0644
edit
dl
rm
scholarshipapply.php
219769
0644
edit
dl
rm
scholarshipportal.php
89993
0644
edit
dl
rm
sendmail.php
2720
0644
edit
dl
rm
sitemap.xml
3743
0644
edit
dl
rm
submit-internship-application.php
8856
0644
edit
dl
rm
sw.js
156
0644
edit
dl
rm
upload_document_main.php
6121
0644
edit
dl
rm
Edit:
/home/u764571690/domains/savitrfoundation.com/public_html/scholarshipapply.php
(219769B)
<?php error_reporting(E_ALL); ini_set('display_errors', 1); date_default_timezone_set('Asia/Kolkata'); // Session configuration for Hostinger ini_set('session.save_path', sys_get_temp_dir()); ini_set('session.gc_maxlifetime', 1440); ini_set('session.cookie_lifetime', 0); require_once 'scholar/db.php'; // Start session with error handling if (session_status() == PHP_SESSION_NONE) { session_start(); } /** * Compress image file to target size (10KB) * @param string $source - Source file path * @param string $destination - Destination file path * @param int $targetSizeKB - Target file size in KB (default 10) * @return bool - Success status */ function compressImage($source, $destination, $targetSizeKB = 10) { // Get image info $imageInfo = @getimagesize($source); if (!$imageInfo) { return false; } $mime = $imageInfo['mime']; $width = $imageInfo[0]; $height = $imageInfo[1]; // Create image resource based on mime type switch ($mime) { case 'image/jpeg': case 'image/jpg': $image = @imagecreatefromjpeg($source); break; case 'image/png': $image = @imagecreatefrompng($source); break; case 'image/gif': $image = @imagecreatefromgif($source); break; default: return false; } if (!$image) { return false; } // Target file size in bytes $targetSize = $targetSizeKB * 1024; // Start with smaller dimensions for 10KB target $maxDimension = 800; if ($width > $maxDimension || $height > $maxDimension) { if ($width > $height) { $newWidth = $maxDimension; $newHeight = intval(($height / $width) * $maxDimension); } else { $newHeight = $maxDimension; $newWidth = intval(($width / $height) * $maxDimension); } } else { $newWidth = $width; $newHeight = $height; } $quality = 70; $attempts = 0; $maxAttempts = 15; do { // Create new image with current dimensions $newImage = imagecreatetruecolor($newWidth, $newHeight); // Preserve transparency for PNG and GIF if ($mime == 'image/png' || $mime == 'image/gif') { imagealphablending($newImage, false); imagesavealpha($newImage, true); $transparent = imagecolorallocatealpha($newImage, 255, 255, 255, 127); imagefilledrectangle($newImage, 0, 0, $newWidth, $newHeight, $transparent); } // Resize image imagecopyresampled($newImage, $image, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height); // Save to temporary file $tempFile = $destination . '.tmp'; switch ($mime) { case 'image/jpeg': case 'image/jpg': imagejpeg($newImage, $tempFile, $quality); break; case 'image/png': $pngQuality = intval((100 - $quality) / 11.11); imagepng($newImage, $tempFile, $pngQuality); break; case 'image/gif': imagegif($newImage, $tempFile); break; } imagedestroy($newImage); // Check file size $currentSize = filesize($tempFile); if ($currentSize <= $targetSize) { // Success! rename($tempFile, $destination); imagedestroy($image); return true; } // File still too large if ($quality > 35) { $quality -= 5; } else { $newWidth = intval($newWidth * 0.85); $newHeight = intval($newHeight * 0.85); $quality = 60; } if (file_exists($tempFile)) { unlink($tempFile); } $attempts++; } while ($attempts < $maxAttempts && $newWidth > 200 && $newHeight > 200); // Final attempt with very aggressive settings $newWidth = intval($newWidth * 0.7); $newHeight = intval($newHeight * 0.7); $newImage = imagecreatetruecolor($newWidth, $newHeight); if ($mime == 'image/png' || $mime == 'image/gif') { imagealphablending($newImage, false); imagesavealpha($newImage, true); $transparent = imagecolorallocatealpha($newImage, 255, 255, 255, 127); imagefilledrectangle($newImage, 0, 0, $newWidth, $newHeight, $transparent); } imagecopyresampled($newImage, $image, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height); switch ($mime) { case 'image/jpeg': case 'image/jpg': imagejpeg($newImage, $destination, 30); break; case 'image/png': imagepng($newImage, $destination, 8); break; case 'image/gif': imagegif($newImage, $destination); break; } imagedestroy($image); imagedestroy($newImage); return true; } // Referral: capture referrer user id from query to include in hidden field $referrerUserId = isset($_GET['ref']) ? trim($_GET['ref']) : ''; // Handle form submission if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['form_submitted'])) { // Process form data and save to database $success = processApplication($_POST); if ($success) { $_SESSION['success'] = "Application submitted successfully!"; header('Location: scholarshipapply?success=1'); exit(); } } function processApplication($data) { global $pdo; // Normalize aadhar number (remove spaces) $normalizedAadhar = isset($data['aadhar_number']) ? preg_replace('/\s+/', '', trim($data['aadhar_number'])) : ''; $data['aadhar_number'] = $normalizedAadhar; // Debug: Log the received data error_log('Received application data: ' . print_r($data, true)); try { $pdo->beginTransaction(); // Check for duplicate applications $duplicateCheck = $pdo->prepare(" SELECT applicant_id FROM applicants WHERE email = ? OR phone = ? OR aadhar_number = ? "); $duplicateCheck->execute([ $data['email'], $data['phone'], $data['aadhar_number'] ]); if ($duplicateCheck->rowCount() > 0) { $pdo->rollBack(); $_SESSION['error'] = "Application already exists. Please contact technical officer to renew or for other queries at 7772056856 (WhatsApp and call) !"; return false; } $normalizedAccountNumber = isset($data['account_number']) ? preg_replace('/\s+/', '', $data['account_number']) : ''; $normalizedIfscCode = isset($data['ifsc_code']) ? strtoupper(trim($data['ifsc_code'])) : ''; if (empty($normalizedAccountNumber)) { $pdo->rollBack(); $_SESSION['error'] = 'Bank account number is required.'; return false; } $accountCheck = $pdo->prepare("SELECT applicant_id, application_id FROM applicants WHERE account_number = ?"); $accountCheck->execute([$normalizedAccountNumber]); if ($accountCheck->rowCount() > 0) { $existingAccount = $accountCheck->fetch(PDO::FETCH_ASSOC); $existingApplicationId = $existingAccount['application_id'] ?? null; $pdo->rollBack(); $_SESSION['error'] = $existingApplicationId ? "This bank account is already linked with application ID {$existingApplicationId}. Please use a different bank account or contact support." : "This bank account has already been used in another application. Please use a different bank account or contact support."; return false; } // Create documents_upload directory if it doesn't exist $uploadDir = 'documents_upload/'; if (!file_exists($uploadDir)) { if (!mkdir($uploadDir, 0777, true)) { throw new Exception('Failed to create documents upload directory'); } } // Normalize empty strings to NULL for optional numeric fields $normalizeEmptyToNull = function($value) { return ($value === '' || $value === null) ? null : $value; }; // Normalize numeric fields - convert empty strings to NULL $annualSchoolFees = isset($data['annual_school_fees']) && $data['annual_school_fees'] !== '' ? (is_numeric($data['annual_school_fees']) ? $data['annual_school_fees'] : null) : null; $annualCollegeFees = isset($data['annual_college_fees']) && $data['annual_college_fees'] !== '' ? (is_numeric($data['annual_college_fees']) ? $data['annual_college_fees'] : null) : null; // Insert applicant data with improved error handling $stmt = $pdo->prepare(" INSERT INTO applicants (name, phone, whatsapp, email, dob, age, gender, education_level, category, marital_status, scheme_name, father_name, mother_name, aadhar_number, nationality, family_income, address, pincode, state, district, city, institution_type, institution_name, class, course, year, annual_school_fees, annual_college_fees, last_exam_percentage, existing_scholarship, bank_name, account_holder_name, account_number, ifsc_code, branch_name, referred_by_user_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) "); $result = $stmt->execute([ $data['name'], $data['phone'], $data['whatsapp'], $data['email'], $data['dob'], $data['age'], $data['gender'], $data['education_level'], $data['category'], $data['marital_status'], $data['scheme_name'], $data['father_name'], $data['mother_name'], $data['aadhar_number'], $data['nationality'], $data['family_income'], $data['address'], $data['pincode'], $data['state'], $data['district'], $data['city'], $data['institution_type'], $data['institution_name'], $normalizeEmptyToNull($data['class'] ?? null), $normalizeEmptyToNull($data['course'] ?? null), $data['year'], $annualSchoolFees, $annualCollegeFees, $data['last_exam_percentage'], $data['existing_scholarship'], $data['bank_name'], $data['account_holder_name'], $normalizedAccountNumber, $normalizedIfscCode, $data['branch_name'], $normalizeEmptyToNull($data['referred_by_user_id'] ?? null) ]); if (!$result) { throw new Exception('Failed to insert applicant data'); } // Debug: Log the data being inserted error_log('Inserting applicant data: institution_type=' . ($data['institution_type'] ?? 'NULL') . ', institution_name=' . ($data['institution_name'] ?? 'NULL') . ', year=' . ($data['year'] ?? 'NULL') . ', class=' . ($data['class'] ?? 'NULL') . ', course=' . ($data['course'] ?? 'NULL')); $applicantId = $pdo->lastInsertId(); if (!$applicantId) { throw new Exception('Failed to get applicant ID'); } // Generate APP2025 format application ID $appId = 'APP2025' . str_pad($applicantId, 6, '0', STR_PAD_LEFT); // Save application_id to database $updateStmt = $pdo->prepare("UPDATE applicants SET application_id = ? WHERE applicant_id = ?"); $updateResult = $updateStmt->execute([$appId, $applicantId]); if (!$updateResult) { throw new Exception('Failed to update application ID'); } // Store application ID in session for popup $_SESSION['new_application_id'] = $appId; // Create applicant-specific folder using APP2025 ID $applicantFolder = $uploadDir . $appId . '/'; if (!file_exists($applicantFolder)) { if (!mkdir($applicantFolder, 0777, true)) { throw new Exception('Failed to create applicant folder'); } } // Handle document uploads - SESSION-BASED APPROACH (files already uploaded via AJAX) $uploadErrors = []; if (isset($_SESSION['uploaded_documents']) && !empty($_SESSION['uploaded_documents'])) { foreach ($_SESSION['uploaded_documents'] as $field => $fileInfo) { $tempPath = $fileInfo['temp_path']; if (file_exists($tempPath)) { // Generate final filename $fileName = basename($tempPath); $finalPath = $applicantFolder . $fileName; // Move file from temp to final location if (rename($tempPath, $finalPath)) { // Insert document record $docStmt = $pdo->prepare(" INSERT INTO documents (applicant_id, document_type, document_name, document_path) VALUES (?, ?, ?, ?) "); $docResult = $docStmt->execute([ $applicantId, $field, $fileInfo['original_name'], $finalPath ]); if (!$docResult) { error_log("❌ Failed to insert document record for {$field}"); } else { error_log("✅ Moved {$field}: " . round($fileInfo['webp_size']/1024, 2) . "KB"); } } else { error_log("❌ Failed to move file for {$field}: {$tempPath} to {$finalPath}"); } } else { error_log("❌ Temp file not found for {$field}: {$tempPath}"); } } // Clean up temp folder if (isset($_SESSION['upload_session_id'])) { $userTempDir = 'documents_upload/temp_uploads/' . $_SESSION['upload_session_id'] . '/'; if (is_dir($userTempDir)) { // Remove temp directory $files = glob($userTempDir . '*'); if ($files) { foreach ($files as $file) { if (is_file($file)) { unlink($file); } } } rmdir($userTempDir); } } // Clear session data unset($_SESSION['uploaded_documents']); unset($_SESSION['upload_session_id']); } // If there were upload errors, rollback and show errors if (!empty($uploadErrors)) { $pdo->rollBack(); $_SESSION['error'] = implode("<br>", $uploadErrors); return false; } $pdo->commit(); return true; } catch(Exception $e) { if ($pdo->inTransaction()) { $pdo->rollBack(); } error_log("Application submission failed: " . $e->getMessage()); // Convert technical errors to user-friendly messages $errorMessage = $e->getMessage(); $userFriendlyMessage = convertToUserFriendlyError($errorMessage); $_SESSION['error'] = $userFriendlyMessage; return false; } catch(PDOException $e) { if ($pdo->inTransaction()) { $pdo->rollBack(); } error_log("Application submission failed: " . $e->getMessage()); // Convert database errors to user-friendly messages $errorMessage = $e->getMessage(); $userFriendlyMessage = convertToUserFriendlyError($errorMessage); $_SESSION['error'] = $userFriendlyMessage; return false; } } /** * Convert technical database errors to user-friendly messages */ function convertToUserFriendlyError($errorMessage) { // Common error patterns and their user-friendly messages $errorPatterns = [ // Empty field errors '/column `[^`]+`\.`([^`]+)` at row \d+/i' => 'कृपया सभी आवश्यक फ़ील्ड भरें।', '/Incorrect decimal value: \'\' for column `[^`]+`\.`([^`]+)`/i' => function($matches) { $fieldName = $matches[1] ?? 'field'; $fieldMap = [ 'annual_school_fees' => 'वार्षिक स्कूल शुल्क', 'annual_college_fees' => 'वार्षिक कॉलेज शुल्क' ]; $hindiName = $fieldMap[$fieldName] ?? $fieldName; return "कृपया {$hindiName} फ़ील्ड को सही तरीके से भरें। यह फ़ील्ड खाली नहीं हो सकती।"; }, // Duplicate entry errors '/Duplicate entry/i' => 'यह जानकारी पहले से मौजूद है। कृपया अलग जानकारी दर्ज करें।', // Foreign key errors '/Cannot add or update a child row/i' => 'कृपया सभी जानकारी सही तरीके से भरें।', // General SQL errors '/SQLSTATE\[.*\]/i' => 'कृपया सभी आवश्यक फ़ील्ड सही तरीके से भरें।', ]; // Try to match patterns foreach ($errorPatterns as $pattern => $replacement) { if (preg_match($pattern, $errorMessage, $matches)) { if (is_callable($replacement)) { return $replacement($matches); } return $replacement; } } // Default user-friendly message return "आवेदन जमा करने में समस्या आई। कृपया सभी फ़ील्ड सही तरीके से भरें और पुनः प्रयास करें। यदि समस्या बनी रहे, तो कृपया तकनीकी अधिकारी से संपर्क करें: 7772056856"; } ?> <!DOCTYPE html> <html lang="en"> <head> <!-- Google AdSense --> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6734060461800843" crossorigin="anonymous"></script> <!-- Google Tag Manager --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-KTVNKDJ6');</script> <!-- End Google Tag Manager --> <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-MQLM1LM5MZ"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-MQLM1LM5MZ'); </script> <!-- Google AdSense --> <script async custom-element="amp-ad" src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"></script> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Apply for Scholarship - Savitr Foundation Scholarship | Savitra Foundation Application</title> <!-- SEO Meta Tags --> <meta name="description" content="Apply for Savitr Foundation Scholarship. Online scholarship application form for students. Get financial support for your education through Savitra Foundation."> <meta name="keywords" content="Savitr Foundation apply, Savitra Foundation apply, scholarship application, apply for scholarship, Savitr scholarship application, Savitra scholarship application, online scholarship form"> <meta name="robots" content="index, follow"> <!-- Favicon (PNG) --> <link rel="icon" type="image/png" href="assets/savitrfoundation.png"> <link rel="shortcut icon" type="image/png" href="assets/savitrfoundation.png"> <link rel="stylesheet" href="css/styles.css"> <link rel="stylesheet" href="css/apply.css"> <link rel="stylesheet" href="assets/vendor/googlefonts/poppins.css"> <link rel="stylesheet" href="assets/vendor/fontawesome/css/all.min.css"> <style> /* College Autocomplete Styles */ .college-autocomplete-wrapper { position: relative; width: 100%; } .college-suggestions { position: absolute; top: 100%; left: 0; right: 0; background: white; border: 2px solid #13386c; border-top: none; border-radius: 0 0 8px 8px; max-height: 300px; overflow-y: auto; z-index: 1000; display: none; box-shadow: 0 4px 6px rgba(0,0,0,0.1); } .college-suggestions.show { display: block; } .college-suggestion-item { padding: 12px 15px; cursor: pointer; border-bottom: 1px solid #eee; transition: background 0.2s; } .college-suggestion-item:hover, .college-suggestion-item.highlighted { background: #f0f7ff; } .college-name { font-weight: 600; color: #13386c; margin-bottom: 4px; } .college-details { font-size: 12px; color: #666; } .college-district { color: #28a745; font-weight: 500; } .college-university { color: #999; font-style: italic; } .highlight-match { background: yellow; font-weight: bold; padding: 0 2px; } .no-colleges-found { padding: 15px; text-align: center; color: #999; } .college-count { padding: 8px 15px; background: #f8f9fa; border-bottom: 1px solid #dee2e6; font-size: 12px; color: #666; font-weight: 600; } input.has-suggestions { border-radius: 8px 8px 0 0; border-bottom-color: transparent; } .college-search-hint { color: #dc3545; font-size: 12px; margin-top: 5px; font-weight: 500; } .college-search-hint i { margin-right: 3px; } .terms-consent { margin-top: 20px; padding: 15px; background: #f4f9ff; border: 1px solid #cfe2ff; border-radius: 8px; text-align: left; } .terms-checkbox { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; color: #13386c; } .terms-checkbox input[type="checkbox"] { margin-top: 4px; transform: scale(1.1); } .terms-text span { margin-right: 4px; } .policy-link { text-decoration: underline; } .policy-modal .modal-content { width: 90%; max-width: 900px; max-height: 85vh; } .policy-modal .modal-body { padding: 0; height: calc(85vh - 70px); } .policy-modal iframe { width: 100%; height: 100%; border: none; } @media (max-width: 768px) { .terms-consent { padding: 12px; } .terms-checkbox { flex-direction: row; /* keep checkbox on the left */ align-items: flex-start; gap: 10px; } .terms-checkbox input[type="checkbox"] { margin-top: 4px; } .policy-modal .modal-content { max-width: 95vw; max-height: 80vh; } .policy-modal .modal-body { height: calc(80vh - 70px); } } </style> <style> /* Upload animations */ .upload-container { position: relative; display: inline-block; width: 100%; } .file-input-wrapper { position: relative; display: inline-block; width: 100%; } .file-input-wrapper input[type="file"] { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; } .file-input-display { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border: 2px dashed #ddd; border-radius: 8px; background: #f9f9f9; transition: all 0.3s ease; cursor: pointer; } .file-input-display:hover { border-color: #13386c; background: #f0f7ff; } .file-input-display.has-file { border-color: #28a745; background: #e8f5e8; } .file-input-text { color: #666; font-size: 14px; } .file-input-icon { color: #13386c; font-size: 18px; } .file-name { color: #28a745; font-weight: 600; font-size: 14px; } .upload-progress { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255, 255, 255, 0.95); z-index: 9999; align-items: center; justify-content: center; flex-direction: column; } .upload-progress.show { display: flex; } .loader { width: 180px; height: 180px; perspective: 1000px; display: flex; align-items: center; justify-content: center; } .logo { width:100%;height:100%; background:url('https://savitrfoundation.com/assets/savitrfoundation.png') center/contain no-repeat; animation:flip 2.8s ease-in-out infinite; transform-origin:center; filter:drop-shadow(0 6px 15px rgba(0,0,0,0.25)); } @keyframes flip { 0% {transform:rotateY(0deg);} 50% {transform:rotateY(180deg);} 100% {transform:rotateY(360deg);} } .shadow { position: absolute; bottom: 40px; width: 120px; height: 18px; background: radial-gradient(ellipse at center, rgba(0,0,0,0.25), transparent 70%); border-radius: 50%; filter: blur(4px); opacity: 0.5; } /* Upload Progress Bar */ .upload-progress-container { margin-top: 20px; width: 300px; } .upload-progress-text { color: #13386c; font-weight: 600; font-size: 14px; margin-bottom: 10px; text-align: center; } .upload-progress-bar-container { width: 100%; height: 6px; background: #e0e0e0; border-radius: 3px; overflow: hidden; position: relative; } .upload-progress-bar { height: 100%; background: linear-gradient(90deg, #13386c, #2563eb); border-radius: 3px; transition: width 0.3s ease; width: 0%; } .upload-progress-bar.animated { animation: progressPulse 1.5s ease-in-out infinite; } @keyframes progressPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } } .upload-percentage { color: #13386c; font-weight: 700; font-size: 16px; margin-top: 8px; text-align: center; } /* Receipt Popup Styles */ .receipt-popup { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); z-index: 9999; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; } .receipt-popup.show { display: flex; } .receipt-content { background: white; border-radius: 12px; padding: 20px; max-width: 500px; width: 100%; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); text-align: center; position: relative; margin: 0; } @media (max-width: 480px) { .receipt-popup { padding: 8px; } .receipt-content { padding: 12px; } .receipt-title { font-size: 17px; margin-bottom: 6px; } .receipt-subtitle { font-size: 11px; } .receipt-header { padding-bottom: 12px; margin-bottom: 12px; } .receipt-details { margin: 12px 0; } .receipt-row { padding: 5px 0; font-size: 13px; } .receipt-id { padding: 10px; margin: 12px 0; } .receipt-id-label { font-size: 11px; } .receipt-id-value { font-size: 15px; } .receipt-actions { margin-top: 12px; } .btn-close { padding: 10px 22px; font-size: 13px; } .success-icon { font-size: 36px; margin-bottom: 8px; } } /* Height-based tweaks to prevent top/bottom clipping on small screens */ @media (max-height: 700px) { .receipt-content { transform: scale(0.95); transform-origin: center center; } } @media (max-height: 620px) { .receipt-content { transform: scale(0.9); } .receipt-title { font-size: 16px; } .receipt-row { font-size: 12px; } .btn-close { font-size: 12px; padding: 8px 18px; } } .receipt-header { border-bottom: 2px solid #13386c; padding-bottom: 20px; margin-bottom: 20px; } .receipt-title { font-size: 24px; font-weight: bold; color: #13386c; margin-bottom: 10px; line-height: 1.25; } .receipt-subtitle { color: #666; font-size: 14px; } .receipt-details { margin: 16px 0; } .receipt-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #eee; gap: 10px; } .receipt-label { font-weight: 600; color: #333; } .receipt-value { color: #13386c; font-weight: bold; } .receipt-id { background: #f0f7ff; padding: 12px; border-radius: 8px; margin: 16px 0; border: 2px solid #13386c; } .receipt-id-label { font-size: 14px; color: #666; margin-bottom: 5px; } .receipt-id-value { font-size: 20px; font-weight: bold; color: #13386c; letter-spacing: 1px; } .receipt-actions { margin-top: 20px; } .btn-close { background: #13386c; color: white; border: none; padding: 12px 30px; border-radius: 6px; cursor: pointer; font-size: 16px; font-weight: 600; } .btn-close:hover { background: #1e4a7a; } .success-icon { font-size: 48px; color: #28a745; margin-bottom: 15px; } .loader-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.8); z-index: 9999; display: none; align-items: center; justify-content: center; } /* Custom Alert Modal Styles */ .custom-alert-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); z-index: 10000; align-items: center; justify-content: center; animation: fadeIn 0.3s ease; } .custom-alert-overlay.show { display: flex; } @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } @keyframes slideUp { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } } .custom-alert-modal { background: white; border-radius: 12px; padding: 0; max-width: 450px; width: 90%; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3); animation: slideUp 0.3s ease; overflow: hidden; } .custom-alert-header { background: linear-gradient(135deg, #13386c 0%, #1e4a7a 100%); color: white; padding: 20px 25px; display: flex; align-items: center; gap: 12px; } .custom-alert-header i { font-size: 24px; } .custom-alert-header h3 { margin: 0; font-size: 20px; font-weight: 600; } .custom-alert-body { padding: 25px; color: #333; font-size: 16px; line-height: 1.6; text-align: center; } .custom-alert-footer { padding: 15px 25px 25px; display: flex; justify-content: center; gap: 10px; } .custom-alert-btn { background: #13386c; color: white; border: none; padding: 12px 30px; border-radius: 6px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; min-width: 100px; } .custom-alert-btn:hover { background: #1e4a7a; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(19, 56, 108, 0.3); } .custom-alert-btn:active { transform: translateY(0); } .custom-alert-icon { font-size: 48px; margin-bottom: 15px; } .custom-alert-icon.error { color: #dc3545; } .custom-alert-icon.warning { color: #ffc107; } .custom-alert-icon.info { color: #17a2b8; } .custom-alert-icon.success { color: #28a745; } @media (max-width: 480px) { .custom-alert-modal { width: 95%; max-width: none; } .custom-alert-header { padding: 15px 20px; } .custom-alert-header h3 { font-size: 18px; } .custom-alert-body { padding: 20px; font-size: 15px; } .custom-alert-footer { padding: 15px 20px 20px; } .custom-alert-btn { padding: 10px 25px; font-size: 15px; } } </style> </head> <body> <!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KTVNKDJ6" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager (noscript) --> <div id="page-loader" class="loader-container"> <div class="loader"> <div class="logo"></div> <div class="shadow"></div> </div> </div> <div class="top-bar"> <div class="container"> <div class="top-links"> <a href="#" id="hindiBtn">हिंदी</a> | <a href="#" id="englishBtn" class="active">English</a> | <a href="#" id="fontSmall">A-</a> | <a href="#" id="fontNormal" class="active">A</a> | <a href="#" id="fontLarge">A+</a> | <a href="#" id="helpBtn">Help</a> </div> </div> </div> <!-- Support Line --> <div class="support-line"> <span data-hindi="आवेदन फॉर्म जमा करने में कोई परेशानी या दिक्कत आए तो हमारे तकनीकी अधिकारी से निःशुल्क संपर्क कर सकते हैं। किसी भी तरह के सुझाव व जानकारी के लिए 7772056856 पर कॉल या व्हाट्सऐप करके अपनी क्वेरी बताएं" data-english="If you face any difficulty or problem while submitting the application form, you can contact our technical officer for free. For any kind of suggestion or information, call or WhatsApp on 7772056856 and share your query">If you face any difficulty or problem while submitting the application form, you can contact our technical officer for free. For any kind of suggestion or information, call or WhatsApp on <a href="tel:7772056856">7772056856</a> and share your query</span> </div> <div class="container"> <div class="application-form"> <div class="header-container"> <img src="assets/logo.png" alt="Savitr Foundation Logo"> <h1> <i class="fas fa-graduation-cap"></i> <span data-hindi="छात्रवृत्ति आवेदन फॉर्म" data-english="Program has been placed on hold until 31 March 2026">Program has been placed on hold until 31 March 2026<span> </h1> <section class="mandatory-step"> <div class="mandatory-buttons"> </div> <p class="mandatory-note" data-hindi="नोट:All students are hereby informed that the ongoing Scholarship Program has been placed on hold until 31 March 2026. Additionally, new registrations will remain closed during this period. After 31 March 2026, an official announcement will be released regarding whether the program will continue or be discontinued. Please wait for further updates. Thank you " data-english="All students are hereby informed that the ongoing Scholarship Program has been placed on hold until 31 March 2026. Additionally, new registrations will remain closed during this period. After 31 March 2026, an official announcement will be released regarding whether the program will continue or be discontinued. Please wait for further updates. Thank you.">Note: All students are hereby informed that the ongoing Scholarship Program has been placed on hold until 31 March 2026. Additionally, new registrations will remain closed during this period. After 31 March 2026, an official announcement will be released regarding whether the program will continue or be discontinued. Please wait for further updates. Thank you.</p> </div> </section> </div> <?php if (isset($_GET['success'])): ?> <div style="background: #d4edda; color: #155724; padding: 15px; border-radius: 8px; margin-bottom: 20px;"> <i class="fas fa-check-circle"></i> Application submitted successfully! Please check the receipt popup for your Application ID. </div> <script> // Clear form data on successful submission if (typeof clearFormData === 'function') { clearFormData(); } </script> <?php endif; ?> <?php if (isset($_SESSION['error'])): ?> <div style="background: #f8d7da; color: #721c24; padding: 15px; border-radius: 8px; margin-bottom: 20px;"> <i class="fas fa-exclamation-triangle"></i> <?php echo $_SESSION['error']; unset($_SESSION['error']); ?> </div> <?php endif; ?> <div class="step-indicator"> <div class="step active" data-step="1">1</div> <div class="step" data-step="2">2</div> <div class="step" data-step="3">3</div> <div class="step" data-step="4">4</div> <div class="step" data-step="5">5</div> </div> <div class="step-labels"> <div class="step-label active" data-step="1" data-hindi="व्यक्तिगत विवरण" data-english="Personal Details">Personal Details</div> <div class="step-label" data-step="2" data-hindi="पता विवरण" data-english="Address Details">Address Details</div> <div class="step-label" data-step="3" data-hindi="संस्थान विवरण" data-english="Institute Details">Institute Details</div> <div class="step-label" data-step="4" data-hindi="दस्तावेज़ सत्यापन" data-english="Document Verification">Document Verification</div> <div class="step-label" data-step="5" data-hindi="बैंक सत्यापन" data-english="Bank Verification">Bank Verification</div> </div> <form id="applicationForm" method="POST" action="scholarshipapply" enctype="multipart/form-data" novalidate> <input type="hidden" name="form_submitted" value="1"> <!-- Step 1: Personal Details --> <div class="form-step active" id="step1"> <h2><i class="fas fa-user"></i> <span data-hindi="व्यक्तिगत विवरण" data-english="Personal Details">Personal Details</span></h2> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-6734060461800843" data-ad-slot="5947555118" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> <!-- Referred By User ID Field (Added at the beginning) --> <div class="form-group"> <label for="referred_by_user_id" data-hindi="उपयोगकर्ता आईडी द्वारा संदर्भित" data-english="Referred By Scholar ID">Referred By Scholar ID <span class="required">*</span></label> <input type="text" id="referred_by_user_id" name="referred_by_user_id" value="<?php echo htmlspecialchars($referrerUserId); ?>" required> <small class="help-text" data-hindi="जो उपयोगकर्ता आपको इस आवेदन के लिए संदर्भित किया है, उसकी उपयोगकर्ता आईडी दर्ज करें" data-english="Enter the Scholar ID of the person who referred you for this application">Enter the user ID of the person who referred you for this application</small> </div> <div class="note" style="margin-top: 8px; padding: 10px; background-color: #fff3cd; border: 1px solid #ffeaa7; border-radius: 4px; color: #856404;"> <strong data-hindi="नोट:" data-english="Note:">Note:</strong> <span data-hindi="यदि आपको पता नहीं है कि आपको किसी ने संदर्भित किया है, तो कृपया 7772056856 पर तकनीकी अधिकारी से संपर्क करें" data-english="If you don't know if you were referred by anyone, please contact the technical officer at 7772056856">If you don't know if you were referred by anyone, please contact the technical officer at <a href="tel:7772056856">7772056856</a></span> </div> <div class="form-row"> <div class="form-group"> <label for="name" data-hindi="पूरा नाम" data-english="Full Name">Full Name <span class="required">*</span></label> <input type="text" id="name" name="name" required> </div> <div class="form-group"> <label for="phone" data-hindi="संपर्क नंबर" data-english="Contact Number">Contact Number <span class="required">*</span></label> <input type="tel" id="phone" name="phone" pattern="[0-9]{10}" placeholder="10-digit mobile number" required> <small class="help-text" data-hindi="10 अंकों का मोबाइल नंबर दर्ज करें (जैसे: 9876543210)" data-english="Enter 10-digit mobile number (e.g: 9876543210)">Enter 10-digit mobile number (e.g: 9876543210)</small> </div> </div> <div class="form-row"> <div class="form-group"> <label for="whatsapp" data-hindi="व्हाट्सऐप नंबर" data-english="WhatsApp Number">WhatsApp Number <span class="required">*</span></label> <input type="tel" id="whatsapp" name="whatsapp" pattern="[0-9]{10}" placeholder="10-digit WhatsApp number" required> <small class="help-text" data-hindi="10 अंकों का व्हाट्सऐप नंबर दर्ज करें (जैसे: 9876543210)" data-english="Enter 10-digit WhatsApp number (e.g: 9876543210)">Enter 10-digit WhatsApp number (e.g: 9876543210)</small> </div> <div class="form-group"> <label for="email" data-hindi="ईमेल पता" data-english="Email Address">Email Address <span class="required">*</span></label> <input type="email" id="email" name="email" required> </div> </div> <div class="form-row"> <div class="form-group"> <label for="dob" data-hindi="जन्म तिथि" data-english="Date of Birth">Date of Birth <span class="required">*</span></label> <input type="date" id="dob" name="dob" required> </div> <div class="form-group"> <label for="age" data-hindi="आयु" data-english="Age">Age <span class="required">*</span></label> <input type="number" id="age" name="age" readonly required> </div> </div> <div class="form-row"> <div class="form-group"> <label for="gender" data-hindi="लिंग" data-english="Gender">Gender <span class="required">*</span></label> <select id="gender" name="gender" required> <option value="" data-hindi="लिंग चुनें" data-english="Select Gender">Select Gender</option> <option value="Male" data-hindi="पुरुष" data-english="Male">Male</option> <option value="Female" data-hindi="महिला" data-english="Female">Female</option> </select> </div> <div class="form-group"> <label for="education_level" data-hindi="शैक्षिक स्तर" data-english="Education Level">Education Level <span class="required">*</span></label> <select id="education_level" name="education_level" required> <option value="" data-hindi="शैक्षिक स्तर चुनें" data-english="Select Education Level">Select Education Level</option> <option value="10th" data-hindi="10वीं" data-english="10th">10th</option> <option value="12th" data-hindi="12वीं" data-english="12th">12th</option> <option value="Graduate" data-hindi="स्नातक" data-english="Graduate">Graduate</option> <option value="Post Graduate" data-hindi="स्नातकोत्तर" data-english="Post Graduate">Post Graduate</option> </select> <small class="help-text" data-hindi="अपना सबसे उच्च शैक्षिक स्तर चुनें" data-english="Select your highest education level">Select your highest education level</small> </div> </div> <div class="form-row"> <div class="form-group"> <label for="category" data-hindi="श्रेणी" data-english="Category">Category <span class="required">*</span></label> <select id="category" name="category" required> <option value="" data-hindi="श्रेणी चुनें" data-english="Select Category">Select Category</option> <option value="GEN" data-hindi="सामान्य (GEN)" data-english="General (GEN)">General (GEN)</option> <option value="OBC" data-hindi="अन्य पिछड़ा वर्ग (OBC)" data-english="Other Backward Class (OBC)">Other Backward Class (OBC)</option> <option value="ST" data-hindi="अनुसूचित जनजाति (ST)" data-english="Scheduled Tribe (ST)">Scheduled Tribe (ST)</option> <option value="SC" data-hindi="अनुसूचित जाति (SC)" data-english="Scheduled Caste (SC)">Scheduled Caste (SC)</option> </select> </div> <div class="form-group"> <label for="marital_status" data-hindi="वैवाहिक स्थिति" data-english="Marital Status">Marital Status <span class="required">*</span></label> <select id="marital_status" name="marital_status" required> <option value="" data-hindi="स्थिति चुनें" data-english="Select Status">Select Status</option> <option value="Single" data-hindi="अविवाहित" data-english="Single">Single</option> <option value="Married" data-hindi="विवाहित" data-english="Married">Married</option> <option value="Divorced" data-hindi="तलाकशुदा" data-english="Divorced">Divorced</option> <option value="Widowed" data-hindi="विधवा/विधुर" data-english="Widowed">Widowed</option> </select> </div> </div> <div class="form-group"> <label for="scheme_name" data-hindi="छात्रवृत्ति प्रकार" data-english="Scholarship Type">Scholarship Type <span class="required">*</span></label> <select id="scheme_name" name="scheme_name" required> <option value="" data-hindi="छात्रवृत्ति प्रकार चुनें" data-english="Select Scholarship Type">Select Scholarship Type</option> <option value="Udaan Scholarship" data-hindi="उड़ान छात्रवृत्ति" data-english="Udaan Scholarship">Udaan Scholarship</option> <option value="Shiksha Sahara" data-hindi="शिक्षा सहारा" data-english="Shiksha Sahara">Shiksha Sahara</option> <option value="Samaan Shiksha" data-hindi="समान शिक्षा" data-english="Samaan Shiksha">Samaan Shiksha</option> <option value="Book Allowance" data-hindi="बुक अलाउंस" data-english="Book Allowance">Book Allowance</option> </select> <small class="help-text" id="scholarship-help" data-hindi="आपकी आयु, लिंग और श्रेणी के आधार पर छात्रवृत्ति प्रकार स्वचालित रूप से चुना जाएगा" data-english="Scholarship type will be auto-selected based on your age, gender, and category">Scholarship type will be auto-selected based on your age, gender, and category</small> <div id="auto-selection-status" style="margin-top: 5px; padding: 8px; background: #e8f5e8; border: 1px solid #28a745; border-radius: 4px; display: none;"> <i class="fas fa-check-circle" style="color: #28a745;"></i> <span style="margin-left: 5px; color: #28a745; font-weight: bold;" data-hindi="छात्रवृत्ति स्वचालित रूप से चुनी गई!" data-english="Scholarship Auto-Selected!">Scholarship Auto-Selected!</span> </div> </div> <div class="form-row"> <div class="form-group"> <label for="father_name" data-hindi="पिता का नाम" data-english="Father's Name">Father's Name <span class="required">*</span></label> <input type="text" id="father_name" name="father_name" required> </div> <div class="form-group"> <label for="mother_name" data-hindi="माता का नाम" data-english="Mother's Name">Mother's Name <span class="required">*</span></label> <input type="text" id="mother_name" name="mother_name" required> </div> </div> <div class="form-row"> <div class="form-group"> <label for="aadhar_number" data-hindi="आधार नंबर" data-english="Aadhar Number">Aadhar Number <span class="required">*</span></label> <input type="text" id="aadhar_number" name="aadhar_number" pattern="[0-9\s]{14}" placeholder="XXXX XXXX XXXX" maxlength="14" required> </div> <div class="form-group"> <label for="family_income" data-hindi="पारिवारिक आय" data-english="Family Income">Family Income <span class="required">*</span></label> <select id="family_income" name="family_income" required> <option value="" data-hindi="आय सीमा चुनें" data-english="Select Income Range">Select Income Range</option> <option value="0-50000" data-hindi="₹0 - ₹50,000" data-english="₹0 - ₹50,000">₹0 - ₹50,000</option> <option value="50000-100000" data-hindi="₹50,000 - ₹1,00,000" data-english="₹50,000 - ₹1,00,000">₹50,000 - ₹1,00,000</option> <option value="100000-200000" data-hindi="₹1,00,000 - ₹2,00,000" data-english="₹1,00,000 - ₹2,00,000">₹1,00,000 - ₹2,00,000</option> <option value="200000-500000" data-hindi="₹2,00,000 - ₹5,00,000" data-english="₹2,00,000 - ₹5,00,000">₹2,00,000 - ₹5,00,000</option> <option value="500000-800000" data-hindi="₹5,00,000 - ₹8,00,000" data-english="₹5,00,000 - ₹8,00,000">₹5,00,000 - ₹8,00,000</option> </select> </div> </div> <div class="form-group"> <label for="nationality" data-hindi="राष्ट्रीयता" data-english="Nationality">Nationality <span class="required">*</span></label> <input type="text" id="nationality" name="nationality" value="Indian" readonly> </div> <div class="form-group terms-consent"> <label class="terms-checkbox"> <input type="checkbox" id="terms_accept" name="terms_accept" required style="width:18px;height:18px;padding:0;margin:0 8px 0 0;display:inline-block;appearance:checkbox;-webkit-appearance:checkbox;"> <span class="terms-text"> <span data-hindi="मैं पुष्टि करता/करती हूं कि मैंने" data-english="I confirm that I have read and agree to the">I confirm that I have read and agree to the</span> <a href="#" class="policy-link" data-modal-target="termsModal" style="color: #0d6efd; font-weight: 600;"> <span data-hindi="नियम एवं शर्तें" data-english="Terms & Conditions">Terms & Conditions</span> </a> <span data-hindi="और" data-english="and">and</span> <a href="#" class="policy-link" data-modal-target="privacyModal" style="color: #0d6efd; font-weight: 600;"> <span data-hindi="गोपनीयता नीति" data-english="Privacy Policy">Privacy Policy</span> </a> <span data-hindi="को पढ़ लिया है।" data-english="before continuing.">before continuing.</span> </span> </label> <small class="help-text" data-hindi="कृपया आगे बढ़ने से पहले नियम एवं शर्तों और गोपनीयता नीति से सहमति दें।" data-english="Please agree to the Terms & Conditions and Privacy Policy before continuing.">Please agree to the Terms & Conditions and Privacy Policy before continuing.</small> </div> </div> <!-- Step 2: Address Details --> <div class="form-step" id="step2"> <h2><i class="fas fa-map-marker-alt"></i> <span data-hindi="पता विवरण" data-english="Address Details">Address Details</span></h2> <div class="form-group"> <label for="address" data-hindi="पूरा पता" data-english="Complete Address">Complete Address <span class="required">*</span></label> <textarea id="address" name="address" rows="3" required></textarea> </div> <div class="form-row"> <div class="form-group"> <label for="pincode" data-hindi="पिनकोड" data-english="Pincode">Pincode <span class="required">*</span></label> <input type="text" id="pincode" name="pincode" pattern="[0-9]{6}" placeholder="6-अंकीय पिनकोड दर्ज करें" required onblur="fillLocationFromPincode()"> <small class="help-text" data-hindi="स्थान विवरण स्वचालित रूप से भरने के लिए अपना 6-अंकीय पिनकोड दर्ज करें" data-english="Enter your 6-digit pincode to auto-fill location details">Enter your 6-digit pincode to auto-fill location details</small> </div> <div class="form-group"> <label for="state" data-hindi="राज्य" data-english="State">State <span class="required">*</span></label> <input type="text" id="state" name="state" readonly required> </div> </div> <div class="form-row"> <div class="form-group"> <label for="district" data-hindi="जिला" data-english="District">District <span class="required">*</span></label> <input type="text" id="district" name="district" readonly required> </div> <div class="form-group"> <label for="city" data-hindi="शहर" data-english="City">City <span class="required">*</span></label> <input type="text" id="city" name="city" required> <small class="help-text" data-hindi="आवश्यकता होने पर आप इसे संपादित कर सकते हैं" data-english="You can edit this if needed">You can edit this if needed</small> </div> </div> </div> <!-- Step 3: Institute Details --> <div class="form-step" id="step3"> <h2><i class="fas fa-graduation-cap"></i> <span data-hindi="संस्थान विवरण" data-english="Institute Details">Institute Details</span></h2> <div class="form-group"> <label for="institution_type" data-hindi="संस्थान प्रकार" data-english="Institution Type">Institution Type <span class="required">*</span></label> <select id="institution_type" name="institution_type" required> <option value="" data-hindi="प्रकार चुनें" data-english="Select Type">Select Type</option> <option value="School" data-hindi="स्कूल" data-english="School">School</option> <option value="College" data-hindi="कॉलेज" data-english="College">College</option> </select> </div> <div class="form-group" id="institution_name_field" style="display: none;"> <label for="institution_name" id="institution_name_label" data-hindi="कॉलेज/स्कूल का नाम" data-english="College/School Name">College/School Name <span class="required">*</span></label> <div class="college-autocomplete-wrapper" id="college_autocomplete_wrapper"> <input type="text" id="institution_name" name="institution_name" placeholder="Type college name or city..." autocomplete="off"> <div id="collegeSuggestions" class="college-suggestions"></div> </div> <small class="college-search-hint" id="college_search_hint" style="display: none;" data-hindi="💡 अगर आपको अपने कॉलेज का नाम नहीं मिल रहा है, तो अपने शहर का नाम टाइप करके खोजें" data-english="💡 If you can't find your college name, search by type your city name"> <i class="fas fa-lightbulb"></i> If you can't find your college name, search by typing your city name </small> </div> <div class="form-row"> <div class="form-group" id="class_field" style="display: none;"> <label for="class" id="class_label" data-hindi="कक्षा" data-english="Class">Class <span class="required">*</span></label> <select id="class" name="class"> <option value="" data-hindi="कक्षा/वर्ष चुनें" data-english="Select Class/Year">Select Class/Year</option> <option value="11th" data-hindi="11वीं" data-english="11th">11th</option> <option value="12th" data-hindi="12वीं" data-english="12th">12th</option> </select> </div> <div class="form-group" id="course_field" style="display: none;"> <label for="course" data-hindi="कोर्स" data-english="Course">Course <span class="required">*</span></label> <input type="text" id="course" name="course" placeholder="जैसे, B.Tech, B.A, B.Sc"> </div> </div> <div class="form-group"> <label for="year" data-hindi="शैक्षणिक वर्ष" data-english="Academic Year">Academic Year <span class="required">*</span></label> <select id="year" name="year" required> <option value="" data-hindi="वर्ष चुनें" data-english="Select Year">Select Year</option> <option value="2025-26">2025-26</option> </select> </div> <div class="form-row"> <div class="form-group" id="school_fees_field" style="display: none;"> <label for="annual_school_fees" data-hindi="वार्षिक स्कूल शुल्क" data-english="Annual School Fees">Annual School Fees <span class="required">*</span></label> <input type="number" id="annual_school_fees" name="annual_school_fees" placeholder="वार्षिक शुल्क दर्ज करें"> </div> <div class="form-group" id="college_fees_field" style="display: none;"> <label for="annual_college_fees" data-hindi="वार्षिक कॉलेज शुल्क" data-english="Annual College Fees">Annual College Fees <span class="required">*</span></label> <input type="number" id="annual_college_fees" name="annual_college_fees" placeholder="वार्षिक शुल्क दर्ज करें"> </div> </div> <div class="form-group" id="last_exam_percentage_field"> <label for="last_exam_percentage" id="last_exam_percentage_label" data-hindi="पिछली परीक्षा का प्रतिशत" data-english="Last Exam Percentage">Last Exam Percentage <span class="required">*</span></label> <input type="text" id="last_exam_percentage" name="last_exam_percentage" placeholder="प्रतिशत दर्ज करें (जैसे, 85%)"> <small class="help-text" id="last_exam_percentage_help" data-hindi="अपना पिछली परीक्षा का प्रतिशत दर्ज करें" data-english="Enter your last exam percentage">Enter your last exam percentage</small> </div> <div class="form-group"> <label for="existing_scholarship" data-hindi="क्या आपको वर्तमान में कोई छात्रवृत्ति मिल रही है?" data-english="Do you currently receive any scholarship?">Do you currently receive any scholarship? <span class="required">*</span></label> <select id="existing_scholarship" name="existing_scholarship" required> <option value="" data-hindi="विकल्प चुनें" data-english="Select Option">Select Option</option> <option value="Yes" data-hindi="हाँ" data-english="Yes">Yes</option> <option value="No" data-hindi="नहीं" data-english="No">No</option> </select> </div> </div> <!-- Step 4: Document Verification --> <div class="form-step" id="step4"> <h2><i class="fas fa-file-upload"></i> <span data-hindi="दस्तावेज़ सत्यापन" data-english="Document Verification">Document Verification</span></h2> <div class="document-upload-section"> <p class="upload-instructions" data-hindi="कृपया निम्नलिखित दस्तावेज़ अपलोड करें। सभी दस्तावेज़ स्पष्ट और पढ़ने योग्य होने चाहिए।" data-english="Please upload the following documents. All documents should be clear and readable.">Please upload the following documents. All documents should be clear and readable.</p> <div class="form-group"> <label for="aadhar_front" data-hindi="आधार कार्ड (फ्रंट साइड)" data-english="Aadhar Card (Front Side)">Aadhar Card (Front Side) <span class="required">*</span></label> <div class="upload-container"> <div class="file-input-wrapper"> <input type="file" id="aadhar_front" name="aadhar_front" accept=".jpg,.jpeg,.png,.gif,image/jpeg,image/png,image/gif" required> <div class="file-input-display" onclick="document.getElementById('aadhar_front').click()"> <span class="file-input-text" id="aadhar_front_text">Click to select file</span> <i class="fas fa-upload file-input-icon"></i> </div> </div> <div class="upload-progress" id="aadhar_front_progress"> <div class="loader"> <div class="logo"></div> <div class="shadow"></div> </div> <div class="upload-progress-container"> <div class="upload-progress-text" id="aadhar_front_status">Uploading...</div> <div class="upload-progress-bar-container"> <div class="upload-progress-bar" id="aadhar_front_bar"></div> </div> <div class="upload-percentage" id="aadhar_front_percent">0%</div> </div> </div> </div> <small class="help-text" data-hindi="आधार कार्ड के फ्रंट साइड की स्पष्ट फोटो या स्कैन कॉपी अपलोड करें" data-english="Upload clear photo or scanned copy of Aadhar Card Front Side">Upload clear photo or scanned copy of Aadhar Card Front Side</small> </div> <div class="form-group"> <label for="aadhar_back" data-hindi="आधार कार्ड (बैक साइड)" data-english="Aadhar Card (Back Side)">Aadhar Card (Back Side) <span class="required">*</span></label> <div class="upload-container"> <div class="file-input-wrapper"> <input type="file" id="aadhar_back" name="aadhar_back" accept=".jpg,.jpeg,.png,.gif,image/jpeg,image/png,image/gif" required> <div class="file-input-display" onclick="document.getElementById('aadhar_back').click()"> <span class="file-input-text" id="aadhar_back_text">Click to select file</span> <i class="fas fa-upload file-input-icon"></i> </div> </div> <div class="upload-progress" id="aadhar_back_progress"> <div class="loader"> <div class="logo"></div> <div class="shadow"></div> </div> <div class="upload-progress-container"> <div class="upload-progress-text" id="aadhar_back_status">Uploading...</div> <div class="upload-progress-bar-container"> <div class="upload-progress-bar" id="aadhar_back_bar"></div> </div> <div class="upload-percentage" id="aadhar_back_percent">0%</div> </div> </div> </div> <small class="help-text" data-hindi="आधार कार्ड के बैक साइड की स्पष्ट फोटो या स्कैन कॉपी अपलोड करें" data-english="Upload clear photo or scanned copy of Aadhar Card Back Side">Upload clear photo or scanned copy of Aadhar Card Back Side</small> </div> <div class="form-group"> <label for="caste_certificate" data-hindi="जाति प्रमाण पत्र (यदि उपलब्ध)" data-english="Caste Certificate (if available)">Caste Certificate (if available)</label> <div class="upload-container"> <div class="file-input-wrapper"> <input type="file" id="caste_certificate" name="caste_certificate" accept=".jpg,.jpeg,.png,.gif,image/jpeg,image/png,image/gif"> <div class="file-input-display" onclick="document.getElementById('caste_certificate').click()"> <span class="file-input-text" id="caste_certificate_text">Click to select file</span> <i class="fas fa-upload file-input-icon"></i> </div> </div> <div class="upload-progress" id="caste_certificate_progress"> <div class="loader"> <div class="logo"></div> <div class="shadow"></div> </div> <div class="upload-progress-container"> <div class="upload-progress-text" id="caste_certificate_status">Uploading...</div> <div class="upload-progress-bar-container"> <div class="upload-progress-bar" id="caste_certificate_bar"></div> </div> <div class="upload-percentage" id="caste_certificate_percent">0%</div> </div> </div> </div> <small class="help-text" data-hindi="जाति प्रमाण पत्र अपलोड करें <span style='color: red;'>(यदि उपलब्ध नहीं है तो महत्वपूर्ण नहीं)</span>" data-english="Upload caste certificate <span style='color: red;'>(not important if not available)</span>">Upload caste certificate <span style='color: red;'>(not important if not available)</span></small> </div> <div class="form-group"> <label for="income_proof" data-hindi="आय प्रमाण" data-english="Income Proof">Income Proof <span class="required">*</span></label> <div class="upload-container"> <div class="file-input-wrapper"> <input type="file" id="income_proof" name="income_proof" accept=".jpg,.jpeg,.png,.gif,image/jpeg,image/png,image/gif" required> <div class="file-input-display" onclick="document.getElementById('income_proof').click()"> <span class="file-input-text" id="income_proof_text">Click to select file</span> <i class="fas fa-upload file-input-icon"></i> </div> </div> <div class="upload-progress" id="income_proof_progress"> <div class="loader"> <div class="logo"></div> <div class="shadow"></div> </div> <div class="upload-progress-container"> <div class="upload-progress-text" id="income_proof_status">Uploading...</div> <div class="upload-progress-bar-container"> <div class="upload-progress-bar" id="income_proof_bar"></div> </div> <div class="upload-percentage" id="income_proof_percent">0%</div> </div> </div> </div> <small class="help-text" data-hindi="आय प्रमाण पत्र या वेतन पर्ची अपलोड करें" data-english="Upload income certificate or salary slip">Upload income certificate or salary slip</small> </div> <div class="form-group"> <label for="domicile_certificate" data-hindi="मूलनिवासी प्रमाण पत्र" data-english="Domicile Certificate">Domicile Certificate <span class="required">*</span></label> <div class="upload-container"> <div class="file-input-wrapper"> <input type="file" id="domicile_certificate" name="domicile_certificate" accept=".jpg,.jpeg,.png,.gif,image/jpeg,image/png,image/gif" required> <div class="file-input-display" onclick="document.getElementById('domicile_certificate').click()"> <span class="file-input-text" id="domicile_certificate_text">Click to select file</span> <i class="fas fa-upload file-input-icon"></i> </div> </div> <div class="upload-progress" id="domicile_certificate_progress"> <div class="loader"> <div class="logo"></div> <div class="shadow"></div> </div> <div class="upload-progress-container"> <div class="upload-progress-text" id="domicile_certificate_status">Uploading...</div> <div class="upload-progress-bar-container"> <div class="upload-progress-bar" id="domicile_certificate_bar"></div> </div> <div class="upload-percentage" id="domicile_certificate_percent">0%</div> </div> </div> </div> <small class="help-text" data-hindi="मूलनिवासी प्रमाण पत्र अपलोड करें" data-english="Upload domicile certificate">Upload domicile certificate</small> </div> <div class="form-group" id="tenth_marksheet_field" style="display: none;"> <label for="tenth_marksheet" data-hindi="10वीं मार्कशीट" data-english="10th Marksheet">10th Marksheet <span class="required">*</span></label> <div class="upload-container"> <div class="file-input-wrapper"> <input type="file" id="tenth_marksheet" name="tenth_marksheet" accept=".jpg,.jpeg,.png,.gif,image/jpeg,image/png,image/gif" required> <div class="file-input-display" onclick="document.getElementById('tenth_marksheet').click()"> <span class="file-input-text" id="tenth_marksheet_text">Click to select file</span> <i class="fas fa-upload file-input-icon"></i> </div> </div> <div class="upload-progress" id="tenth_marksheet_progress"> <div class="loader"> <div class="logo"></div> <div class="shadow"></div> </div> <div class="upload-progress-container"> <div class="upload-progress-text" id="tenth_marksheet_status">Uploading...</div> <div class="upload-progress-bar-container"> <div class="upload-progress-bar" id="tenth_marksheet_bar"></div> </div> <div class="upload-percentage" id="tenth_marksheet_percent">0%</div> </div> </div> </div> <small class="help-text" data-hindi="10वीं कक्षा की मार्कशीट अपलोड करें" data-english="Upload 10th standard marksheet">Upload 10th standard marksheet</small> </div> <div class="form-group" id="twelfth_marksheet_field" style="display: none;"> <label for="twelfth_marksheet" id="twelfth_marksheet_label" data-hindi="12वीं मार्कशीट" data-english="12th Marksheet">12th Marksheet <span class="required">*</span></label> <div class="upload-container"> <div class="file-input-wrapper"> <input type="file" id="twelfth_marksheet" name="twelfth_marksheet" accept=".jpg,.jpeg,.png,.gif,image/jpeg,image/png,image/gif" required> <div class="file-input-display" onclick="document.getElementById('twelfth_marksheet').click()"> <span class="file-input-text" id="twelfth_marksheet_text">Click to select file</span> <i class="fas fa-upload file-input-icon"></i> </div> </div> <div class="upload-progress" id="twelfth_marksheet_progress"> <div class="loader"> <div class="logo"></div> <div class="shadow"></div> </div> <div class="upload-progress-container"> <div class="upload-progress-text" id="twelfth_marksheet_status">Uploading...</div> <div class="upload-progress-bar-container"> <div class="upload-progress-bar" id="twelfth_marksheet_bar"></div> </div> <div class="upload-percentage" id="twelfth_marksheet_percent">0%</div> </div> </div> </div> <small class="help-text" id="twelfth_marksheet_help" data-hindi="12वीं कक्षा की मार्कशीट अपलोड करें" data-english="Upload 12th standard marksheet">Upload 12th standard marksheet</small> </div> <div class="form-group" id="admission_proof_field"> <label for="admission_proof" id="admission_proof_label" data-hindi="प्रवेश प्रमाण" data-english="Admission Proof">Admission Proof <span class="required">*</span></label> <div class="upload-container"> <div class="file-input-wrapper"> <input type="file" id="admission_proof" name="admission_proof" accept=".jpg,.jpeg,.png,.gif,image/jpeg,image/png,image/gif" required> <div class="file-input-display" onclick="document.getElementById('admission_proof').click()"> <span class="file-input-text" id="admission_proof_text">Click to select file</span> <i class="fas fa-upload file-input-icon"></i> </div> </div> <div class="upload-progress" id="admission_proof_progress"> <div class="loader"> <div class="logo"></div> <div class="shadow"></div> </div> <div class="upload-progress-container"> <div class="upload-progress-text" id="admission_proof_status">Uploading...</div> <div class="upload-progress-bar-container"> <div class="upload-progress-bar" id="admission_proof_bar"></div> </div> <div class="upload-percentage" id="admission_proof_percent">0%</div> </div> </div> </div> <small class="help-text" id="admission_proof_help" data-hindi="प्रवेश पत्र या कॉलेज आईडी अपलोड करें" data-english="Upload admission letter or college ID">Upload admission letter or college ID</small> </div> <div class="form-group" id="fee_receipt_field"> <label for="fee_receipt" id="fee_receipt_label" data-hindi="शुल्क रसीद/नामांकन प्रमाण" data-english="Fee Receipt/Enrollment Proof">Fee Receipt/Enrollment Proof <span class="required">*</span></label> <div class="upload-container"> <div class="file-input-wrapper"> <input type="file" id="fee_receipt" name="fee_receipt" accept=".jpg,.jpeg,.png,.gif,image/jpeg,image/png,image/gif" required> <div class="file-input-display" onclick="document.getElementById('fee_receipt').click()"> <span class="file-input-text" id="fee_receipt_text">Click to select file</span> <i class="fas fa-upload file-input-icon"></i> </div> </div> <div class="upload-progress" id="fee_receipt_progress"> <div class="loader"> <div class="logo"></div> <div class="shadow"></div> </div> <div class="upload-progress-container"> <div class="upload-progress-text" id="fee_receipt_status">Uploading...</div> <div class="upload-progress-bar-container"> <div class="upload-progress-bar" id="fee_receipt_bar"></div> </div> <div class="upload-percentage" id="fee_receipt_percent">0%</div> </div> </div> </div> <small class="help-text" id="fee_receipt_help" data-hindi="शुल्क रसीद या नामांकन प्रमाण पत्र अपलोड करें" data-english="Upload fee receipt or enrollment certificate">Upload fee receipt or enrollment certificate</small> </div> </div> </div> <!-- Step 5: Bank Verification --> <div class="form-step" id="step5"> <h2><i class="fas fa-university"></i> <span data-hindi="बैंक सत्यापन" data-english="Bank Verification">Bank Verification</span></h2> <div class="bank-note" style="background: #fff3cd; border: 1px solid #ffeaa7; border-radius: 8px; padding: 15px; margin-bottom: 20px; color: #856404;"> <h4 style="margin: 0 0 10px 0; color: #856404; font-size: 16px;" data-hindi="📌 महत्वपूर्ण जानकारी" data-english="📌 Important Information">📌 Important Information</h4> <p style="margin: 0; line-height: 1.6;" data-hindi="छात्रवृत्ति के लिए बैंक खाता NGO से खुलवाना होगा, वह खाता सत्यापित होगा। यदि आप नया खाता नहीं खुलवा पाते हैं तो उस स्थिति में आपको बैंक सत्यापन शुल्क देना पड़ेगा। अधिक जानकारी के लिए 7772056856 पर कॉल या मैसेज करके पूरी जानकारी लें। आप NGO का खाता हमारे तकनीकी अधिकारी के सहयोग से खोल सकते हैं।" data-english="For scholarship, bank account needs to be opened through NGO, that account will be verified. If you cannot open a new account, then in that condition you will have to pay bank verification charges. For more information, call or message on 7772056856 to get complete details. You can open NGO account with the support of our technical officer.">For scholarship, bank account needs to be opened through NGO, that account will be verified. If you cannot open a new account, then in that condition you will have to pay bank verification charges. For more information, call or message on <a href="tel:7772056856" style="color: #856404; font-weight: bold;">7772056856</a> to get complete details. You can open NGO account with the support of our technical officer.</p> </div> <div class="document-upload-section"> <p class="upload-instructions" data-hindi="कृपया छात्रवृत्ति भुगतान के लिए अपने बैंक खाते का विवरण प्रदान करें।" data-english="Please provide your bank account details for scholarship disbursement.">Please provide your bank account details for scholarship disbursement.</p> <div class="form-group"> <label for="bank_name" data-hindi="बैंक का नाम" data-english="Bank Name">Bank Name <span class="required">*</span></label> <input type="text" id="bank_name" name="bank_name" required> </div> <div class="form-row"> <div class="form-group"> <label for="account_holder_name" data-hindi="खाताधारक का नाम" data-english="Account Holder Name">Account Holder Name <span class="required">*</span></label> <input type="text" id="account_holder_name" name="account_holder_name" required> </div> <div class="form-group"> <label for="account_number" data-hindi="खाता संख्या" data-english="Account Number">Account Number <span class="required">*</span></label> <input type="text" id="account_number" name="account_number" required> </div> </div> <div class="form-row"> <div class="form-group"> <label for="ifsc_code" data-hindi="आईएफएससी कोड" data-english="IFSC Code">IFSC Code <span class="required">*</span></label> <input type="text" id="ifsc_code" name="ifsc_code" required> </div> <div class="form-group"> <label for="branch_name" data-hindi="शाखा का नाम" data-english="Branch Name">Branch Name <span class="required">*</span></label> <input type="text" id="branch_name" name="branch_name" required> </div> </div> <div class="note" style="background-color: #fff3cd; border: 1px solid #ffeaa7; border-radius: 5px; padding: 15px; margin: 15px 0; color: #856404;"> <strong>Note:</strong> Your bank account must be verified in our system. Please ensure that the account number and IFSC code you enter match exactly with a verified account in our database. If your account is not verified, you will need to contact our support team to get it verified before submitting your application. </div> <div class="form-group"> <label for="bank_passbook" data-hindi="बैंक पासबुक/रद्द चेक" data-english="Bank Passbook/Cancelled Cheque">Bank Passbook/Cancelled Cheque <span class="required">*</span></label> <div class="upload-container"> <div class="file-input-wrapper"> <input type="file" id="bank_passbook" name="bank_passbook" accept=".jpg,.jpeg,.png,.gif,image/jpeg,image/png,image/gif" required> <div class="file-input-display" onclick="document.getElementById('bank_passbook').click()"> <span class="file-input-text" id="bank_passbook_text">Click to select file</span> <i class="fas fa-upload file-input-icon"></i> </div> </div> <div class="upload-progress" id="bank_passbook_progress"> <div class="loader"> <div class="logo"></div> <div class="shadow"></div> </div> <div class="upload-progress-container"> <div class="upload-progress-text" id="bank_passbook_status">Uploading...</div> <div class="upload-progress-bar-container"> <div class="upload-progress-bar" id="bank_passbook_bar"></div> </div> <div class="upload-percentage" id="bank_passbook_percent">0%</div> </div> </div> </div> <small class="help-text" data-hindi="बैंक पासबुक या रद्द चेक की स्पष्ट फोटो या स्कैन कॉपी अपलोड करें" data-english="Upload clear photo or scanned copy of bank passbook or cancelled cheque">Upload clear photo or scanned copy of bank passbook or cancelled cheque</small> </div> <div class="form-group"> <label for="live_photo" data-hindi="लाइव फोटो" data-english="Live Photo">Live Photo <span class="required">*</span></label> <div class="upload-container"> <div class="file-input-wrapper"> <input type="file" id="live_photo" name="live_photo" accept=".jpg,.jpeg,.png,.gif,image/jpeg,image/png,image/gif" required> <div class="file-input-display" onclick="document.getElementById('live_photo').click()"> <span class="file-input-text" id="live_photo_text">Click to select file</span> <i class="fas fa-upload file-input-icon"></i> </div> </div> <div class="upload-progress" id="live_photo_progress"> <div class="loader"> <div class="logo"></div> <div class="shadow"></div> </div> <div class="upload-progress-container"> <div class="upload-progress-text" id="live_photo_status">Uploading...</div> <div class="upload-progress-bar-container"> <div class="upload-progress-bar" id="live_photo_bar"></div> </div> <div class="upload-percentage" id="live_photo_percent">0%</div> </div> </div> </div> <small class="help-text" data-hindi="अपना हाल ही का स्पष्ट लाइव फोटो अपलोड करें" data-english="Upload a recent, clear live photo of yourself">Upload a recent, clear live photo of yourself</small> </div> </div> </div> <div class="form-navigation"> <button type="button" id="prevBtn" class="btn btn-secondary" onclick="changeStep(-1)" style="display: none;"> <i class="fas fa-arrow-left"></i> <span data-hindi="पिछला" data-english="Previous">Previous</span> </button> <button type="button" id="nextBtn" class="btn" onclick="changeStep(1)"> <span data-hindi="अगला" data-english="Next">Next</span> <i class="fas fa-arrow-right"></i> </button> <button type="submit" id="submitBtn" class="btn" style="display: none;"> <i class="fas fa-paper-plane"></i> <span data-hindi="आवेदन जमा करें" data-english="Submit Application">Submit Application</span> </button> </div> </form> </div> </div> <!-- Custom Alert Modal --> <div class="custom-alert-overlay" id="customAlertOverlay"> <div class="custom-alert-modal"> <div class="custom-alert-header"> <i class="fas fa-exclamation-circle" id="customAlertIcon"></i> <h3 id="customAlertTitle">Alert</h3> </div> <div class="custom-alert-body"> <div class="custom-alert-icon error" id="customAlertBodyIcon"> <i class="fas fa-exclamation-triangle"></i> </div> <p id="customAlertMessage">Message</p> </div> <div class="custom-alert-footer"> <button class="custom-alert-btn" id="customAlertOkBtn">OK</button> </div> </div> </div> <!-- Receipt Popup --> <div class="receipt-popup" id="receiptPopup"> <div class="receipt-content"> <div class="success-icon"> <i class="fas fa-check-circle"></i> </div> <div class="receipt-header"> <div class="receipt-title">Application Submitted Successfully!</div> <div class="receipt-subtitle">Savitr Foundation Scholarship Portal</div> </div> <div class="receipt-details"> <div class="receipt-row"> <span class="receipt-label">Date:</span> <span class="receipt-value"><?php echo date('d/m/Y'); ?></span> </div> <div class="receipt-row"> <span class="receipt-label">Time:</span> <span class="receipt-value"><?php echo date('H:i:s'); ?></span> </div> <div class="receipt-row"> <span class="receipt-label">Status:</span> <span class="receipt-value" style="color: #28a745;">Submitted</span> </div> </div> <div class="receipt-id"> <div class="receipt-id-label">Your Application ID</div> <div class="receipt-id-value" id="receiptAppId"><?php echo isset($_SESSION['new_application_id']) ? htmlspecialchars($_SESSION['new_application_id']) : 'Loading...'; ?></div> </div> <div style="background: #fff5f5; padding: 15px; border-radius: 8px; margin: 20px 0; text-align: left; border:1px solid #f5c2c7;"> <strong style="color:#d32f2f;">Important Notes:</strong> <ul style="margin: 10px 0; padding-left: 20px;"> <li style="color:#b71c1c;">Save this Application ID for future reference</li> <li style="color:#b71c1c;">You will receive login credentials via email</li> <li style="color:#b71c1c;">Check your application status regularly</li> <li style="color:#b71c1c;">Contact 7772056856 for any queries</li> </ul> </div> <div class="receipt-actions"> <button class="btn-close" onclick="closeReceipt()">Close</button> </div> </div> </div> <!-- Terms & Conditions Modal --> <div id="termsModal" class="modal policy-modal"> <div class="modal-content"> <div class="modal-header"> <h3 data-hindi="नियम एवं शर्तें" data-english="Terms & Conditions">Terms & Conditions</h3> <span class="close policy-close" data-close-modal="termsModal">×</span> </div> <div class="modal-body"> <iframe src="terms%20and%20conditions/terms%26condition.html" title="Terms & Conditions" loading="lazy"></iframe> </div> </div> </div> <!-- Privacy Policy Modal --> <div id="privacyModal" class="modal policy-modal"> <div class="modal-content"> <div class="modal-header"> <h3 data-hindi="गोपनीयता नीति" data-english="Privacy Policy">Privacy Policy</h3> <span class="close policy-close" data-close-modal="privacyModal">×</span> </div> <div class="modal-body"> <iframe src="privacy%20policy/privacy-policy.html" title="Privacy Policy" loading="lazy"></iframe> </div> </div> </div> <!-- Help Modal --> <div id="helpModal" class="modal"> <div class="modal-content"> <div class="modal-header"> <h3 data-hindi="सहायता" data-english="Help">Help</h3> <span class="close" id="closeHelp">×</span> </div> <div class="modal-body"> <div class="help-content"> <div class="help-section"> <h4 data-hindi="छात्रवृत्ति के बारे में जानकारी" data-english="About Scholarships">About Scholarships</h4> <p data-hindi="इस वेबसाइट पर आप विभिन्न छात्रवृत्ति योजनाओं के बारे में जानकारी प्राप्त कर सकते हैं। हमारी सभी योजनाएं सभी श्रेणियों (GEN, OBC, ST, SC) के छात्रों के लिए उपलब्ध हैं।" data-english="On this website, you can get information about various scholarship schemes. All our schemes are available for students from all categories (GEN, OBC, ST, SC).">On this website, you can get information about various scholarship schemes. All our schemes are available for students from all categories (GEN, OBC, ST, SC).</p> </div> <div class="help-section"> <h4 data-hindi="पात्रता मानदंड" data-english="Eligibility Criteria">Eligibility Criteria</h4> <ul> <li data-hindi="आयु: 15-35 वर्ष" data-english="Age: 15-35 years">Age: 15-35 years</li> <li data-hindi="शैक्षिक योग्यता: हायर सेकेंडरी, स्नातक, स्नातकोत्तर या ड्रॉपआउट छात्र" data-english="Educational Qualification: Higher Secondary, Undergraduate, Postgraduate or Dropout students">Educational Qualification: Higher Secondary, Undergraduate, Postgraduate or Dropout students</li> <li data-hindi="पारिवारिक आय: ₹8,00,000 से कम" data-english="Family Income: Below ₹8,00,000">Family Income: Below ₹8,00,000</li> </ul> </div> <div class="help-section"> <h4 data-hindi="संपर्क करें" data-english="Contact Us">Contact Us</h4> <div class="contact-info"> <p><i class="fas fa-phone"></i> <strong data-hindi="फोन:" data-english="Phone:">Phone:</strong> +91 7772056856</p> <p><i class="fas fa-envelope"></i> <strong data-hindi="ईमेल:" data-english="Email:">Email:</strong> support@savitrfoundation.com</p> <p><i class="fas fa-map-marker-alt"></i> <strong data-hindi="पता:" data-english="Address:">Address:</strong> 288/2 Shahid Nagar Agar Road, Ujjain, Madhya Pradesh</p> </div> </div> </div> </div> </div> </div> <script src="js/pincode_database.js"></script> <script src="js/college_database.js"></script> <script> // Custom Alert Function to replace browser alert() function showCustomAlert(message, type = 'error', title = null) { const overlay = document.getElementById('customAlertOverlay'); const alertTitle = document.getElementById('customAlertTitle'); const alertMessage = document.getElementById('customAlertMessage'); const alertIcon = document.getElementById('customAlertIcon'); const alertBodyIcon = document.getElementById('customAlertBodyIcon'); const okBtn = document.getElementById('customAlertOkBtn'); // Set title const lang = typeof currentLanguage !== 'undefined' ? currentLanguage : 'english'; if (!title) { title = lang === 'hindi' ? 'सूचना' : 'Alert'; } alertTitle.textContent = title; // Set message alertMessage.textContent = message; // Set icon based on type const iconClasses = { 'error': 'fa-exclamation-triangle', 'warning': 'fa-exclamation-circle', 'info': 'fa-info-circle', 'success': 'fa-check-circle' }; const iconClass = iconClasses[type] || iconClasses['error']; alertIcon.className = 'fas ' + iconClass; alertBodyIcon.className = 'custom-alert-icon ' + type; alertBodyIcon.innerHTML = '<i class="fas ' + iconClass + '"></i>'; // Show overlay overlay.classList.add('show'); // Focus on OK button setTimeout(() => { okBtn.focus(); }, 100); // Return promise for async/await support return new Promise((resolve) => { // Close on button click okBtn.onclick = function() { overlay.classList.remove('show'); resolve(true); }; // Close on overlay click (outside modal) overlay.onclick = function(e) { if (e.target === overlay) { overlay.classList.remove('show'); resolve(true); } }; // Close on Escape key const escapeHandler = function(e) { if (e.key === 'Escape' && overlay.classList.contains('show')) { overlay.classList.remove('show'); document.removeEventListener('keydown', escapeHandler); resolve(true); } }; document.addEventListener('keydown', escapeHandler); }); } // Replace native alert() with custom alert const originalAlert = window.alert; window.alert = function(message) { showCustomAlert(message, 'error'); }; let currentStep = 1; const totalSteps = 5; // Form Auto-Save functionality using localStorage const FORM_STORAGE_KEY = 'scholarship_application_form_data'; const STEP_STORAGE_KEY = 'scholarship_application_current_step'; // Save form data to localStorage function saveFormData() { try { const form = document.getElementById('applicationForm'); if (!form) return; const formData = new FormData(form); const formObject = {}; // Convert FormData to object (excluding files) for (let [key, value] of formData.entries()) { // Skip file inputs const field = form.querySelector(`[name="${key}"]`); if (field && field.type === 'file') { continue; // Don't save file inputs } formObject[key] = value; } // Save to localStorage localStorage.setItem(FORM_STORAGE_KEY, JSON.stringify(formObject)); localStorage.setItem(STEP_STORAGE_KEY, currentStep.toString()); console.log('Form data saved to localStorage'); } catch (error) { console.error('Error saving form data:', error); } } // Restore form data from localStorage function restoreFormData() { try { const savedData = localStorage.getItem(FORM_STORAGE_KEY); const savedStep = localStorage.getItem(STEP_STORAGE_KEY); if (!savedData) { console.log('No saved form data found'); return false; } const formObject = JSON.parse(savedData); const form = document.getElementById('applicationForm'); if (!form) return false; // Restore form fields for (let [key, value] of Object.entries(formObject)) { const field = form.querySelector(`[name="${key}"]`); if (field) { // Skip file inputs if (field.type === 'file') continue; // Handle different field types if (field.type === 'checkbox') { field.checked = value === '1' || value === true; } else if (field.type === 'radio') { const radio = form.querySelector(`[name="${key}"][value="${value}"]`); if (radio) radio.checked = true; } else { field.value = value || ''; } // Trigger change event for fields that have dependent logic if (['institution_type', 'gender', 'category', 'dob', 'education_level'].includes(key)) { field.dispatchEvent(new Event('change', { bubbles: true })); } } } // Restore current step if (savedStep) { const step = parseInt(savedStep); if (step >= 1 && step <= totalSteps) { // Navigate to saved step without validation const steps = document.querySelectorAll('.form-step'); const stepIndicators = document.querySelectorAll('.step'); const stepLabels = document.querySelectorAll('.step-label'); // Hide all steps steps.forEach(s => s.classList.remove('active')); stepIndicators.forEach(s => s.classList.remove('active', 'completed')); stepLabels.forEach(s => s.classList.remove('active')); // Show saved step currentStep = step; steps[currentStep - 1].classList.add('active'); stepIndicators[currentStep - 1].classList.add('active'); stepLabels[currentStep - 1].classList.add('active'); // Mark previous steps as completed for (let i = 0; i < currentStep - 1; i++) { stepIndicators[i].classList.add('completed'); } updateNavigationButtons(); // Show notification const lang = typeof currentLanguage !== 'undefined' ? currentLanguage : 'english'; const message = lang === 'hindi' ? 'आपकी पिछली जानकारी restore की गई है। आप Step ' + currentStep + ' पर हैं।' : 'Your previous data has been restored. You are on Step ' + currentStep + '.'; setTimeout(() => { showCustomAlert(message, 'info', lang === 'hindi' ? 'जानकारी Restore' : 'Data Restored'); }, 500); } } // Trigger auto-selection and other dependent functions setTimeout(() => { if (typeof autoSelectScholarship === 'function') { autoSelectScholarship(); } if (typeof updateDocumentRequirements === 'function') { updateDocumentRequirements(); } if (typeof checkFormCompletion === 'function') { checkFormCompletion(); } }, 300); console.log('Form data restored from localStorage'); return true; } catch (error) { console.error('Error restoring form data:', error); return false; } } // Clear saved form data function clearFormData() { try { localStorage.removeItem(FORM_STORAGE_KEY); localStorage.removeItem(STEP_STORAGE_KEY); console.log('Form data cleared from localStorage'); } catch (error) { console.error('Error clearing form data:', error); } } // Auto-save form data on input/change function setupAutoSave() { const form = document.getElementById('applicationForm'); if (!form) return; // Save on any input change form.addEventListener('input', function(e) { // Debounce save operation clearTimeout(window.autoSaveTimeout); window.autoSaveTimeout = setTimeout(saveFormData, 500); }); form.addEventListener('change', function(e) { // Save immediately on select/checkbox changes saveFormData(); }); // Save when step changes - will be handled in changeStep function itself } // Store original changeStep if it exists, otherwise define it let originalChangeStepFunction = null; function changeStep(direction) { const pageLoader = document.getElementById('page-loader'); const steps = document.querySelectorAll('.form-step'); const stepIndicators = document.querySelectorAll('.step'); const stepLabels = document.querySelectorAll('.step-label'); if (direction === 1 && currentStep < totalSteps) { if (validateCurrentStep()) { pageLoader.style.display = 'flex'; setTimeout(() => { steps[currentStep - 1].classList.remove('active'); stepIndicators[currentStep - 1].classList.remove('active'); stepIndicators[currentStep - 1].classList.add('completed'); stepLabels[currentStep - 1].classList.remove('active'); currentStep++; steps[currentStep - 1].classList.add('active'); stepIndicators[currentStep - 1].classList.add('active'); stepLabels[currentStep - 1].classList.add('active'); updateNavigationButtons(); pageLoader.style.display = 'none'; // Check form completion when reaching last step if (currentStep === totalSteps) { setTimeout(checkFormCompletion, 200); } // Save form data after step change setTimeout(saveFormData, 200); }, 1000); } } else if (direction === -1 && currentStep > 1) { steps[currentStep - 1].classList.remove('active'); stepIndicators[currentStep - 1].classList.remove('active'); stepLabels[currentStep - 1].classList.remove('active'); currentStep--; steps[currentStep - 1].classList.add('active'); stepIndicators[currentStep - 1].classList.add('active'); stepIndicators[currentStep - 1].classList.remove('completed'); stepLabels[currentStep - 1].classList.add('active'); updateNavigationButtons(); // Save form data after step change setTimeout(saveFormData, 100); } } function validateCurrentStep() { console.log('Validating step:', currentStep); try { // Force auto-selection for step 1 before validation if (currentStep === 1) { // Always trigger auto-selection autoSelectScholarship(); // Force select scholarship if still not selected const schemeSelect = document.getElementById('scheme_name'); if (!schemeSelect.value) { // Auto-select based on available data const gender = document.getElementById('gender').value; const category = document.getElementById('category').value; const dob = document.getElementById('dob').value; if (gender && category) { let age = 0; if (dob) { const dobDate = new Date(dob); const today = new Date(); age = today.getFullYear() - dobDate.getFullYear(); } let selectedScheme = ''; if (age < 18) { selectedScheme = 'Book Allowance'; } else if (gender === 'Female' && ['SC', 'ST', 'OBC'].includes(category)) { selectedScheme = 'Udaan Scholarship'; } else if (category === 'GEN') { selectedScheme = 'Shiksha Sahara'; } else if (gender === 'Male' && ['OBC', 'SC', 'ST'].includes(category)) { selectedScheme = 'Samaan Shiksha'; } else { selectedScheme = 'Udaan Scholarship'; } schemeSelect.value = selectedScheme; // Hide other options const options = schemeSelect.querySelectorAll('option'); options.forEach(option => { if (option.value && option.value !== selectedScheme) { option.style.display = 'none'; } }); // Keep dropdown enabled but show selected value schemeSelect.style.backgroundColor = '#e8f5e8'; schemeSelect.style.borderColor = '#28a745'; } } // Validate referred by user ID (Scholar ID) when moving to step 2 const referredByUserId = document.getElementById('referred_by_user_id'); if (referredByUserId && referredByUserId.value.trim()) { // Show checking status const statusDiv = document.createElement('div'); statusDiv.id = 'scholarIdValidationStatus'; statusDiv.style.cssText = ` margin: 10px 0; padding: 10px; border-radius: 5px; font-weight: bold; text-align: center; background-color: #fff3cd; border: 1px solid #ffeaa7; color: #856404; `; statusDiv.innerHTML = '<i class="fas fa-spinner fa-spin"></i> Checking Scholar ID...'; referredByUserId.parentNode.insertBefore(statusDiv, referredByUserId.nextSibling); // Validate Scholar ID against database const xhr = new XMLHttpRequest(); xhr.open('POST', 'scholar/ajax/check_scholar_id.php', false); // Synchronous request for validation xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhr.send('scholar_id=' + encodeURIComponent(referredByUserId.value.trim())); // Remove status div if (statusDiv.parentNode) { statusDiv.parentNode.removeChild(statusDiv); } try { const response = JSON.parse(xhr.responseText); if (!response.valid) { const lang = typeof currentLanguage !== 'undefined' ? currentLanguage : 'english'; alert(lang === 'hindi' ? 'गलत छात्रवृत्ति आईडी। कृपया सही छात्रवृत्ति आईडी दर्ज करें।' : 'Wrong refferal Scholar ID. Please enter a valid refferal Scholar ID.'); referredByUserId.focus(); return false; } } catch (e) { console.error('Error parsing Scholar ID validation response:', e); // Continue with form submission even if validation fails } } const termsCheckbox = document.getElementById('terms_accept'); if (termsCheckbox && !termsCheckbox.checked) { const lang = typeof currentLanguage !== 'undefined' ? currentLanguage : 'english'; alert(lang === 'hindi' ? 'कृपया आगे बढ़ने से पहले नियम एवं शर्तों और गोपनीयता नीति से सहमति दें।' : 'Please accept the Terms & Conditions and Privacy Policy before continuing.'); if (termsCheckbox.scrollIntoView) { termsCheckbox.scrollIntoView({ behavior: 'smooth', block: 'center' }); } termsCheckbox.focus(); return false; } } const currentStepElement = document.getElementById(`step${currentStep}`); const requiredFields = currentStepElement.querySelectorAll('[required]'); console.log('Required fields found:', requiredFields.length); for (let field of requiredFields) { console.log('Checking field:', field.name, 'Value:', field.value); // Skip validation for hidden fields if (field.offsetParent === null && field.type !== 'hidden') { console.log('Skipping hidden field:', field.name); continue; } // Skip validation for fields that are not actually required (dynamic requirement) if (field.name === 'institution_name' || field.name === 'class' || field.name === 'course' || field.name === 'annual_school_fees' || field.name === 'annual_college_fees' || field.name === 'year') { // Check if the field is actually visible and required const institutionType = document.getElementById('institution_type').value; let shouldValidate = false; if (field.name === 'institution_name' && institutionType) { shouldValidate = true; } else if (field.name === 'class' && institutionType) { shouldValidate = true; } else if (field.name === 'course' && institutionType === 'College') { shouldValidate = true; } else if (field.name === 'annual_school_fees' && institutionType === 'School') { shouldValidate = true; } else if (field.name === 'annual_college_fees' && institutionType === 'College') { shouldValidate = true; } else if (field.name === 'year') { // Year field is always required when step 3 is active shouldValidate = true; } if (!shouldValidate) { console.log('Skipping dynamically non-required field:', field.name); continue; } // Additional validation for select fields if (field.tagName === 'SELECT' && field.value === '') { const fieldLabel = field.previousElementSibling ? field.previousElementSibling.textContent.replace('*', '').trim() : field.name || 'this field'; const lang = typeof currentLanguage !== 'undefined' ? currentLanguage : 'english'; const message = lang === 'hindi' ? `कृपया ${fieldLabel} चुनें। यह फ़ील्ड आवश्यक है।` : `Please select ${fieldLabel}. This field is required.`; alert(message); field.focus(); field.style.borderColor = '#dc3545'; setTimeout(() => { field.style.borderColor = ''; }, 3000); return false; } } // Special validation for institution_type field if (field.name === 'institution_type' && (!field.value || !field.value.trim())) { alert('Please select Institution Type'); field.focus(); return false; } // General validation for other fields if (!field.value || !field.value.trim()) { const fieldLabel = field.previousElementSibling ? field.previousElementSibling.textContent.replace('*', '').trim() : field.name || 'this field'; const lang = typeof currentLanguage !== 'undefined' ? currentLanguage : 'english'; const message = lang === 'hindi' ? `कृपया ${fieldLabel} फ़ील्ड भरें। यह फ़ील्ड आवश्यक है।` : `Please fill in ${fieldLabel}. This field is required.`; alert(message); field.focus(); field.style.borderColor = '#dc3545'; setTimeout(() => { field.style.borderColor = ''; }, 3000); return false; } // Mobile number validation if (field.name === 'phone' || field.name === 'whatsapp') { const phonePattern = /^[0-9]{10}$/; if (!phonePattern.test(field.value)) { const lang = typeof currentLanguage !== 'undefined' ? currentLanguage : 'english'; const message = lang === 'hindi' ? 'कृपया 10 अंकों का मोबाइल नंबर दर्ज करें (जैसे: 9876543210)' : 'Please enter a valid 10-digit mobile number (e.g: 9876543210)'; alert(message); field.focus(); field.style.borderColor = '#dc3545'; setTimeout(() => { field.style.borderColor = ''; }, 3000); return false; } } // IFSC code validation - standard format validation if (field.name === 'ifsc_code') { const ifscValue = field.value.trim().toUpperCase(); // Validate IFSC code format (11 characters, first 4 alphabets, 5th character 0, last 6 alphanumeric) if (ifscValue.length !== 11) { alert('IFSC code must be 11 characters long'); field.focus(); return false; } // Check if first 4 characters are alphabets const bankCode = ifscValue.substring(0, 4); if (!/^[A-Z]{4}$/.test(bankCode)) { alert('First 4 characters of IFSC code must be alphabets'); field.focus(); return false; } // Check if 5th character is 0 const fifthChar = ifscValue.substring(4, 5); if (fifthChar !== '0') { alert('5th character of IFSC code must be 0'); field.focus(); return false; } // Check if last 6 characters are alphanumeric const branchCode = ifscValue.substring(5); if (!/^[A-Z0-9]{6}$/.test(branchCode)) { alert('Last 6 characters of IFSC code must be alphanumeric'); field.focus(); return false; } // Update the field value to uppercase field.value = ifscValue; } // Education level validation if (field.name === 'education_level' && field.value === '') { alert('Please select your education level'); field.focus(); return false; } } console.log('Step validation passed'); return true; } catch (error) { console.error('Validation error:', error); alert('An error occurred during validation. Please try again or contact support.'); return false; } } function updateNavigationButtons() { const prevBtn = document.getElementById('prevBtn'); const nextBtn = document.getElementById('nextBtn'); const submitBtn = document.getElementById('submitBtn'); prevBtn.style.display = currentStep > 1 ? 'block' : 'none'; nextBtn.style.display = currentStep < totalSteps ? 'block' : 'none'; submitBtn.style.display = currentStep === totalSteps ? 'block' : 'none'; // Check form completion when on last step if (currentStep === totalSteps) { setTimeout(checkFormCompletion, 100); } } // Institution type change handler document.getElementById('institution_type').addEventListener('change', function() { console.log('Institution type changed to:', this.value); const classField = document.getElementById('class_field'); const courseField = document.getElementById('course_field'); const schoolFeesField = document.getElementById('school_fees_field'); const collegeFeesField = document.getElementById('college_fees_field'); const institutionNameLabel = document.getElementById('institution_name_label'); const institutionNameField = document.getElementById('institution_name_field'); const institutionNameInput = document.getElementById('institution_name'); const collegeAutocompleteWrapper = document.getElementById('college_autocomplete_wrapper'); const collegeSearchHint = document.getElementById('college_search_hint'); if (this.value === 'School') { // Show institution name field institutionNameField.style.display = 'block'; institutionNameInput.required = true; // School setup classField.style.display = 'block'; courseField.style.display = 'none'; schoolFeesField.style.display = 'block'; collegeFeesField.style.display = 'none'; document.getElementById('class').required = true; document.getElementById('course').required = false; document.getElementById('annual_school_fees').required = true; document.getElementById('annual_college_fees').required = false; institutionNameLabel.innerHTML = 'School Name <span class="required">*</span>'; // Disable autocomplete for school collegeAutocompleteWrapper.setAttribute('data-autocomplete', 'disabled'); collegeSearchHint.style.display = 'none'; institutionNameInput.placeholder = 'Enter your school name'; hideCollegeSuggestions(); setClassOptions('School'); } else if (this.value === 'College') { // Show institution name field institutionNameField.style.display = 'block'; institutionNameInput.required = true; // College setup classField.style.display = 'block'; courseField.style.display = 'block'; schoolFeesField.style.display = 'none'; collegeFeesField.style.display = 'block'; document.getElementById('class').required = true; document.getElementById('course').required = true; document.getElementById('annual_school_fees').required = false; document.getElementById('annual_college_fees').required = true; institutionNameLabel.innerHTML = 'College Name <span class="required">*</span>'; // Enable autocomplete for college collegeAutocompleteWrapper.setAttribute('data-autocomplete', 'enabled'); collegeSearchHint.style.display = 'block'; institutionNameInput.placeholder = 'Type college name or city...'; setClassOptions('College'); } else { // Hide institution name field when nothing selected institutionNameField.style.display = 'none'; institutionNameInput.required = false; institutionNameInput.value = ''; classField.style.display = 'none'; courseField.style.display = 'none'; schoolFeesField.style.display = 'none'; collegeFeesField.style.display = 'none'; document.getElementById('class').required = false; document.getElementById('class').value = ''; document.getElementById('course').required = false; document.getElementById('course').value = ''; document.getElementById('annual_school_fees').required = false; document.getElementById('annual_school_fees').value = ''; document.getElementById('annual_college_fees').required = false; document.getElementById('annual_college_fees').value = ''; // Also clear the year field when institution type is cleared document.getElementById('year').value = ''; collegeAutocompleteWrapper.removeAttribute('data-autocomplete'); hideCollegeSuggestions(); } // Update document requirements based on institution type updateDocumentRequirements(); }); // Real-time bank account verification let verificationTimeout; let lastAccountNumber = ''; let lastIfscCode = ''; // Function to check if account details have changed function accountDetailsChanged() { const accountNumber = document.getElementById('account_number').value.trim(); const ifscCode = document.getElementById('ifsc_code').value.trim().toUpperCase(); return (accountNumber !== lastAccountNumber || ifscCode !== lastIfscCode); } // Function to update last known values function updateLastValues() { lastAccountNumber = document.getElementById('account_number').value.trim(); lastIfscCode = document.getElementById('ifsc_code').value.trim().toUpperCase(); } // Function to show verification popup function showVerificationPopup(status, message) { // Remove any existing popup const existingPopup = document.getElementById('verificationPopup'); if (existingPopup) { existingPopup.remove(); } // Create popup element const popup = document.createElement('div'); popup.id = 'verificationPopup'; popup.style.cssText = ` position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: white; padding: 30px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); z-index: 2000; text-align: center; max-width: 400px; width: 90%; `; // Create popup content based on status let icon, title, color, content; if (status === 'verified') { icon = 'fa-check-circle'; title = 'Account Verified'; color = '#28a745'; content = ` <div style="font-size: 48px; color: ${color}; margin-bottom: 20px;"> <i class="fas ${icon}"></i> </div> <h3 style="margin-bottom: 15px; color: #333;">${title}</h3> <p style="margin-bottom: 20px; color: #666;">${message}</p> <button id="popupCloseBtn" style=" padding: 12px 24px; background: ${color}; color: white; border: none; border-radius: 5px; cursor: pointer; font-size: 16px; font-weight: 600; ">OK</button> `; } else { icon = 'fa-exclamation-triangle'; title = 'Verification Failed'; color = '#dc3545'; content = ` <div style="font-size: 48px; color: ${color}; margin-bottom: 20px;"> <i class="fas ${icon}"></i> </div> <h3 style="margin-bottom: 15px; color: #333;">${title}</h3> <p style="margin-bottom: 20px; color: #666;">${message}</p> <div style="background: #fff5f5; padding: 15px; border-radius: 8px; margin: 20px 0; text-align: left; border:1px solid #f5c2c7;"> <strong style="color:#d32f2f;">Contact Technical Officer:</strong> <ul style="margin: 10px 0; padding-left: 20px;"> <li style="color:#b71c1c;">Phone: 7772056856</li> <li style="color:#b71c1c;">Email: support@savitrfoundation.com</li> </ul> </div> <button id="popupCloseBtn" style=" padding: 12px 24px; background: ${color}; color: white; border: none; border-radius: 5px; cursor: pointer; font-size: 16px; font-weight: 600; ">OK</button> `; } popup.innerHTML = content; // Add to document document.body.appendChild(popup); // Add event listener to close button document.getElementById('popupCloseBtn').addEventListener('click', function() { popup.remove(); // Mark that popup has been shown to prevent it from showing again if (status === 'verified') { localStorage.setItem('accountVerifiedPopupShown', 'true'); } }); // Close popup when clicking outside popup.addEventListener('click', function(e) { if (e.target === popup) { popup.remove(); // Mark that popup has been shown to prevent it from showing again if (status === 'verified') { localStorage.setItem('accountVerifiedPopupShown', 'true'); } } }); // Close popup with Escape key document.addEventListener('keydown', function closeOnEscape(e) { if (e.key === 'Escape' && document.getElementById('verificationPopup')) { document.getElementById('verificationPopup').remove(); document.removeEventListener('keydown', closeOnEscape); // Mark that popup has been shown to prevent it from showing again if (status === 'verified') { localStorage.setItem('accountVerifiedPopupShown', 'true'); } } }); } // Function to show verification status function showVerificationStatus(status, message) { let verificationDiv = document.getElementById('accountVerificationStatus'); if (!verificationDiv) { verificationDiv = document.createElement('div'); verificationDiv.id = 'accountVerificationStatus'; verificationDiv.className = 'verification-status'; verificationDiv.style.cssText = ` margin: 10px 0; padding: 10px; border-radius: 5px; font-weight: bold; text-align: center; `; // Insert after the bank details section const bankDetails = document.querySelector('.form-step:nth-child(4)'); // Bank details step if (bankDetails) { bankDetails.parentNode.insertBefore(verificationDiv, bankDetails.nextSibling); } } // Set status and message switch (status) { case 'checking': verificationDiv.style.backgroundColor = '#fff3cd'; verificationDiv.style.borderColor = '#ffeaa7'; verificationDiv.style.color = '#856404'; verificationDiv.innerHTML = `<i class="fas fa-spinner fa-spin"></i> ${message}`; break; case 'verified': verificationDiv.style.backgroundColor = '#d4edda'; verificationDiv.style.borderColor = '#c3e6cb'; verificationDiv.style.color = '#155724'; verificationDiv.innerHTML = `<i class="fas fa-check-circle"></i> ${message}`; // Show popup only if it hasn't been shown before if (!localStorage.getItem('accountVerifiedPopupShown')) { showVerificationPopup('verified', 'Your bank account has been successfully verified!'); } break; case 'failed': verificationDiv.style.backgroundColor = '#f8d7da'; verificationDiv.style.borderColor = '#f5c6cb'; verificationDiv.style.color = '#721c24'; verificationDiv.innerHTML = `<i class="fas fa-times-circle"></i> ${message}`; // Show popup showVerificationPopup('failed', 'Verification failed. Please contact our technical officer to get your account verified.'); break; case 'error': verificationDiv.style.backgroundColor = '#f8d7da'; verificationDiv.style.borderColor = '#f5c6cb'; verificationDiv.style.color = '#721c24'; verificationDiv.innerHTML = `<i class="fas fa-exclamation-triangle"></i> ${message}`; // Show popup showVerificationPopup('failed', 'Verification error occurred. Please contact our technical officer for assistance.'); break; case 'partial': verificationDiv.style.backgroundColor = '#cce7ff'; verificationDiv.style.borderColor = '#b8daff'; verificationDiv.style.color = '#004085'; verificationDiv.innerHTML = `<i class="fas fa-info-circle"></i> ${message}`; break; } verificationDiv.style.display = 'block'; } // Clear the localStorage flag when the page loads (so popup can show again in new session) document.addEventListener('DOMContentLoaded', function() { localStorage.removeItem('accountVerifiedPopupShown'); }); // Modify the verifyBankAccount function to not auto-hide messages function verifyBankAccount() { const accountNumber = document.getElementById('account_number').value.trim(); const ifscCode = document.getElementById('ifsc_code').value.trim().toUpperCase(); // Update IFSC code field with uppercase value document.getElementById('ifsc_code').value = ifscCode; // Check if we have both account number and IFSC code if (accountNumber.length >= 5 && ifscCode.length >= 5) { // Show verification status showVerificationStatus('checking', 'Verifying account details...'); // Clear any existing timeout if (verificationTimeout) { clearTimeout(verificationTimeout); } // Debounce the verification request verificationTimeout = setTimeout(() => { fetch('scholar/ajax/check_verified_account.php', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, body: 'account_number=' + encodeURIComponent(accountNumber) + '&ifsc_code=' + encodeURIComponent(ifscCode) }) .then(response => response.json()) .then(data => { if (data.success) { if (data.verified) { showVerificationStatus('verified', 'Account verified successfully!'); updateLastValues(); checkFormCompletion(); // Enable submit button if all conditions met } else { showVerificationStatus('failed', 'Verification failed. Account not found in verified accounts database.'); disableSubmitButton('Bank account verification failed. Please contact technical officer at 7772056856'); } } else { showVerificationStatus('error', 'Verification error: ' + data.message); disableSubmitButton('Bank account verification error. Please try again or contact support at 7772056856'); } }) .catch(error => { console.error('Verification error:', error); showVerificationStatus('error', 'Verification failed. Please try again.'); disableSubmitButton('Network error during verification. Please check your internet connection'); }); }, 500); // 500ms debounce } else if (accountNumber.length > 0 || ifscCode.length > 0) { // Partial information entered showVerificationStatus('partial', 'Please enter complete account number and IFSC code'); disableSubmitButton('Please enter complete bank account details'); } else { // No information entered hideVerificationStatus(); disableSubmitButton('Please enter bank account details'); } } // Function to hide verification status function hideVerificationStatus() { const verificationDiv = document.getElementById('accountVerificationStatus'); if (verificationDiv) { verificationDiv.style.display = 'none'; } } // Function to enable submit button function enableSubmitButton() { const submitBtn = document.getElementById('submitBtn'); if (submitBtn) { submitBtn.disabled = false; submitBtn.style.opacity = '1'; submitBtn.style.cursor = 'pointer'; submitBtn.title = ''; } } // Function to disable submit button function disableSubmitButton(reason = '') { const submitBtn = document.getElementById('submitBtn'); if (submitBtn) { submitBtn.disabled = true; submitBtn.style.opacity = '0.5'; submitBtn.style.cursor = 'not-allowed'; submitBtn.title = reason || 'Please complete all steps and verify bank account'; } } // Function to check if all steps are completed and enable submit button function checkFormCompletion() { // Only enable if we're on the last step if (currentStep !== totalSteps) { disableSubmitButton('Please complete all steps first'); return; } // Check if bank account is verified const verificationDiv = document.getElementById('accountVerificationStatus'); if (verificationDiv && verificationDiv.style.display !== 'none') { const isVerified = verificationDiv.innerHTML.includes('verified successfully'); if (isVerified) { enableSubmitButton(); return; } } // If not verified yet, check if account details are entered const accountNumber = document.getElementById('account_number').value.trim(); const ifscCode = document.getElementById('ifsc_code').value.trim(); if (accountNumber.length >= 5 && ifscCode.length >= 5) { // Details entered but not verified yet - wait for verification disableSubmitButton('Please wait for bank account verification'); } else { disableSubmitButton('Please enter bank account details'); } } // Add event listeners for real-time verification document.addEventListener('DOMContentLoaded', function() { const accountNumberField = document.getElementById('account_number'); const ifscCodeField = document.getElementById('ifsc_code'); if (accountNumberField && ifscCodeField) { accountNumberField.addEventListener('input', function() { verifyBankAccount(); checkFormCompletion(); }); ifscCodeField.addEventListener('input', function() { verifyBankAccount(); checkFormCompletion(); }); // Also check on blur accountNumberField.addEventListener('blur', function() { verifyBankAccount(); checkFormCompletion(); }); ifscCodeField.addEventListener('blur', function() { verifyBankAccount(); checkFormCompletion(); }); } // Store original changeStep function if (typeof window.changeStep === 'function') { const originalChangeStep = window.changeStep; window.changeStep = function(direction) { originalChangeStep(direction); setTimeout(checkFormCompletion, 100); }; } // Initially disable submit button disableSubmitButton('Please complete all steps first'); }); // ========== COLLEGE AUTOCOMPLETE FUNCTIONALITY ========== let allColleges = []; let currentHighlightIndex = -1; let currentSearchResults = []; // Store current search results globally // Load colleges from college_database.js function loadColleges() { if (typeof collegeMap !== 'undefined') { allColleges = Object.keys(collegeMap) .filter(key => key !== 'Aishe Code') .map(key => ({ code: key, name: collegeMap[key].name, state: collegeMap[key].state, district: collegeMap[key].district, university: collegeMap[key].university || '' })); console.log(`✅ Loaded ${allColleges.length} colleges from database`); } else { console.error('❌ College database not loaded!'); } } // Search colleges - Continuous string search (like Ctrl+F) function searchColleges(query) { if (!query || query.length < 2) { return []; } const searchTerm = query.toLowerCase().trim(); // Search as ONE continuous string (not word-by-word) const searchResults = allColleges.filter(college => { const collegeName = college.name.toLowerCase(); const district = college.district.toLowerCase(); const state = college.state.toLowerCase(); // Check if the complete search term exists as continuous string return collegeName.includes(searchTerm) || district.includes(searchTerm) || state.includes(searchTerm); }); // Sort alphabetically by college name (A-Z) searchResults.sort((a, b) => a.name.localeCompare(b.name)); return searchResults.slice(0, 100); // Limit to 100 results } // Highlight matching text - Continuous string highlighting function highlightMatch(text, query) { if (!query) return text; const searchTerm = query.trim(); if (searchTerm.length < 2) return text; // Highlight the complete continuous string (like Ctrl+F) const regex = new RegExp(`(${escapeRegex(searchTerm)})`, 'gi'); return text.replace(regex, '<span class="highlight-match">$1</span>'); } // Escape regex special characters function escapeRegex(str) { return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); } // Display college suggestions function displayCollegeSuggestions(colleges, query) { const suggestionsDiv = document.getElementById('collegeSuggestions'); const inputField = document.getElementById('institution_name'); // Store results globally for selection currentSearchResults = colleges; if (colleges.length === 0) { if (query.length >= 2) { suggestionsDiv.innerHTML = '<div class="no-colleges-found"><i class="fas fa-search"></i> No colleges found matching your search</div>'; suggestionsDiv.classList.add('show'); inputField.classList.add('has-suggestions'); } else { suggestionsDiv.classList.remove('show'); inputField.classList.remove('has-suggestions'); } return; } let html = `<div class="college-count"> <i class="fas fa-graduation-cap"></i> ${colleges.length} college${colleges.length > 1 ? 's' : ''} found </div>`; colleges.forEach((college, index) => { const highlightedName = highlightMatch(college.name, query); const highlightedDistrict = highlightMatch(college.district, query); const highlightedState = highlightMatch(college.state, query); html += ` <div class="college-suggestion-item" data-index="${index}" onclick="selectCollege(${index})"> <div class="college-name">${highlightedName}</div> <div class="college-details"> <span class="college-district"><i class="fas fa-map-marker-alt"></i> ${highlightedDistrict}, ${highlightedState}</span> </div> </div> `; }); suggestionsDiv.innerHTML = html; suggestionsDiv.classList.add('show'); inputField.classList.add('has-suggestions'); currentHighlightIndex = -1; } // Select a college from suggestions function selectCollege(index) { if (currentSearchResults[index]) { const college = currentSearchResults[index]; document.getElementById('institution_name').value = college.name; hideCollegeSuggestions(); } } // Hide suggestions function hideCollegeSuggestions() { const suggestionsDiv = document.getElementById('collegeSuggestions'); const inputField = document.getElementById('institution_name'); setTimeout(() => { suggestionsDiv.classList.remove('show'); inputField.classList.remove('has-suggestions'); }, 200); } // Navigate suggestions with keyboard function navigateCollegeSuggestions(direction) { const items = document.querySelectorAll('.college-suggestion-item'); if (items.length === 0) return; // Remove previous highlight if (currentHighlightIndex >= 0 && items[currentHighlightIndex]) { items[currentHighlightIndex].classList.remove('highlighted'); } // Update index if (direction === 'down') { currentHighlightIndex = (currentHighlightIndex + 1) % items.length; } else if (direction === 'up') { currentHighlightIndex = currentHighlightIndex <= 0 ? items.length - 1 : currentHighlightIndex - 1; } // Add new highlight if (items[currentHighlightIndex]) { items[currentHighlightIndex].classList.add('highlighted'); items[currentHighlightIndex].scrollIntoView({ block: 'nearest', behavior: 'smooth' }); } } // Setup college autocomplete event listeners function setupCollegeAutocomplete() { const collegeField = document.getElementById('institution_name'); const autocompleteWrapper = document.getElementById('college_autocomplete_wrapper'); collegeField.addEventListener('input', function() { // Only show suggestions if autocomplete is enabled (College is selected) if (autocompleteWrapper.getAttribute('data-autocomplete') !== 'enabled') { hideCollegeSuggestions(); return; } const query = this.value.trim(); if (query.length >= 2) { const results = searchColleges(query); displayCollegeSuggestions(results, query); } else { hideCollegeSuggestions(); } }); collegeField.addEventListener('focus', function() { // Only show suggestions if autocomplete is enabled (College is selected) if (autocompleteWrapper.getAttribute('data-autocomplete') !== 'enabled') { return; } const query = this.value.trim(); if (query.length >= 2) { const results = searchColleges(query); displayCollegeSuggestions(results, query); } }); collegeField.addEventListener('blur', function() { hideCollegeSuggestions(); }); // Keyboard navigation collegeField.addEventListener('keydown', function(e) { // Only enable keyboard navigation if autocomplete is enabled (College is selected) if (autocompleteWrapper.getAttribute('data-autocomplete') !== 'enabled') { return; } const suggestionsDiv = document.getElementById('collegeSuggestions'); if (!suggestionsDiv.classList.contains('show')) return; if (e.key === 'ArrowDown') { e.preventDefault(); navigateCollegeSuggestions('down'); } else if (e.key === 'ArrowUp') { e.preventDefault(); navigateCollegeSuggestions('up'); } else if (e.key === 'Enter') { e.preventDefault(); if (currentHighlightIndex >= 0) { selectCollege(currentHighlightIndex); } } else if (e.key === 'Escape') { hideCollegeSuggestions(); } }); // Click outside to close document.addEventListener('click', function(e) { if (!e.target.closest('.college-autocomplete-wrapper')) { hideCollegeSuggestions(); } }); } // ========== END COLLEGE AUTOCOMPLETE ========== // Dynamically set class/year options based on institution type function setClassOptions(type) { const classSelect = document.getElementById('class'); const classLabel = document.getElementById('class_label'); if (!classSelect) return; // Clear existing options while (classSelect.firstChild) { classSelect.removeChild(classSelect.firstChild); } // Add placeholder const placeholder = document.createElement('option'); placeholder.value = ''; placeholder.textContent = type === 'College' ? 'Select Current Year' : 'Select Class'; classSelect.appendChild(placeholder); if (type === 'College') { classLabel.innerHTML = 'Current Year <span class="required">*</span>'; ['First Year','Second Year','Third Year','Fourth Year'].forEach(function(opt){ const o = document.createElement('option'); o.value = opt; o.textContent = opt; classSelect.appendChild(o); }); } else { classLabel.innerHTML = 'Class <span class="required">*</span>'; ['11th','12th'].forEach(function(opt){ const o = document.createElement('option'); o.value = opt; o.textContent = opt; classSelect.appendChild(o); }); } } // Update document requirements based on grade level and institution type function updateDocumentRequirements() { const institutionType = document.getElementById('institution_type').value; const classValue = document.getElementById('class').value; const admissionProofField = document.getElementById('admission_proof_field'); const admissionProofLabel = document.getElementById('admission_proof_label'); const admissionProofHelp = document.getElementById('admission_proof_help'); const feeReceiptLabel = document.getElementById('fee_receipt_label'); const feeReceiptHelp = document.getElementById('fee_receipt_help'); const twelfthMarksheetField = document.getElementById('twelfth_marksheet_field'); const twelfthMarksheetLabel = document.getElementById('twelfth_marksheet_label'); const twelfthMarksheetHelp = document.getElementById('twelfth_marksheet_help'); const tenthMarksheetField = document.getElementById('tenth_marksheet_field'); const lastExamPercentageLabel = document.getElementById('last_exam_percentage_label'); const lastExamPercentageHelp = document.getElementById('last_exam_percentage_help'); const lastExamPercentageInput = document.getElementById('last_exam_percentage'); if (institutionType === 'School') { // For school students (grade 11-12) - Need 10th marksheet, no admission proof admissionProofField.style.display = 'none'; document.getElementById('admission_proof').required = false; feeReceiptLabel.innerHTML = 'School Fee Receipt <span class="required">*</span>'; feeReceiptHelp.textContent = 'Upload school fee receipt'; twelfthMarksheetField.style.display = 'none'; tenthMarksheetField.style.display = 'block'; document.getElementById('twelfth_marksheet').required = false; document.getElementById('tenth_marksheet').required = true; // Show percentage field for school students (only percentage) document.getElementById('last_exam_percentage_field').style.display = 'block'; lastExamPercentageLabel.innerHTML = 'Last Year Percentage <span class="required">*</span>'; lastExamPercentageHelp.textContent = 'Enter your last year exam percentage'; lastExamPercentageInput.placeholder = 'प्रतिशत दर्ज करें (जैसे, 85%)'; lastExamPercentageInput.required = true; } else if (institutionType === 'College') { // For college students (grade 11-12) - Need 10th and 12th marksheet admissionProofField.style.display = 'block'; admissionProofLabel.innerHTML = 'Previous Exam Marksheet <span class="required">*</span>'; admissionProofHelp.textContent = 'Upload previous exam marksheet'; document.getElementById('admission_proof').required = true; feeReceiptLabel.innerHTML = 'College Fee Receipt <span class="required">*</span>'; feeReceiptHelp.textContent = 'Upload college fee receipt'; twelfthMarksheetField.style.display = 'block'; twelfthMarksheetLabel.innerHTML = '12th Marksheet <span class="required">*</span>'; twelfthMarksheetHelp.textContent = 'Upload 12th standard marksheet'; tenthMarksheetField.style.display = 'block'; document.getElementById('twelfth_marksheet').required = true; document.getElementById('tenth_marksheet').required = true; // Show percentage field for college students (percentage/CGPA/SGPA) document.getElementById('last_exam_percentage_field').style.display = 'block'; lastExamPercentageLabel.innerHTML = 'Last Year Percentage/CGPA/SGPA <span class="required">*</span>'; lastExamPercentageHelp.textContent = 'Enter your last year exam percentage, CGPA, or SGPA'; lastExamPercentageInput.placeholder = 'प्रतिशत दर्ज करें (जैसे, 85%) या CGPA (जैसे, 8.5) या SGPA (जैसे, 8.2)'; lastExamPercentageInput.required = true; } else { // Default state admissionProofField.style.display = 'block'; admissionProofLabel.innerHTML = 'Admission Proof <span class="required">*</span>'; admissionProofHelp.textContent = 'Upload admission letter or college ID'; document.getElementById('admission_proof').required = true; feeReceiptLabel.innerHTML = 'Fee Receipt/Enrollment Proof <span class="required">*</span>'; feeReceiptHelp.textContent = 'Upload fee receipt or enrollment certificate'; twelfthMarksheetField.style.display = 'none'; tenthMarksheetField.style.display = 'block'; document.getElementById('twelfth_marksheet').required = false; document.getElementById('tenth_marksheet').required = true; // Hide percentage field by default document.getElementById('last_exam_percentage_field').style.display = 'none'; lastExamPercentageInput.required = false; } } // Class change handler for school students document.getElementById('class').addEventListener('change', function() { updateDocumentRequirements(); }); // Address method toggle // Pincode auto-fill function function fillLocationFromPincode() { const pincode = document.getElementById('pincode').value; if (pincode.length === 6) { const location = getLocationByPincode(pincode); if (location) { document.getElementById('state').value = location.state; document.getElementById('district').value = location.district; document.getElementById('city').value = location.city; } else { alert('Pincode not found. Please enter a valid 6-digit pincode.'); // Clear fields if pincode not found document.getElementById('state').value = ''; document.getElementById('district').value = ''; document.getElementById('city').value = ''; } } } // Reset scholarship dropdown to show all options function resetScholarshipDropdown() { const schemeSelect = document.getElementById('scheme_name'); const statusDiv = document.getElementById('auto-selection-status'); if (!schemeSelect) { return; } const options = schemeSelect.querySelectorAll('option'); // Show all options options.forEach(option => { option.style.display = 'block'; option.disabled = false; option.style.color = ''; }); // Reset dropdown styling schemeSelect.style.backgroundColor = ''; schemeSelect.style.borderColor = ''; schemeSelect.style.cursor = ''; schemeSelect.value = ''; // Hide status if (statusDiv) { statusDiv.style.display = 'none'; } } // Auto-select scholarship type based on age, gender, and category function autoSelectScholarship() { const genderField = document.getElementById('gender'); const categoryField = document.getElementById('category'); const schemeSelect = document.getElementById('scheme_name'); const helpText = document.getElementById('scholarship-help'); const dobField = document.getElementById('dob'); const ageField = document.getElementById('age'); // Check if elements exist if (!genderField || !categoryField || !schemeSelect) { return; } const gender = genderField.value; const category = categoryField.value; const dob = dobField ? dobField.value : ''; // Calculate age from DOB let age = 0; if (dob) { const dobDate = new Date(dob); const today = new Date(); age = today.getFullYear() - dobDate.getFullYear(); if (ageField) { ageField.value = age; } } // Only proceed if we have minimum required data if (gender && category) { // Reset dropdown first resetScholarshipDropdown(); let selectedScheme = ''; let reason = ''; if (age < 18) { selectedScheme = 'Book Allowance'; reason = 'Auto-selected: Book Allowance'; } else if (gender === 'Female' && ['SC', 'ST', 'OBC'].includes(category)) { selectedScheme = 'Udaan Scholarship'; reason = 'Auto-selected: Udaan Scholarship'; } else if (category === 'GEN') { selectedScheme = 'Shiksha Sahara'; reason = 'Auto-selected: Shiksha Sahara'; } else if (gender === 'Male' && ['OBC', 'SC', 'ST'].includes(category)) { selectedScheme = 'Samaan Shiksha'; reason = 'Auto-selected: Samaan Shiksha'; } else { selectedScheme = 'Udaan Scholarship'; reason = 'Auto-selected: Udaan Scholarship'; } // Select the scholarship schemeSelect.value = selectedScheme; // Hide all other options and show only the selected one const options = schemeSelect.querySelectorAll('option'); options.forEach(option => { if (option.value && option.value !== selectedScheme) { option.style.display = 'none'; } }); // Style the dropdown to show it's auto-selected schemeSelect.style.backgroundColor = '#e8f5e8'; schemeSelect.style.borderColor = '#28a745'; // Show auto-selection status const statusDiv = document.getElementById('auto-selection-status'); if (statusDiv) { statusDiv.style.display = 'block'; } if (helpText) { helpText.textContent = reason; helpText.style.color = '#28a745'; helpText.style.fontWeight = 'bold'; } } } // Event listeners for auto-selection - with error handling function addEventListeners() { const ageField = document.getElementById('age'); const genderField = document.getElementById('gender'); const categoryField = document.getElementById('category'); const dobField = document.getElementById('dob'); if (ageField) { ageField.addEventListener('input', autoSelectScholarship); } if (genderField) { genderField.addEventListener('change', autoSelectScholarship); genderField.addEventListener('blur', autoSelectScholarship); } if (categoryField) { categoryField.addEventListener('change', autoSelectScholarship); categoryField.addEventListener('blur', autoSelectScholarship); } if (dobField) { dobField.addEventListener('change', function() { autoSelectScholarship(); }); } } // Initialize everything on page load document.addEventListener('DOMContentLoaded', function() { // Restore saved form data first (before other initializations) const dataRestored = restoreFormData(); // Setup auto-save functionality setupAutoSave(); // Add event listeners addEventListeners(); setupDOBListener(); showReceiptIfNeeded(); // Initialize college autocomplete loadColleges(); setupCollegeAutocomplete(); // Initialize class/year options and document requirements const initType = document.getElementById('institution_type').value; if (initType === 'School' || initType === 'College') { setClassOptions(initType); document.getElementById('class_field').style.display = 'block'; } updateDocumentRequirements(); // Run auto-selection once autoSelectScholarship(); // Set English as default language switchLanguage('english'); document.getElementById('englishBtn').classList.add('active'); document.getElementById('hindiBtn').classList.remove('active'); // Format Aadhaar number (XXXX XXXX XXXX) const aadharInput = document.getElementById('aadhar_number'); if (aadharInput) { aadharInput.addEventListener('input', function(e) { let value = e.target.value.replace(/\s/g, '').replace(/\D/g, ''); if (value.length > 0) { value = value.match(/.{1,4}/g).join(' '); e.target.value = value; } }); } }); // Show receipt popup if application was just submitted function showReceiptIfNeeded() { const urlParams = new URLSearchParams(window.location.search); if (urlParams.get('success') === '1') { setTimeout(function() { document.getElementById('receiptPopup').classList.add('show'); }, 500); } } // Close receipt popup function closeReceipt() { document.getElementById('receiptPopup').classList.remove('show'); } // Pincode function now loaded from external pincode_database.js file // Contains 19,586 pincodes from official India Post data // Calculate age from DOB and trigger auto-selection function setupDOBListener() { const dobField = document.getElementById('dob'); if (dobField) { dobField.addEventListener('change', function() { const dob = new Date(this.value); const today = new Date(); const age = today.getFullYear() - dob.getFullYear(); const ageField = document.getElementById('age'); if (ageField) { ageField.value = age; } // Trigger auto-selection immediately autoSelectScholarship(); }); // Trigger on input for immediate response dobField.addEventListener('input', function() { if (this.value.length === 10) { // Full date entered const dob = new Date(this.value); const today = new Date(); const age = today.getFullYear() - dob.getFullYear(); const ageField = document.getElementById('age'); if (ageField) { ageField.value = age; } autoSelectScholarship(); } }); } } // File upload handling with INSTANT AJAX UPLOAD + PROGRESS (Individual per document) // Enhanced with better error handling and timeout management const documentFields = ['aadhar_front', 'aadhar_back', 'caste_certificate', 'income_proof', 'domicile_certificate', 'tenth_marksheet', 'twelfth_marksheet', 'admission_proof', 'fee_receipt', 'bank_passbook', 'live_photo']; documentFields.forEach(fieldName => { const fileInput = document.getElementById(fieldName); if (fileInput) { fileInput.addEventListener('change', function(e) { const file = e.target.files[0]; const textElement = document.getElementById(fieldName + '_text'); if (!textElement) { console.error('Text element not found for:', fieldName); return; } const displayElement = textElement.parentElement; const progressElement = document.getElementById(fieldName + '_progress'); const statusElement = document.getElementById(fieldName + '_status'); const barElement = document.getElementById(fieldName + '_bar'); const percentElement = document.getElementById(fieldName + '_percent'); if (file) { // Check if it's an image const fileExt = file.name.split('.').pop().toLowerCase(); const allowedExts = ['jpg', 'jpeg', 'png', 'gif']; if (!allowedExts.includes(fileExt)) { alert('❌ Only image files (JPG, PNG, GIF) are allowed!\n\nPDF and video files are not accepted.\n\nPlease select an image file.'); fileInput.value = ''; return; } // Get file size in MB const fileSizeMB = (file.size / (1024 * 1024)).toFixed(2); console.log('Upload started for: ' + fieldName + ', Size: ' + fileSizeMB + ' MB'); // Show loader with file size if (progressElement) { progressElement.classList.add('show'); console.log('Progress element shown for: ' + fieldName); } if (barElement) barElement.style.width = '0%'; if (percentElement) percentElement.textContent = '0%'; if (statusElement) statusElement.textContent = 'File: ' + fileSizeMB + ' MB - Uploading...'; // Upload file via XMLHttpRequest for progress tracking const formData = new FormData(); formData.append('document', file); formData.append('field_name', fieldName); const xhr = new XMLHttpRequest(); let uploadedMB = 0; // Add timeout to prevent hanging requests xhr.timeout = 120000; // 2 minutes timeout // Track upload progress xhr.upload.addEventListener('progress', function(e) { if (e.lengthComputable) { const percentComplete = Math.round((e.loaded / e.total) * 100); uploadedMB = (e.loaded / (1024 * 1024)).toFixed(2); console.log(fieldName + ' upload progress: ' + percentComplete + '%'); if (barElement) { barElement.style.width = percentComplete + '%'; barElement.classList.add('animated'); } if (percentElement) percentElement.textContent = percentComplete + '%'; if (statusElement) { if (percentComplete < 100) { statusElement.textContent = 'Uploaded: ' + uploadedMB + ' MB / ' + fileSizeMB + ' MB'; } } } }); // When upload finishes, show conversion message xhr.upload.addEventListener('load', function() { console.log(fieldName + ' upload complete! Converting to WebP format...'); if (barElement) barElement.style.width = '100%'; if (percentElement) percentElement.textContent = '100%'; if (statusElement) statusElement.textContent = 'Upload complete! Converting to WebP...'; }); // Handle completion xhr.addEventListener('load', function() { console.log(fieldName + ' server response received, status: ' + xhr.status); if (xhr.status === 200) { try { const data = JSON.parse(xhr.responseText); console.log(fieldName + ' response data:', data); if (data.success) { // Update to show final completion status if (barElement) barElement.style.width = '100%'; if (percentElement) percentElement.textContent = '100%'; if (statusElement) statusElement.textContent = '✅ Complete! ' + fileSizeMB + ' MB → WebP (' + data.webp_size + ' KB)'; console.log(fieldName + ' conversion complete, hiding immediately...'); // Hide immediately and show file name if (progressElement) progressElement.classList.remove('show'); if (textElement) textElement.innerHTML = '<span class="file-name">✅ ' + file.name + ' → ' + data.webp_size + ' KB (WebP)</span>'; if (displayElement) displayElement.classList.add('has-file'); } else { console.error(fieldName + ' upload failed:', data.message); if (progressElement) progressElement.classList.remove('show'); alert('❌ Upload failed: ' + data.message); fileInput.value = ''; } } catch (error) { console.error(fieldName + ' JSON parse error:', error); if (progressElement) progressElement.classList.remove('show'); alert('❌ Upload error. Please try again.'); fileInput.value = ''; } } else { console.error(fieldName + ' HTTP error:', xhr.status); if (progressElement) progressElement.classList.remove('show'); alert('❌ Upload failed. Please try again.'); fileInput.value = ''; } }); // Handle errors xhr.addEventListener('error', function() { if (progressElement) progressElement.classList.remove('show'); alert('❌ Network error. Please check your connection.'); fileInput.value = ''; }); // Handle timeout xhr.addEventListener('timeout', function() { if (progressElement) progressElement.classList.remove('show'); alert('❌ Upload timed out. Please try again with a better internet connection.'); fileInput.value = ''; }); // Send request xhr.open('POST', 'upload_document_main.php', true); xhr.send(formData); } else { if (textElement) textElement.textContent = 'Click to select file'; if (displayElement) displayElement.classList.remove('has-file'); } }); } }); // Form submission document.getElementById('applicationForm').addEventListener('submit', function(e) { e.preventDefault(); // Prevent default submission if (currentStep !== totalSteps) { alert('Please complete all steps before submitting'); // Hide loader if it was shown document.getElementById('page-loader').style.display = 'none'; return; } if (!validateCurrentStep()) { console.log('Validation failed'); // Hide loader if it was shown document.getElementById('page-loader').style.display = 'none'; return; } // Get bank account details for verification const accountNumber = document.getElementById('account_number').value.trim(); const ifscCode = document.getElementById('ifsc_code').value.trim().toUpperCase(); // Update IFSC code field with uppercase value document.getElementById('ifsc_code').value = ifscCode; // Show loader document.getElementById('page-loader').style.display = 'flex'; // Verify bank account before submitting fetch('scholar/ajax/check_verified_account.php', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, body: 'account_number=' + encodeURIComponent(accountNumber) + '&ifsc_code=' + encodeURIComponent(ifscCode) }) .then(response => response.json()) .then(data => { if (data.success) { if (data.verified) { // Account verified, proceed with form submission submitForm(); } else { // Account not verified, show error document.getElementById('page-loader').style.display = 'none'; alert('Verification failed. Account number and IFSC code do not match any verified accounts in our database. Please check your details and try again.'); } } else { // Error occurred during verification document.getElementById('page-loader').style.display = 'none'; alert('An error occurred during account verification: ' + data.message); } }) .catch(error => { console.error('Verification error:', error); document.getElementById('page-loader').style.display = 'none'; alert('An error occurred during account verification. Please try again or contact support.'); }); }); // Function to submit the form after verification function submitForm() { // Disable submit button to prevent double submission const submitBtn = document.getElementById('submitBtn'); if (submitBtn) { submitBtn.disabled = true; submitBtn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> Submitting...'; } // Clear saved form data before submission (will be cleared after successful submission) // We'll clear it here to prevent issues if submission fails // Debug: Log form data before submission (only in console) const formData = new FormData(document.getElementById('applicationForm')); console.log('Form data being submitted:'); for (let [key, value] of formData.entries()) { console.log(key, value); } // Submit form immediately (documents already uploaded via AJAX) try { // Clear form data on successful submission clearFormData(); document.getElementById('applicationForm').submit(); } catch (submitError) { console.error('Form submission error:', submitError); const lang = typeof currentLanguage !== 'undefined' ? currentLanguage : 'english'; const message = lang === 'hindi' ? 'आवेदन जमा करने में समस्या आई। कृपया पुनः प्रयास करें या तकनीकी अधिकारी से संपर्क करें: 7772056856' : 'Form submission failed. Please try again or contact support at 7772056856'; alert(message); document.getElementById('page-loader').style.display = 'none'; if (submitBtn) { submitBtn.disabled = false; submitBtn.innerHTML = '<i class="fas fa-paper-plane"></i> <span data-hindi="आवेदन जमा करें" data-english="Submit Application">Submit Application</span>'; } } } // Font size functionality const fontSmallBtn = document.getElementById('fontSmall'); const fontNormalBtn = document.getElementById('fontNormal'); const fontLargeBtn = document.getElementById('fontLarge'); fontSmallBtn.addEventListener('click', (e) => { e.preventDefault(); document.body.style.fontSize = '14px'; updateFontButtons('small'); }); fontNormalBtn.addEventListener('click', (e) => { e.preventDefault(); document.body.style.fontSize = '16px'; updateFontButtons('normal'); }); fontLargeBtn.addEventListener('click', (e) => { e.preventDefault(); document.body.style.fontSize = '18px'; updateFontButtons('large'); }); function updateFontButtons(active) { // Remove active class from all font buttons fontSmallBtn.classList.remove('active'); fontNormalBtn.classList.remove('active'); fontLargeBtn.classList.remove('active'); // Add active class to selected button if (active === 'small') { fontSmallBtn.classList.add('active'); } else if (active === 'normal') { fontNormalBtn.classList.add('active'); } else if (active === 'large') { fontLargeBtn.classList.add('active'); } } // Language switching functionality let currentLanguage = 'english'; function switchLanguage(language) { currentLanguage = language; const elements = document.querySelectorAll('[data-hindi][data-english]'); elements.forEach(element => { if (language === 'hindi') { element.innerHTML = element.getAttribute('data-hindi'); } else { element.innerHTML = element.getAttribute('data-english'); } }); // Special handling for support line with phone link const supportLine = document.querySelector('.support-line span'); if (supportLine) { if (language === 'hindi') { supportLine.innerHTML = 'आवेदन फॉर्म जमा करने में कोई परेशानी या दिक्कत आए तो हमारे तकनीकी अधिकारी से निःशुल्क संपर्क कर सकते हैं। किसी भी तरह के सुझाव व जानकारी के लिए <a href="tel:7772056856">7772056856</a> पर कॉल या व्हाट्सऐप करके अपनी क्वेरी बताएं'; } else { supportLine.innerHTML = 'If you face any difficulty or problem while submitting the application form, you can contact our technical officer for free. For any kind of suggestion or information, call or WhatsApp on <a href="tel:7772056856">7772056856</a> and share your query'; } } // Update placeholders based on language updatePlaceholders(language); } function updatePlaceholders(language) { const placeholders = { 'pincode': { hindi: '6-अंकीय पिनकोड दर्ज करें', english: 'Enter 6-digit pincode' }, 'annual_school_fees': { hindi: 'वार्षिक शुल्क दर्ज करें', english: 'Enter annual fees' }, 'annual_college_fees': { hindi: 'वार्षिक शुल्क दर्ज करें', english: 'Enter annual fees' }, 'last_exam_percentage': { hindi: 'प्रतिशत दर्ज करें (जैसे, 85%)', english: 'Enter percentage (e.g., 85%)' }, 'course': { hindi: 'जैसे, B.Tech, B.A, B.Sc', english: 'e.g., B.Tech, B.A, B.Sc' } }; Object.keys(placeholders).forEach(fieldId => { const field = document.getElementById(fieldId); if (field) { field.placeholder = language === 'hindi' ? placeholders[fieldId].hindi : placeholders[fieldId].english; } }); } document.getElementById('hindiBtn').addEventListener('click', (e) => { e.preventDefault(); document.getElementById('hindiBtn').classList.add('active'); document.getElementById('englishBtn').classList.remove('active'); switchLanguage('hindi'); }); document.getElementById('englishBtn').addEventListener('click', (e) => { e.preventDefault(); document.getElementById('englishBtn').classList.add('active'); document.getElementById('hindiBtn').classList.remove('active'); switchLanguage('english'); }); // Help functionality const helpBtn = document.getElementById('helpBtn'); const helpModal = document.getElementById('helpModal'); const closeHelp = document.getElementById('closeHelp'); const policyModals = { termsModal: document.getElementById('termsModal'), privacyModal: document.getElementById('privacyModal') }; function anyPolicyModalOpen() { return Object.values(policyModals).some(modal => modal && modal.style.display === 'block'); } function openHelpModal() { if (!helpModal) return; helpModal.style.display = 'block'; document.body.style.overflow = 'hidden'; // Prevent background scrolling } function closeHelpModal() { if (!helpModal) return; helpModal.style.display = 'none'; if (!anyPolicyModalOpen()) { document.body.style.overflow = 'auto'; // Restore scrolling when no other modal is open } } function openPolicyModal(id) { const modal = policyModals[id]; if (!modal) return; modal.style.display = 'block'; document.body.style.overflow = 'hidden'; } function closePolicyModal(id) { const modal = policyModals[id]; if (!modal) return; modal.style.display = 'none'; if (!anyPolicyModalOpen() && (!helpModal || helpModal.style.display !== 'block')) { document.body.style.overflow = 'auto'; } } // Desktop help button if (helpBtn) { helpBtn.addEventListener('click', (e) => { e.preventDefault(); openHelpModal(); }); } // Close modal when clicking X if (closeHelp) { closeHelp.addEventListener('click', closeHelpModal); } document.querySelectorAll('.policy-link').forEach(link => { link.addEventListener('click', (e) => { e.preventDefault(); const target = link.getAttribute('data-modal-target'); if (target) { openPolicyModal(target); } }); }); document.querySelectorAll('.policy-close').forEach(btn => { btn.addEventListener('click', () => { const target = btn.getAttribute('data-close-modal'); if (target) { closePolicyModal(target); } }); }); // Close modal when clicking outside window.addEventListener('click', (e) => { if (helpModal && e.target === helpModal) { closeHelpModal(); } Object.values(policyModals).forEach(modal => { if (modal && e.target === modal) { closePolicyModal(modal.id); } }); }); // Close modal with Escape key document.addEventListener('keydown', (e) => { if (e.key === 'Escape') { if (helpModal && helpModal.style.display === 'block') { closeHelpModal(); } Object.values(policyModals).forEach(modal => { if (modal && modal.style.display === 'block') { closePolicyModal(modal.id); } }); } }); </script> </body> </html>
Save
cmd:
run