Skip to content

mehedi37/hotel_management

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏢 Hotel Management System

A PHP based hotel room management system with secure authentication and CRUD operations.

🚀 Live Site

username: devMeek password: meek1025bitLong

🔖 Features

  • Admin Authentication System
  • Room Management (CRUD Operations)
  • Secure Session Management
  • CSRF Protection
  • Responsive Bootstrap UI
  • Input Validation
  • Activity Logging

📃 Pre-requisites

  • PHP 8.2+
  • MySQL/MariaDB
  • Apache Web Server (XAMPP for Windows)

⚙️ Installation

  1. Clone the repository
git clone https://github.com/yourusername/hotel_management.git
cd hotel-management-system
  1. Import the database schema
CREATE DATABASE hotel_management;
USE hotel_management;

CREATE TABLE rooms (
    id INT AUTO_INCREMENT PRIMARY KEY,
    type VARCHAR(255) NOT NULL,
    price DECIMAL(10, 2) NOT NULL,
    status ENUM('Available', 'Occupied') NOT NULL
);

CREATE TABLE AdminUsers (
    id INT AUTO_INCREMENT PRIMARY KEY,
    username VARCHAR(255) NOT NULL UNIQUE,
    password VARCHAR(255) NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
  1. Update database configuration in dbconnect.php:
<?php
private $host = 'localhost';
private $db_name = 'hotel_management';
private $username = 'your_username';
private $password = 'your_password';
  1. Create necessary directories:
mkdir logs
chmod 777 logs
  1. Configure your web server to point to the public directory.

Adding Admin Users

Method 1: Using SQL

INSERT INTO AdminUsers (username, password)
VALUES ('admin', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi');
-- Default password: admin123

Method 2: Using API

curl -X POST http://yourdomain.com/hotel_management/public/api/add_admin.php -d "secret=007tOPVictoriasSecret&username=admin&password=admin123"

📦 Project Structure

hotel_management/
├── app/
│   ├── controllers/       # Application controllers
│   ├── models/           # Database models
│   ├── utils/            # Utility classes
│   └── views/            # View templates
├── config/               # Configuration files
├── public/              # Public directory
│   ├── api/             # API endpoints
│   ├── css/             # Stylesheets
│   └── js/              # JavaScript files
└── logs/                # Application logs

⚡Security Features

  • Password Hashing using password_hash()
  • CSRF Protection
  • SQL Injection Prevention using PDO
  • XSS Protection
  • Session Management
  • Input Validation
  • Secure Password Storage

🤖 Demo Account

  • Username: devMeek
  • Password: meek1025bitLong

Secret Key: 007tOPVictoriasSecret (For API)

📸 Screenshots

Login Page

image

Dashboard

image

✒️ Author

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors