CCT EXAMINATION – HARYANA CET OFFLINE EXAMINATION PORTAL
Version 1.0 | PHP + MySQL

WHAT THIS PACKAGE CONTAINS
- Public CCT Examination website (Haryana CET only)
- Candidate registration and login
- Candidate dashboard and application status
- Offline examination schedule and instructions
- Admin/staff dashboard
- CET exam configuration
- Examination centre management
- Application verification
- Centre, roll number and seat allocation
- Admit card / hall ticket print view
- Attendance entry (present/absent)
- Marks entry and automatic pass/fail calculation
- Public notification management
- Basic website contact settings
- Password hashing, session regeneration, CSRF protection and PDO prepared statements

INSTALLATION
1. Upload the complete CCT_Examination folder to PHP hosting (PHP 8.0+ recommended).
2. Create a MySQL database and database user in hosting control panel.
3. Import database.sql using phpMyAdmin. It creates/uses database cct_examination; edit the SQL first if your database name differs.
4. Copy config.sample.php to config.php. Add database host, database name, username and password.
5. Visit https://your-domain/CCT_Examination/index.php?page=setup
6. Create the first administrator. Setup closes automatically once an admin exists.
7. Login at index.php?page=login and configure the exam, dates, marks, fee, instructions, centres and notices.
8. Publish the exam. Candidate registration becomes available only for published exams.

OFFLINE EXAMINATION WORKFLOW
1. Admin creates a CET exam and publishes it.
2. Candidates register online and get an application number.
3. Staff verify candidate applications.
4. Admin creates examination centres and allocates centre, roll number and seat number.
5. Candidate logs in and prints the admit card.
6. Staff mark attendance on exam day.
7. Admin enters marks. Pass/fail is calculated from configured passing marks.
8. Candidate logs in to see the result.

IMPORTANT CONFIGURATION / LIMITATIONS
- This is an offline written-examination management portal, not an online CBT test engine.
- No official Haryana CET authority affiliation is implied. Use only authorized exam name, logo, content and notices.
- The package does not invent official eligibility, syllabus, exam dates, fee or reservation rules. Admin must enter verified details.
- Razorpay is not active in this first release. Application fee is stored as pending/not-required; configure and test an approved payment integration before collecting money.
- Email/SMS/OTP, photo/signature upload, bulk PDF generation, OMR scanning, question-paper upload, audit logs and advanced staff permissions are planned extensions and are not included in v1.
- Use HTTPS. Restrict access to config.php and backups. Remove database dumps from public web root after installation.
- Change the default website contact details in Admin > Website Settings.
- For a production rollout, test registration, allocation, admit card, attendance and results with dummy candidates first.

SECURITY NOTES
- Passwords are stored using PHP password_hash().
- Admin creation is allowed only while no administrator exists.
- Prepared statements and CSRF tokens are used for primary form submissions.
- Set a strong unique admin password and keep hosting/database backups.

DESIGN UPDATE
- Responsive homepage with 3-slide auto-rotating hero slider and manual controls.
- Live Notice Board placed to the right of the hero slider on desktop; stacks below on mobile.
- Latest published notice popup appears once per browser session for each latest notice and can be dismissed.
- Quick action tiles and updated candidate service cards.
- Admin console refreshed with a horizontal menu bar, active menu state, account identity block, and modern dashboard styling.
- Existing application, centre allocation, attendance and result workflows are retained.

THEME UPDATE
- Applied the supplied reference palette across the public homepage and administration panel: soft white/lavender surfaces, deep indigo headings, violet secondary elements, coral-pink actions and subtle gold highlights.
- Slider slides, notice board, popup, quick links, cards, navigation, admin statistics, forms, tables and buttons now share the same theme.


HOMEPAGE TEAM SECTION
---------------------
After uploading this update, the application creates the team_members table
automatically when the database account has CREATE TABLE permission. The first
existing administrator is promoted to the Super Admin role; other admin/staff
accounts keep their current roles. Log out and sign back in with that first
administrator account to refresh the Super Admin session.

Open Admin Panel > Team Members to add/edit member names, designations,
photographs (JPG/PNG/WebP, max 5 MB), short profiles, display order, and
activate/hide individual members. The Super Admin can switch the complete
homepage Team section ON/OFF from the same page. The section appears on the
homepage only when at least one active member exists.

