EasyReserve is a small PHP/MySQL reservation system with a Persian (Jalali/Shamsi) date experience.
It provides:
- Reservation form (client-side validation + AJAX) —
form.html - Reservation API —
reserve.php - Reservations listing & filtering with DataTables —
read.php - Persian date utilities —
helpers.php - Database schema —
db.sql
- Shows the next Monday date in Jalali format on the form.
- Validates:
- National ID (10 digits + checksum)
- Mobile number (
09xxxxxxxxx)
- Prevents duplicate reservations by (national_id + visit_day).
- Limits total reservations per day (default 50).
- Sends an SMS after successful reservation (placeholder SMS provider in
reserve.php). - Admin/manager view:
- Filter by Jalali date
- Queue number ordering
- Export to Excel / CSV / Print
- PHP
- MySQL / MariaDB
- Bootstrap (RTL)
- jQuery + DataTables
form.html— Public reservation form + JS validations + AJAX POSTreserve.php— Accepts POST data, writes to DB, returns JSONread.php— Displays reservations table with DataTables (Jalali date filter)helpers.php— Jalali/Gregorian conversion + formatting helpersdb.sql— Creates database +reservationstableassets/— JS/CSS dependencies
- Import schema:
-- db.sql
CREATE DATABASE IF NOT EXISTS visits ...;
USE visits;
CREATE TABLE reservations (...);- Create DB user and credentials for:
- host
- user
- password
- dbname (
visits)
You must edit the placeholder values in both PHP entry points:
Replace:
YOUR_DB_HOSTYOUR_DB_USERYOUR_DB_PASSWORDYOUR_DB_NAME
Also configure SMS provider in sendSMS():
$api_url = "https://sms-provider.com/api/send";- adjust
$datafields to match your real provider
Replace the same DB placeholders:
YOUR_DB_HOSTYOUR_DB_USERYOUR_DB_PASSWORDYOUR_DB_NAME
- Host the project with PHP enabled (e.g. Apache + PHP or PHP built-in server).
- Ensure
assets/is reachable by the browser. - Open
form.htmlto create reservations. - Open
read.phpto view reservations.
form.html posts to:
http://nobat.khiec.ir/reserve.php
If you run locally, update that URL to your own domain, e.g.:
http://localhost/EasyReserve/reserve.php
- The form automatically shows the next Monday date (Jalali) and sends:
full_namenational_idphonesubjectvisit_day(GregorianYYYY-MM-DD)
On success, the server returns JSON which is shown in the form result box.
read.phprenders a table of reservations for a Jalali date.- Filter input accepts Jalali dates like:
1403/02/15
- SMS sending is a placeholder. Replace the provider implementation in
sendSMS(). - DB credentials are currently hardcoded as placeholders; for production, consider using environment variables or a separate config file.
MIT (LICENSE).
