SCRAPRR — SETUP NOTES
======================================================================
Destination: https://resourrce.com/Scraprr/

1. DATABASE
   - In cPanel > MySQL Databases, confirm you have a database and user
     matching includes/config.php:
       DB_NAME: noc4j1_cvenrvtxop_scraprr
       DB_USER: noc4j1_cvenrvtxop_mujay
       DB_PASS: sonmym-fubhAb-benwe3
       DB_HOST: localhost
     NOTE: the names you gave me had a space in them
     ("noc4j1 cvenrvtxop_scraprr") — MySQL names can't contain
     spaces, so I assumed it should be an underscore. If cPanel shows
     a different exact name, update the three constants at the top
     of includes/config.php to match.
   - Make sure the DB user is added to that database with ALL
     PRIVILEGES (cPanel does this automatically if you created the
     user from the database's "Add User" screen).

   IF THIS IS A FRESH INSTALL (nothing imported yet):
     In phpMyAdmin, click the database in the left sidebar FIRST,
     then use the Import tab to run scraprr-database.sql. It already
     includes the id_photo_path column, so no migration needed.

   IF YOU ALREADY IMPORTED scraprr-database.sql BEFORE:
     Just run migration-001-add-id-photo.sql the same way (select
     your database first, then Import). It only adds the one new
     column and is safe to run even if you're not sure it's needed —
     it checks first and skips itself if already applied.

2. FILE UPLOAD
   Upload everything in this zip to /Scraprr/ on your host, keeping
   the folder structure exactly as it is in the zip:

     /Scraprr/
       index.php
       buy-tickets.php
       customers.php
       customer-detail.php
       add-customer.php          (new)
       edit-customer.php         (new)
       inventory.php
       dispatch.php
       compliance.php
       reports.php
       scraprr-database.sql
       migration-001-add-id-photo.sql   (new — see step 1)
       includes/
         config.php
         functions.php
         header.php
         footer.php
         style.css.php
         customer-form.php       (new — shared by add/edit)
       uploads/
         customer-ids/           (new — where scanned ID photos land)
           .htaccess              (blocks script execution here)
           index.php               (blocks directory listing)

   IMPORTANT: after uploading, make sure uploads/customer-ids/ is
   writable by the web server (755 or 775 depending on your host's
   setup). If photo uploads fail with a "not writable" error, that's
   the fix — in cPanel File Manager, right-click the folder →
   Permissions → 755 (or 775 if 755 doesn't work).

3. VERIFY
   Visit https://resourrce.com/Scraprr/index.php — if the DB
   credentials are wrong you'll see a plain-text "Database connection
   failed" message instead of a PHP fatal error/blank page. If that
   happens, re-check step 1.

4. MAKING UPDATES LATER
   - Site-wide nav/head changes → edit includes/header.php
   - Footer/closing script → edit includes/footer.php
   - Colors, fonts, spacing → edit includes/style.css.php
   - DB credentials → edit includes/config.php
   - Add/edit customer form fields → edit includes/customer-form.php
     (shared by both add-customer.php and edit-customer.php, so one
     edit updates both pages)
   All pages pull from these same shared files, so one edit updates
   the whole site.

5. THE ID SCANNING FEATURE
   On Add Customer and Edit Customer, "Scan ID Photo" opens the
   device's native camera (works on phones/tablets — on a desktop
   with no camera it falls back to a normal file picker). After
   taking the photo you see a preview before saving; nothing is
   uploaded until you submit the form.
   - Photos are validated server-side (real image check, JPEG/PNG/WEBP
     only, 8MB max) and saved with a randomized filename — never the
     original filename — under uploads/customer-ids/.
     Photo is shown on the customer's profile page, and clicking it
     opens the full-size image in a new tab.
   - Editing a customer with a photo already on file: uploading a new
     one replaces and deletes the old file; checking "Remove this
     photo" clears it without a replacement.
   - The uploads/customer-ids/.htaccess and index.php files exist
     specifically so nobody can upload a disguised script and execute
     it — keep both files in place.

6. WHAT'S LIVE VS. STATIC
   Every number on every page (KPIs, tables, price sheet, containers,
   trips, holds, audit log) is a real query against your database —
   nothing is hardcoded. Add/Edit Customer are fully functional. The
   "New Ticket +", "Edit Price Sheet", report-card buttons, etc. are
   still just buttons with no action wired up yet — say the word if
   you want any of those built out next.
======================================================================