For fresh installations, database.sql now includes the superadmin role and
team_members table. For existing installations, do not re-import database.sql;
the runtime migration handles the table and role update.


LATEST TEAM PAGE DESIGN UPDATE
------------------------------
The Admin > Team Members screen now uses a responsive management workspace:
member editor, photo guidance, Super Admin visibility control, member totals,
and compact photo cards with Edit / Hide-Activate / Delete actions.
On the public homepage, Meet Our Team is positioned immediately ABOVE the
Important Information for Candidates section.


HOMEPAGE MOTIVATIONAL SECTION
-----------------------------
A responsive motivational feature has been added between the Meet Our Team
section and Important Information for Candidates. It follows the existing
CCT navy, purple, pink and gold palette and does not require database changes.


SECONDARY HOMEPAGE HIGHLIGHT SLIDER
-----------------------------------
A new responsive 3-slide promotional carousel appears directly below the
main hero slider and Notice Board. It has its own text controls and three
image upload slots in Admin > Homepage Image Manager. Manage its visibility,
slide headings, descriptions, button labels and destinations in Admin >
Homepage > Secondary Highlight Slider. No database import is needed; settings
are stored in the existing settings table.


LATEST HOMEPAGE TICKER + IMAGE-ONLY SECOND SLIDER
------------------------------------------------
The second homepage slider is now image-only: slide text, CTA buttons and
overlay copy have been removed. It rotates the three images uploaded in
Admin > Homepage Image Manager (Second Slider Image 1-3). The scrolling
announcement ticker appears directly below the main hero / Notice Board row
and above the second image slider. Admin > Homepage includes a ticker ON/OFF
switch and editable ticker message. Existing settings table is used; no
database import is required.


ADMIN PANEL FIXES — SECOND SLIDER / NOTIFICATIONS / TICKER
---------------------------------------------------------
- Fixed the Homepage Image Manager setting-key mapping for Second Slider
  Image 1, 2 and 3. Each card now reads the correct stored image and its
  Upload / Replace and Remove actions use the correct settings key.
- Added a clear Save Scrolling Message & Visibility button beside the
  scrolling ticker editor. It saves the message and ticker ON/OFF control
  using the existing Homepage Settings action.
- Notification management now supports loading a notice into an Edit form,
  updating title/body/date/published status and replacing or retaining its
  PDF. Delete removes the notice and its uploaded PDF file.
No database import is required.


CET EXAMINATION EDIT / UPDATE ADMIN FEATURE
-------------------------------------------
Admin > Examinations now lists existing CET examinations with an Edit /
Update action. Selecting a record loads its current title, code, description,
date, start/end times, duration, total/passing marks, application fee,
instructions and publication status into the form. Save updates that same
record by ID; Cancel returns to the new-exam form. No database changes or
re-import are required.

CANDIDATE APPLICATION WIZARD & PIN-CODE DIRECTORY
- Candidate registration is now a three-step form: Applicant Details, Address Details, and Contact & Examination Details.
- PIN code lookup uses the location records maintained by Admin > PIN / Location Data. State and District are auto-filled; Block and Village are selected from the directory.
- The location directory is created automatically when the updated application runs (the database user must have CREATE/ALTER permissions).
- To load all-India PIN-code coverage, download the CSV template from Admin > PIN / Location Data and import a verified CSV with columns exactly: pincode,state,district,block,village. Add one row per village / PIN mapping. The included CSV is only a format example, not a complete India PIN-code database.
- Admin can add individual PIN / State / District / Block / Village records and set allowed PIN codes separately for each examination.
- For an exam with no PIN codes selected, all PIN codes present in the directory are eligible. Once one or more PIN codes are selected, only those PIN codes are eligible for that exam.
- No database re-import is required for existing installations; the updated PHP file creates the new tables and application columns automatically.

CANDIDATE REGISTRATION UPDATE (3 STEPS)
---------------------------------------
The candidate application form now has three steps:
1) Applicant and address details. PIN lookup fills State and District and loads Block / Village choices from the admin location directory.
2) Contact details. At least one of mobile number or email address is required.
3) Front and back images of the candidate's photo ID / address proof. JPG, PNG and WebP are accepted, up to 5 MB per image. On supported mobile browsers, the camera can be opened from the file chooser.

