DMC EQUIPMENT LOAN SYSTEM — SETUP GUIDE
========================================

WHAT THIS IS
------------
- request.php     -> public page students use to request gear (share this link)
- confirmation.php -> shown after a successful request
- submit.php      -> handles the form behind the scenes (nothing to edit)
- staff/          -> password-protected desk tools (login, dashboard, check-in/out)
- config.php      -> the ONE file you need to edit before going live
- styles.css      -> visual styling

STEP 1 — UPLOAD THE FILES
--------------------------
1. Log into cPanel at InMotion.
2. Open File Manager.
3. Go into public_html (or a subfolder if you want it at a sub-address,
   e.g. public_html/equipment).
4. Upload every file and folder from this package, keeping the same
   folder structure (the "staff" and "includes" folders must stay intact).

STEP 2 — EDIT config.php
--------------------------
Open config.php in cPanel's File Manager (Edit button), and fill in:

  DB_PASS               -> your MySQL password (same one from LibreOffice Base)
  STAFF_NOTIFY_EMAIL     -> the @sac.edu address that should get new-request emails
  MAIL_FROM_ADDRESS       -> an email address on your own domain to send FROM
  STAFF_PIN               -> a PIN only your staff know (e.g. 4821)
  SESSION_SECRET          -> any random string (optional but recommended)

Everything else (DB_HOST, DB_PORT, DB_NAME, DB_USER) already matches what
you used when connecting LibreOffice Base, so you likely don't need to
touch those.

STEP 3 — TEST IT
------------------
1. Visit yourdomain.com/request.php (or wherever you uploaded it) and
   submit a test request using an @sac.edu email.
2. Visit yourdomain.com/staff/login.php, enter your PIN, and confirm
   you see the test request on the dashboard.
3. Click "Mark picked up" then "Mark returned" to confirm the full
   cycle works, and check phpMyAdmin to see the equipment_units status
   flip from reserved -> checked_out -> available.
4. Check that the notification email arrived. If it doesn't show up,
   check your spam folder — InMotion's basic PHP mail() function is
   reliable but sometimes flagged. If this becomes a problem, let me
   know and I can switch it to send via SMTP through your real email
   account instead, which lands in the inbox more reliably.

NOTES / DESIGN DECISIONS WORTH KNOWING
----------------------------------------
- Requests are auto-approved: submitting reserves the gear immediately
  (equipment_units.status becomes 'reserved'). Staff still confirm the
  physical hand-off by clicking "Mark picked up" at the desk, which is
  when it becomes 'checked_out'.
- The staff dashboard uses ONE shared PIN for all staff rather than
  individual logins — simplest to set up and maintain. If you'd
  rather track which staff member checked an item in/out, that's a
  reasonable upgrade to add later.
- Class/Project and phone number are stored in the loan's notes field
  as text, since the current schema doesn't have dedicated columns for
  them. If you want proper columns (e.g. to search/report on class
  later), I can add them with a small schema update.
- The "quantity" a student can request is capped automatically by
  real-time availability — they can't request more C100 cameras than
  are actually free.

IF SOMETHING BREAKS
---------------------
The most common issue is a typo in config.php (especially DB_PASS).
If the request form shows a blank white page, that's almost always a
PHP error — ask your host to turn on error display temporarily, or
check cPanel's "Errors" log under Metrics.
