# PIMS Nepal — Plain PHP + MySQL Website (No Composer, No Framework) This is a fully editable, database-backed version of the PIMS Nepal website — built in plain PHP + MySQL with **zero external dependencies**. No Composer, no npm, no framework install steps. Upload the files, import two SQL files, edit one config file, and it runs on any standard PHP/MySQL hosting (XAMPP, cPanel shared hosting, etc.). This replaces the earlier Laravel/Filament version delivered previously — same editable content, none of the Composer/dependency friction. ## What's included ``` index.php, about.php, services.php, service-detail.php, downloads.php, contact.php, download.php Public pages config/database.php Your MySQL connection settings — EDIT THIS database/schema.sql Creates all 14 tables database/seed.sql Pre-fills your current site content includes/ Shared header, footer, functions, data bridge assets/ Your CSS, JS, logo (same as the static site) admin/ Login-protected admin panel uploads/ Where admin-uploaded files/images are stored ``` ## What's editable from the admin panel (`/admin`) | Section | Admin page | |---|---| | Company name, phone, WhatsApp, email, **location/map embed**, social links, logo, promo strip | Site Settings | | **Navigation bar** links (add/remove/reorder) | Navigation Bar | | **SEO** (title, meta description, keywords, canonical URL) per page — Home, About, Services, Downloads, Contact | SEO | | Hero/banner slides (image, badge, headline, subtitle, CTA) | Hero Slides | | Services (all 10 — title, description, features, FAQs) | Services | | Downloads (title, version, file upload, size, release date) | Downloads | | Testimonials | Testimonials | | Industries We Serve | Industries | | Gallery photos | Gallery | | Team members | Team Members | | "What's New in TallyPrime" feature cards | TallyPrime Features | | About Us page copy (intro, mission, vision, value points, stats) | About Page Content | | Contact form submissions | Contact Messages | | Your own admin name/password | My Account | ## Requirements - **PHP 8.0+** with the `pdo_mysql` extension enabled (this is on by default in XAMPP and virtually all shared hosting — no special setup needed). - **MySQL** (XAMPP's bundled MySQL/MariaDB works fine). - No Composer. No Node/npm. No build step. ## Step-by-step setup (XAMPP example) ### 1. Place the files Copy this whole `pims-nepal-php` folder into your XAMPP `htdocs/` directory, e.g. `C:\xampp\htdocs\pims-nepal-php`. ### 2. Create the database Open phpMyAdmin (`http://localhost/phpmyadmin`), create a new empty database, e.g. `pims_nepal`, then import both SQL files **in this order**: 1. `database/schema.sql` (creates the tables) 2. `database/seed.sql` (fills them with your current content) In phpMyAdmin: select your new database → **Import** tab → choose file → Go. Do this twice, once per file, schema first. ### 3. Set your database credentials Open `config/database.php` and edit these four lines with your real values: ```php define('DB_HOST', 'localhost'); define('DB_NAME', 'pims_nepal'); define('DB_USER', 'root'); define('DB_PASS', ''); ``` XAMPP's default MySQL user is `root` with no password, so the defaults above usually work as-is for local testing. ### 4. Create your admin account `seed.sql` deliberately does **not** create a ready-made admin login — password hashes generated outside of your own PHP install aren't guaranteed to work correctly (bcrypt implementations can differ subtly between languages/versions), and shipping one caused login failures for exactly this reason. Instead, create your own account using your own server's PHP: 1. Visit `http://localhost/pims-nepal-php/admin/setup.php` 2. Fill in your name, email, and a password (min 8 characters), submit. 3. You'll see a confirmation that your admin account is ready. 4. **Delete `admin/setup.php` from the server immediately after this step** — it has no login check by design (so you can always get back in), which means anyone who finds the URL could use it while it still exists. If you ever get locked out later, re-upload `setup.php`, visit it once to reset your password, then delete it again. ### 5. Visit the site - Public site: `http://localhost/pims-nepal-php/` - Admin panel: `http://localhost/pims-nepal-php/admin/login.php` — log in with the email and password you just created. ## Uploaded files Anything you upload through the admin panel (gallery photos, download files, team photos, logo, hero slide images) is saved under the `uploads/` folder and served directly — no extra configuration needed, unlike Laravel's `storage:link` step. Make sure the `uploads/` folder (and its subfolders `downloads/`, `gallery/`, `team/`, `branding/`, `seo/`) is writable by the web server. On most shared hosting this works by default; if you get an upload error, set permissions to `755` (or `775`) on the `uploads/` folder via your host's File Manager. ## The contact form The public Contact page (and each service's inquiry form) posts directly to `contact.php`, which is protected by a honeypot field, rate-limited per visitor session, and stores every submission in the `contact_messages` table — viewable and manageable under **Admin ▸ Contact Messages**. There is no outgoing email step configured by default (keeps things dependency-free); if you want email notifications on new messages, that can be added later using PHP's built-in `mail()` function once your host's mail sending is confirmed working. ## Deploying to production (shared cPanel hosting) Since you mentioned your cPanel database and user are already set up, here's the whole process: 1. **Upload the files.** Use cPanel File Manager or FTP to upload the contents of this folder into `public_html/` (or a subfolder if you want the site at `yourdomain.com/pims/` instead of the domain root). 2. **Import the database.** In cPanel ▸ phpMyAdmin, select your existing database and import `database/schema.sql` then `database/seed.sql`, same as the XAMPP steps above. 3. **Edit `config/database.php`** with your real cPanel database name, username and password. cPanel usually prefixes both with your cPanel username, e.g. `cpaneluser_pims_nepal` / `cpaneluser_dbuser`. 4. **Set the PHP version.** In cPanel ▸ MultiPHP Manager, set this domain to PHP 8.0 or newer and make sure `pdo_mysql` is enabled (it's on by default for almost all cPanel PHP versions). 5. **Set folder permissions.** Make sure `uploads/` (and its subfolders) are writable — `755` is usually enough; try `775` if uploads fail. 6. **Create your admin account.** Visit `yourdomain.com/admin/setup.php` once to create your login (see step 4 in the XAMPP setup above for details), then **delete `admin/setup.php` from the server**. Log in at `yourdomain.com/admin/login.php` and update your Site Settings, SEO, and content from there. No document-root gymnastics, no `vendor/`, no build step — every file you uploaded is directly what runs. ## Security notes - Passwords are hashed with PHP's `password_hash()` (bcrypt) — never stored in plain text. - All forms are protected with CSRF tokens and the contact form has both a honeypot field and rate limiting against spam. - All database queries use prepared statements (PDO) — no SQL injection risk from form input. - There is no default admin account or password shipped with this project — you create your own via `admin/setup.php`, which must be deleted right after use (see setup steps above).