A modern, full-featured vehicle inventory management system built with PHP and MySQL. This application provides both public-facing vehicle listings and a comprehensive admin panel for managing your used car dealership's inventory.
- Vehicle Listings: Browse all available vehicles in an organized table format
- Advanced Filtering: Filter vehicles by make, type, and class
- Flexible Sorting: Sort by price (high to low, low to high) or year (newest to oldest, oldest to newest)
- Responsive Design: Mobile-friendly interface using Tailwind CSS
- Vehicle Management: Add and delete vehicles with ease
- Category Management: Manage makes, types, and classes
- Bulk Operations: Quick delete functionality with confirmation prompts
- Intuitive Navigation: Easy-to-use admin interface with centralized footer navigation
- Backend: PHP 7.4+
- Database: MySQL with PDO
- Frontend: HTML5, Tailwind CSS
- JavaScript: Vanilla JS for dynamic interactions
- PHP 7.4 or higher
- MySQL 5.7 or higher
- Web server (Apache/Nginx)
- Node.js and npm (for Tailwind CSS development)
-
Clone the repository
git clone https://github.com/yourusername/zippy-used-autos.git cd zippy-used-autos -
Create the database
CREATE DATABASE zippyusedautos;
-
Import the database schema
CREATE TABLE makes ( id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100) NOT NULL ); CREATE TABLE types ( id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100) NOT NULL ); CREATE TABLE classes ( id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100) NOT NULL ); CREATE TABLE vehicles ( id INT AUTO_INCREMENT PRIMARY KEY, make_id INT NOT NULL, type_id INT NOT NULL, class_id INT NOT NULL, model VARCHAR(100) NOT NULL, year INT NOT NULL, price DECIMAL(10, 2) NOT NULL, FOREIGN KEY (make_id) REFERENCES makes(id), FOREIGN KEY (type_id) REFERENCES types(id), FOREIGN KEY (class_id) REFERENCES classes(id) );
-
Configure database connection
Edit
config.phpwith your database credentials:$dsn = 'mysql:host=localhost;dbname=zippyusedautos'; $username = 'your_username'; $password = 'your_password';
-
Install dependencies (optional, for Tailwind development)
npm install
-
Start your web server
Point your web server's document root to the project directory, or use PHP's built-in server:
php -S localhost:8000
-
Access the application
- Public site:
http://localhost:8000 - Admin panel:
http://localhost:8000/admin
- Public site:
- Visit the main page to view all vehicles
- Use the dropdown filters to narrow your search by make, type, or class
- Sort vehicles by price or year using the sort dropdown
- Navigate to
/adminto access the admin dashboard - Add Vehicles: Click "Add Vehicle" in the footer navigation
- Manage Categories: Use the footer links to manage makes, types, and classes
- Delete Items: Click the delete button on any item (confirmation required)
- vehicles: Main vehicle inventory table
- makes: Vehicle manufacturers (e.g., Toyota, Ford, Honda)
- types: Vehicle types (e.g., Sedan, SUV, Truck)
- classes: Vehicle classes (e.g., Economy, Luxury, Sport)
- Prepared statements (PDO) to prevent SQL injection
- Input sanitization using
htmlspecialchars() - Parameter binding for all database queries
- Confirmation prompts for destructive actions
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License.
For issues or questions, please open an issue on GitHub.