# STEM Tutor Website Installation Guide

## What is included

This upgraded package includes:

- `index.html` with multilingual menu and course package UI.
- Language selector for English, Mandarin Chinese, Spanish, Vietnamese, Korean, Arabic, Japanese, and Russian.
- Online/offline demo course pages in `/demos`.
- Course package order form.
- Payment option workflow for WeChat Pay, Alipay, Zelle, Stripe/Card planned, and manual invoice.
- PHP scripts to save student registration, teacher application, contact messages, package orders, and payment confirmations to MySQL.
- Admin dashboard and CSV export.

## Upload steps in cPanel / FileZilla

1. Back up your current `stemtutor.ztechgroup.info` folder.
2. Upload all files from this ZIP into the subdomain folder, usually something like:
   - `public_html/stemtutor/`, or
   - the document root shown in cPanel Subdomains.
3. Make sure `index.html` is directly inside that folder.
4. Confirm the browser opens:
   - `https://stemtutor.ztechgroup.info/index.html`

## MySQL setup

1. In cPanel, open **MySQL Databases**.
2. Create a database, for example `yourcpanel_stemtutor`.
3. Create a database user, for example `yourcpanel_stemuser`.
4. Give the user **ALL PRIVILEGES** on the database.
5. Open phpMyAdmin and import:
   - `sql/create_tables.sql`
6. Edit:
   - `php/db_config.php`
7. Replace:
   - `DB_NAME`
   - `DB_USER`
   - `DB_PASS`
   - `ADMIN_EXPORT_KEY`
   - business contact/payment settings

## If you already imported an older version

Import this file after backing up your database:

- `sql/upgrade_2026_languages_payments.sql`

If your MySQL version does not accept `ADD COLUMN IF NOT EXISTS`, add the listed columns manually in phpMyAdmin.

## Admin dashboard

After changing `ADMIN_EXPORT_KEY`, open:

`admin/dashboard.php?key=YOUR_PRIVATE_KEY`

The dashboard shows:

- latest course package orders
- latest payments
- manual payment status update
- student leads
- contact messages
- CSV export buttons

## Important security notes

This is a practical first version for a small tutoring website. Before using it as a real production system, add:

- a real admin login system
- HTTPS forced redirect
- spam protection / CAPTCHA
- backup process
- privacy policy and refund policy
- proper payment gateway signature verification



## Menu Language Selector

The language selector is now inside the main navigation menu as **🌐 Language**. Parents can choose English, Mandarin Chinese, Spanish, Vietnamese, Korean, Arabic, Japanese, or Russian. The selected language is saved in the browser with `localStorage`, so the choice stays active when the parent opens demo pages. Arabic automatically switches the page direction to right-to-left.


## Language dropdown correction

The public site now uses a real language `<select>` dropdown inside the main navigation menu, labeled with the globe icon. It includes eight choices: English, Mandarin Chinese, Spanish, Vietnamese, Korean, Arabic, Japanese, and Russian. English, Chinese, and Spanish have the most complete translated content; the other languages are present in the selector and use translated menu/key labels where available, with English fallback for any missing page text.

The selected language is saved in the browser using `localStorage`, so the same language remains active when the visitor moves between the home page and demo pages. Arabic switches the document direction to right-to-left automatically.
