/home/u764571690/domains/savitrfoundation.com/public_html/scholar/pages
Edit: /home/u764571690/domains/savitrfoundation.com/public_html/scholar/pages/ack.php (25283B)
'/',
'domain' => '', // Empty for localhost compatibility
'secure' => false, // Allow HTTP for localhost
'httponly' => true,
'samesite' => 'Lax',
'lifetime' => 2592000 // 30 days cookie lifetime
]);
session_start();
}
// Correct path to db.php
require_once __DIR__ . '/../db.php';
// ✅ PERFORMANCE: Local cache class for pages/cache directory
class LocalSimpleCache extends SimpleCache {
private static $cacheDir = __DIR__ . '/cache';
private static $defaultTTL = 300;
public static function init() {
if (!file_exists(self::$cacheDir)) {
@mkdir(self::$cacheDir, 0755, true);
}
}
public static function get($key) {
self::init();
$file = self::$cacheDir . '/' . md5($key) . '.cache';
if (!file_exists($file)) return false;
$data = @unserialize(file_get_contents($file));
if ($data === false) return false;
if (time() > $data['expires']) {
@unlink($file);
return false;
}
return $data['value'];
}
public static function set($key, $value, $ttl = null) {
self::init();
$ttl = $ttl ?? self::$defaultTTL;
$file = self::$cacheDir . '/' . md5($key) . '.cache';
$data = ['value' => $value, 'expires' => time() + $ttl, 'created' => time()];
$fp = @fopen($file, 'c+');
if ($fp === false) return @file_put_contents($file, serialize($data)) !== false;
$lockAcquired = false;
for ($i = 0; $i < 10; $i++) {
if (flock($fp, LOCK_EX | LOCK_NB)) {
$lockAcquired = true;
break;
}
usleep(500000);
}
if ($lockAcquired) {
ftruncate($fp, 0);
fwrite($fp, serialize($data));
flock($fp, LOCK_UN);
fclose($fp);
return true;
} else {
fclose($fp);
return @file_put_contents($file, serialize($data)) !== false;
}
}
public static function delete($key) {
self::init();
$file = self::$cacheDir . '/' . md5($key) . '.cache';
return @unlink($file);
}
}
if (!isset($_SESSION['user_logged_in']) || $_SESSION['user_logged_in'] !== true) {
header('Location: ../student');
exit();
}
$applicantId = (int)($_SESSION['applicant_id'] ?? 0);
$userId = $_SESSION['user_id'] ?? '';
$userName = $_SESSION['user_name'] ?? 'Student';
try {
// ✅ PERFORMANCE: Cache acknowledgment data for 5 minutes (rarely changes)
$ackCacheKey = 'ack_data_' . $applicantId;
$applicant = LocalSimpleCache::get($ackCacheKey);
if ($applicant === false) {
// ✅ OPTIMIZED: Single query to fetch applicant and user data together
$stmt = $pdo->prepare("
SELECT
a.*,
u.user_id,
u.bank_verified
FROM applicants a
LEFT JOIN users u ON a.applicant_id = u.applicant_id
WHERE a.applicant_id = ?
LIMIT 1
");
$stmt->execute([$applicantId]);
$applicant = $stmt->fetch(PDO::FETCH_ASSOC);
if ($applicant) {
LocalSimpleCache::set($ackCacheKey, $applicant, 300); // Cache for 5 minutes
}
}
if (!$applicant) {
throw new Exception('Application not found');
}
$bankVerified = $applicant['bank_verified'] ?? null;
$scholarId = $applicant['user_id'] ?? ($_SESSION['user_id'] ?? '');
// ✅ OPTIMIZED: Fetch only recent documents with limit
$docStmt = $pdo->prepare("SELECT * FROM documents WHERE applicant_id = ? ORDER BY uploaded_at DESC LIMIT 20");
$docStmt->execute([$applicantId]);
$documents = $docStmt->fetchAll(PDO::FETCH_ASSOC);
} catch (Exception $e) {
$error_message = $e->getMessage();
}
?>
Acknowledgment - Student Dashboard - Savitr Foundation Scholarship
Welcome,
Scholar ID:
Print / Download PDF
Acknowledgment No. / Form No.:
Date:
This is to acknowledge that (आवेदक का नाम)
has submitted the application form for the
(Scholarship Name / छात्रवृत्ति का नाम) on the above-mentioned date.
Submitted Documents (जमा किए गए दस्तावेज़)
'Application Form (आवेदन पत्र)',
'aadhar_front' => 'Aadhar Card (आधार कार्ड)',
'aadhar_back' => 'Aadhar Card Back (आधार कार्ड बैक)',
'caste_certificate' => 'Caste Certificate (जाति प्रमाण पत्र)',
'income_proof' => 'Income Proof (आय प्रमाण)',
'domicile_certificate' => 'Domicile Certificate (निवास प्रमाण पत्र)',
'tenth_marksheet' => '10th Marksheet (10वीं मार्कशीट)',
'twelfth_marksheet' => '12th Marksheet (12वीं मार्कशीट)',
'admission_proof' => 'Admission Proof (प्रवेश प्रमाण)',
'fee_receipt' => 'Fee Receipt (शुल्क रसीद)',
'bank_passbook' => 'Passbook / Cheque (पासबुक / चेक)',
'live_photo' => 'Live Photo (लाइव फोटो)'
];
foreach ($docLabels as $key => $label) {
$checked = ($key === 'application_form') ? '☑' : (in_array($key, $submittedDocs) ? '☑' : '☐');
echo '
'.$checked.' '.$label.'
';
}
?>
note: current academic year result will be submitted soon with acknowledgment copy
Applicant Details
Full Name
Date of Birth
Gender
Category
Mobile
Institute Details
Institution Type
Institution Name
Class/Year
Course
Academic Year
Scholarship
Important Instructions / महत्वपूर्ण निर्देश
शिक्षा स्तर: आप 11वीं कक्षा से लेकर पीएचडी स्तर तक किसी गैर-सरकारी संस्थान में पोस्ट-मैट्रिक शिक्षा प्राप्त कर रहे हों।
आवेदन की स्थिति की जानकारी आपको WhatsApp या ईमेल के माध्यम से मिलेगी।
समय-समय पर वेबसाइट पर आकर अपना स्टेटस चेक करते रहें।
किसी भी समस्या के लिए तकनीकी अधिकारी को बताएं।
छात्रवृत्ति के लिए अपने दोस्त और आसपास के लोगों को जागरूक करें; आपका सहयोग हमारी मदद करेगा और आपको प्राथमिकता पर रखा जाएगा।