ADMIN LOCATION DIRECTORY
------------------------
Open Admin Panel > PIN / Location Data. Add each PIN code, State, District, Block and Village, or import a CSV with the exact header:
pincode,state,district,block,village
Use an official, verified India-wide dataset for bulk import. The included CSV is only a sample template and is not a complete India PIN-code database. You can select permitted PIN codes separately for each examination on the same admin page. If an exam has no selected PIN codes, the existing compatibility behaviour allows all PIN codes in the directory.

ID PROOF PRIVACY
----------------
Candidate proof images are stored under uploads/applications and protected from direct public URL access. Administrators view them from Admin Panel > Applications using the Front / Back links. Ensure the hosting account permits PHP to write to the uploads/applications folder.

Existing installations do not need a database re-import. The application adds the new proof columns and allows nullable email/mobile contact fields through its backward-compatible schema migration when the site is opened.


LATEST UPDATE — DISTRICT / BLOCK REGISTRATION (2026-11-16)
- PIN-code entry and PIN-code-based exam eligibility have been removed from candidate registration and the visible admin location panel.
- Admin Panel > District / Block Setup now lets administrators add and delete State/District and District/Block entries.
- Candidate registration now uses State, District and Block dropdowns populated from the admin-managed lists.
- Admin can separately enable/disable "Other District" and "Other Block" for each published examination. When disabled, selecting Other displays an ineligibility message and the server also rejects that choice.
- Existing PIN-code tables are retained for backward compatibility; they are no longer used to validate candidate registration.
- No database import is required. The application creates the new location master/settings tables automatically when the site loads.

ADMIT CARD PDF GENERATION
- Admin Panel now includes an Admit Cards tab.
- Select an examination and use Generate All Admit Cards – Single PDF to open all allocated candidates' cards in one print-ready document.
- Use Centre-wise Admit Card PDF to generate only candidates assigned to a selected centre.
- Each candidate admit card is formatted as a separate A4 page. In the browser print dialog, choose Save as PDF to download a combined PDF file.
- Candidates can download their individual admit card from Candidate Dashboard after both roll number and examination centre have been allotted.
- Only allocated candidates (roll number + centre) are included. No database re-import is required.


CSC OPERATOR PORTAL — /csc
--------------------------
- A separate CSC Operator registration and login portal is available at https://your-domain/csc.
- New operator accounts are created in Pending status and cannot sign in until approved by an administrator.
- Super Admin / permitted Admin > CSC Operators can approve or block operators, set the commission per successfully final-submitted form, and add wallet funds.
- An approved operator signs in at /csc and uses “Fill Candidate Registration Form”. The existing candidate application form, location validation, document upload and WhatsApp/email OTP checks are reused.
- On final submission, the candidate application fee is debited from the operator wallet and recorded in the wallet ledger. If the wallet balance is insufficient, submission is stopped before the candidate record is created.
- The administrator-configured commission is credited to the operator wallet on successful final submission. Wallet balance is calculated from immutable credit/debit ledger entries.
- The operator can use available wallet funds for subsequent candidate registration fees. Admin wallet credits are manual in this version; no online CSC wallet recharge gateway is configured.
- Runtime database migration creates the CSC wallet ledger and adds the operator link to applications. No database re-import is required for an existing installation. Keep a database backup before deployment.
- Ensure Apache mod_rewrite is enabled for the clean /csc URL. The CSC directory also contains its own index.php, so /csc/ works with standard directory index handling.

CSC OPERATOR WORKSPACE UPDATE
-----------------------------
- CSC candidate registration now opens inside a dedicated CSC workspace header at
  /index.php?page=register&csc=1, with a direct return link to /csc/.
- Operators can save incomplete candidate applications as pending drafts from
  the final step using "Save as Pending". Drafts are private to the operator.
- The CSC dashboard includes a search for application number, draft reference,
  candidate name or mobile number. Search results are restricted to the logged-in
  operator's own submitted applications and saved drafts.
- "My Submitted Forms Report" lists only applications created by that CSC operator.
- Operators can continue a saved draft from the dashboard. For security, photo-ID
  files are not retained in a draft; both proof images must be uploaded again before
  final submission. OTP verification is also required again before final submit.
- The csc_application_drafts table is created automatically. The database account
  needs CREATE TABLE permission for first-time migration.
- On successful final submission, the resumed draft is removed; existing wallet
  debit and admin-configured commission credit are processed in the same database
  transaction as the application record.
- A role-enum migration was corrected to retain the csc_operator role.
