# AlvanTech - Technology Company Website

A modern, responsive PHP-based website for technology companies with an integrated admin panel.

## Features

- **Responsive Design** - Works on all devices
- **Admin Dashboard** - Complete content management system
- **Product Management** - Add, edit, and manage products
- **Portfolio Section** - Showcase your work
- **Pricing Plans** - Display service pricing
- **SEO Ready** - Meta tags and search engine optimization
- **Secure** - Built-in security features
- **Flexible Database** - Works with any database name you choose

## Requirements

- PHP 7.4 or higher
- MySQL 5.7 or higher (or MariaDB 10.2+)
- Apache with mod_rewrite (optional but recommended)

## Installation

### Step 1: Create Database

Create a MySQL database with any name you prefer:

```sql
CREATE DATABASE your_database_name CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
```

### Step 2: Configure Database Connection

Edit the `config.php` file with your database credentials:

```php
$host     = "localhost";           // Your database host
$dbname   = "your_database_name";  // Your database name
$username = "your_username";       // Database username
$password = "your_password";       // Database password
```

### Step 3: Import Database Tables

Import the `alvantech.sql` file into your database:

```bash
mysql -u your_username -p your_database_name < alvantech.sql
```

Or use phpMyAdmin to import the SQL file.

### Step 4: Upload Files

Upload all files to your web server. Ensure the following directories are writable (chmod 755):
- `assets/uploads/products/`
- `assets/uploads/portfolio/`
- `assets/uploads/logos/`

### Step 5: Access Admin Panel

Navigate to `http://yourdomain.com/admin/`

**Default login:**
- Username: `admin`
- Password: `admin123`

⚠️ **Important:** Change the default password after first login!

## Directory Structure

```
alvantech/
├── config.php             # Database configuration (EDIT THIS!)
├── .htaccess              # Apache security settings
├── README.md              # This file
├── alvantech.sql          # Database tables (import this)
├── index.php              # Homepage
├── webscripts.php         # Products listing
├── product-detail.php     # Product detail page
├── includes/              # Core includes
│   ├── db.php            # Database connection (uses config.php)
│   ├── functions.php     # Helper functions
│   ├── header.php        # Site header
│   └── footer.php        # Site footer
├── admin/                 # Admin panel
│   ├── index.php         # Login page
│   ├── dashboard.php     # Admin dashboard
│   ├── products.php      # Product management
│   ├── product-edit.php  # Add/Edit product
│   ├── portfolio.php     # Portfolio management
│   ├── pricing.php       # Pricing management
│   ├── settings.php      # Site settings
│   ├── logout.php        # Logout handler
│   └── includes/         # Admin templates
│       ├── header.php
│       └── footer.php
└── assets/               # Static assets
    ├── css/style.css     # Main stylesheet
    ├── js/main.js        # Main JavaScript
    └── uploads/          # Upload directory
        ├── products/     # Product images
        ├── portfolio/    # Portfolio images
        └── logos/        # Site logos
```

## Configuration Options

### config.php

| Variable | Description | Example |
|----------|-------------|---------|
| `$host` | Database server address | `localhost` or `127.0.0.1` |
| `$dbname` | Your database name | `alvantech` or `my_site_db` |
| `$username` | Database username | `root` or `db_user` |
| `$password` | Database password | `your_password` |
| `$table_prefix` | Optional table prefix | `alv_` (empty by default) |
| `$site_url` | Manual site URL (optional) | `https://yoursite.com` |
| `$debug_mode` | Show errors (false for production) | `true` or `false` |

## Using Table Prefixes

If you're sharing a database with other applications, you can add a table prefix:

```php
$table_prefix = "alv_";
```

This will create tables named:
- `alv_users`
- `alv_products`
- `alv_portfolio`
- `alv_pricing`
- `alv_settings`

## Security Notes

1. **Change the default admin password immediately** after first login
2. **Protect config.php** - The `.htaccess` file blocks access to this file
3. **Set `$debug_mode = false`** in production
4. Use HTTPS in production
5. Regularly backup your database
6. Keep PHP and MySQL versions up to date

## Troubleshooting

### "Unable to connect to the database"
- Check your `config.php` credentials
- Ensure the database exists
- Verify MySQL is running

### "Table doesn't exist" errors
- Make sure you imported `alvantech.sql`
- Check if `$table_prefix` matches your setup

### Permission errors on uploads
- Set directory permissions: `chmod 755 assets/uploads/`
- Or `chmod -R 755 assets/uploads/`

## Support

For support or questions, contact: support@alvantech.com

## License

This project is licensed under the MIT License.
