X7ROOT File Manager
Current Path:
/home/u126090504/domains/oca.org.in/public_html
home
/
u126090504
/
domains
/
oca.org.in
/
public_html
/
📁
..
📄
.htaccess
(1.12 KB)
📄
Antiraging-Cell.php
(2.73 KB)
📄
B.Ed.&B.P.Ed.php
(4.4 KB)
📄
about-us.php
(9.01 KB)
📄
academic-head-message.php
(5.84 KB)
📄
achievers.php
(3.07 KB)
📁
admin
📄
admission.php
(5.17 KB)
📄
admission_submit.php
(1.96 KB)
📄
album.php
(890 B)
📄
computer-courses.php
(20.66 KB)
📄
config.php
(1.16 KB)
📄
contact-us.php
(14.68 KB)
📄
contactdb.php
(796 B)
📁
css
📄
director's-message.php
(5.46 KB)
📄
downloads.php
(3.14 KB)
📄
error.log
(14.6 KB)
📄
facilities.php
(7.19 KB)
📄
faculty.php
(4.96 KB)
📁
fonts
📄
footer.php
(22.79 KB)
📄
franchise.php
(2.09 KB)
📄
gallery.php
(3.21 KB)
📄
governing-body.php
(3.58 KB)
📄
grievance-form.php
(13.71 KB)
📄
header.php
(15 KB)
📁
images
📄
index.php
(63.18 KB)
📁
js
📁
lib
📁
ocabdk
📄
ocabdk.zip
(63.02 MB)
📄
our-recruiters.php
(2.77 KB)
📄
payment.php
(8.1 KB)
📄
payment_submit.php
(10.97 KB)
📄
payment_verify.php
(2.31 KB)
📄
peret.php
(266.87 KB)
📄
placement.php
(8.33 KB)
📄
principal's-message.php
(6.02 KB)
📁
qrcodes
📁
revolution
📄
scope.php
(14.14 KB)
📄
search_videos.php
(1.76 KB)
📄
submit-grievance.php
(3.88 KB)
📄
thank-you.php
(1.28 KB)
📄
tutorial.php
(4.81 KB)
📄
u126090504_mmabpd.sql
(44.65 KB)
📁
uploads
📄
videos.php
(4.38 KB)
Editing: submit-grievance.php
<?php // --- TEMP: show errors while fixing (remove after it works) --- ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); // -------------------------------------------------------------- require_once __DIR__ . '/config.php'; if ($_SERVER['REQUEST_METHOD'] !== 'POST') { header('Location: /grievance-form.php'); exit; } function val($k){ return isset($_POST[$k]) ? trim($_POST[$k]) : ''; } // Tracking ID $tracking_id = uniqid('GRV-'); // Collect inputs (names match your form) $name = val('student_name'); $student_id = val('student_id'); $department = val('department'); $course = val('course'); $year_text = val('year_of_study'); // e.g. "1st Year" $contact = val('contact'); $email = val('email'); $hostel = (val('hostel_resident') === 'Yes') ? 'Yes' : 'No'; $pref_resp = val('preferred_response'); // Email | Phone | In-person $category = val('grievance_type'); $sub_cat = val('grievance_subtype'); $date_inc = val('date_of_incident'); // allow empty => '' $time_inc = val('time_of_incident'); // allow empty => '' $location = val('location'); $persons = val('persons_involved'); $is_conf = (isset($_POST['confidential']) && $_POST['confidential'] == '1') ? '1' : '0'; // as string $impact = val('impact_level') ?: 'Low'; $expect_time = val('expected_resolution_time') ?: '2 weeks'; $desc = val('description'); $prev = val('previous_attempts'); $desired = val('desired_outcome'); $meet_comm = 'No'; $status = 'Pending'; // Year text -> number but keep as string to avoid type issues in bind $year_map = ['1st Year'=>'1','2nd Year'=>'2','3rd Year'=>'3','4th Year'=>'4']; $year = isset($year_map[$year_text]) ? $year_map[$year_text] : '0'; // ---- File uploads (max 3, 5MB each) ---- $uploaded = []; $dir = __DIR__ . '/uploads/grievances/'; if (!is_dir($dir)) { @mkdir($dir, 0777, true); } if (!empty($_FILES['files']['name'][0])) { $allowed = ['jpg','jpeg','png','pdf','doc','docx']; foreach ($_FILES['files']['name'] as $i => $fname) { if ($i >= 3) break; // max 3 if (!isset($_FILES['files']['error'][$i]) || $_FILES['files']['error'][$i] !== UPLOAD_ERR_OK) continue; if ($_FILES['files']['size'][$i] > 5*1024*1024) continue; $ext = strtolower(pathinfo($fname, PATHINFO_EXTENSION)); if (!in_array($ext, $allowed)) continue; $new = $tracking_id . '_' . uniqid() . '.' . $ext; @move_uploaded_file($_FILES['files']['tmp_name'][$i], $dir . $new); $uploaded[] = $new; } } $files_json = json_encode($uploaded); // ---- INSERT (exact column order) ---- $sql = "INSERT INTO grievances ( tracking_id, name, student_id, department, course, year_of_study, contact, email, hostel_resident, preferred_response, category, sub_category, date_incident, time_incident, location, persons_involved, is_confidential, impact_level, expected_resolution, description, previous_attempts, desired_outcome, meet_committee, files_json, status, created_at, updated_at ) VALUES ( ?,?,?,?,?,?, ?,?, ?,?, ?,?, ?,?, ?,?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NOW(), NOW() )"; $stmt = $conn->prepare($sql); if (!$stmt) { die('Prepare failed: '.$conn->error); } // 25 placeholders → bind 25 strings (simplest & safe) $stmt->bind_param( "sssssssssssssssssssssssss", $tracking_id, $name, $student_id, $department, $course, $year, $contact, $email, $hostel, $pref_resp, $category, $sub_cat, $date_inc, $time_inc, $location, $persons, $is_conf, $impact, $expect_time, $desc, $prev, $desired, $meet_comm, $files_json, $status ); if ($stmt->execute()) { echo "<script> alert('✅ Grievance submitted!\\nTracking ID: {$tracking_id}'); location.href='grievance-form.php'; </script>"; } else { echo 'DB Error: '.$stmt->error; } $stmt->close(); $conn->close();
Upload File
Create Folder