# CMS - Content Management System

## Features
1. **Admin Login** — Default: `admin` / `admin123`
2. **Projects** — Name, description, multiple images
3. **Categories** — Linked to projects, with images
4. **Subcategories** — Listed grouped by category, with images
5. **Products** — Cascading dropdowns (Project → Category → Subcategory), with name, description, remark, URL, price, images, and unlimited titles
6. **Keyword Categories** — Group keywords by category
7. **Keywords** — Add keywords (supports comma-separated bulk add) under a keyword category
8. **Assign Keywords to Products** — Select a product and tick keywords grouped by category

## Installation
1. Upload the `cms` folder to your web root.
2. Create the database by importing `db.sql` via phpMyAdmin or:
   ```
   mysql -u root -p < db.sql
   ```
3. Edit `config.php`:
   - Set `DB_HOST`, `DB_USER`, `DB_PASS`, `DB_NAME`.
   - Set `BASE_URL` to your install path (e.g. `/cms` or `''` if at root).
4. Make sure `uploads/` is writable: `chmod -R 755 uploads/`
5. Visit `https://yourdomain.com/cms/login.php`
6. Login with `admin` / `admin123` (change password after first login)

## Folder Structure
```
cms/
├── config.php          # DB & helpers
├── db.sql              # Schema
├── login.php / logout.php
├── index.php           # Dashboard
├── includes/           # auth, header, footer
├── projects/           # CRUD
├── categories/         # CRUD
├── subcategories/      # CRUD
├── products/           # CRUD with titles
├── keyword_categories/ # CRUD
├── keywords/           # CRUD (bulk add via comma)
├── product_keywords/   # Assign keywords
├── ajax/               # Cascading dropdowns
└── uploads/            # Image storage
```

## Notes
- Uses Bootstrap 5 + Bootstrap Icons (CDN).
- Cascading dropdowns on Product form load via AJAX.
- Deleting a project/category/subcategory cascades and removes child records + image files.
- Bulk keyword entry: type `seo, marketing, ranking` to add 3 at once.
