⚠️ Important: These are FREE hosting URLs with limitations. Not recommended for production data. For testing: Use the credentials below or register with a Gmail account only (Gmail SMTP is configured)
- 🔗 URL 1: https://hotel-annapurna.infinityfreeapp.com/
- 🔗 URL 2: https://hotel-annapurna.liveblog365.com/
Test Credentials (User Only):
- Email:
suresh.bdr@gmail.com - Password:
12345678 - Or register a new account with any Gmail address
Hotel Annapurna is a comprehensive hotel management and booking system built with Core PHP, HTML, CSS, and JavaScript (no frameworks, no heavy dependencies except Fetch API). This system is designed to reduce the complexity of in-counter menu ordering and provide a seamless digital experience for both hotel staff and customers.
In traditional hotels, customers face several challenges:
- ❌ Long queues at the counter for food ordering
- ❌ Difficulty browsing and selecting from printed menus
- ❌ Time-consuming manual booking processes
- ❌ No real-time order tracking
- ❌ Complicated room/table reservation procedures
- ❌ No order history or order management for customers
Hotel Annapurna solves these problems by providing: ✅ Quick online food ordering - Browse menu anytime, order online ✅ Instant room booking - Check availability and book rooms 24/7 ✅ Easy table reservation - Reserve dining tables for special occasions ✅ Real-time order tracking - Know exactly when your order is ready ✅ Unified cart system - Combine food, room, and table bookings in one checkout ✅ Multiple payment options - Cash, eSewa, Stripe integration ✅ Admin control - Complete management dashboard for staff
- 🍽️ Online Food Ordering - Browse menu, add to cart, place orders
- 🛏️ Room Booking - View available rooms, check amenities, reserve instantly
- 🪑 Table Reservation - Reserve dining tables with capacity selection
- 💳 Multiple Payment Methods - Cash at Counter, eSewa, Stripe
- 📦 Shopping Cart - Multi-item cart (food + rooms + tables)
- 📝 Order History - Track all your orders and bookings
- 👤 User Profile - Manage account info, view past orders
- 📚 Blog & News - Read hotel updates, like/comment/share posts
- 🎟️ Coupon Codes - Apply discount codes at checkout
- 📧 Email Notifications - Get order confirmations and updates
- 📊 Dashboard - Real-time statistics and analytics
- 🍽️ Food Management - Add/Edit/Delete menu items with categories
- 🛏️ Room Management - Control room inventory, pricing, availability
- 🪑 Table Management - Manage dining tables and bookings
- 📋 Order Management - View, update, and track all orders
- 👥 Customer Management - Manage customer accounts and roles
- 💰 Payment Tracking - Monitor payment status (Pending/Paid/Failed)
- 📸 Image Management - Upload and manage product images
- 📧 Contact Management - Handle customer inquiries
- 📝 Blog Management - Create, edit, delete blog posts
- 💼 Staff Management - Manage staff members and roles
- 🎟️ Coupon Management - Create and manage discount codes
- ✅ Prepared Statements - Protection against SQL injection
- ✅ Role-Based Access Control - Admin, Staff, Customer roles
- ✅ Secure Authentication - Password hashing with verification
- ✅ Email Notifications - PHPMailer integration
- ✅ Payment Gateway Integration - eSewa & Stripe
- ✅ Session Management - Secure user sessions
- ✅ Responsive Design - Works on mobile, tablet, desktop
- ✅ Activity Logging - Track all user activities
- ✅ OTP Verification - Email-based registration verification
- ✅ Password Reset - Secure password recovery
Before you begin, ensure you have the following:
-
XAMPP (Apache + MySQL + PHP 7.4+)
- Download: https://www.apachefriends.org/
-
Text Editor/IDE - VS Code, Sublime Text, or similar
-
Git (optional) - For version control
-
Google Account (optional) - For Gmail SMTP setup
-
Modern Web Browser - Chrome, Firefox, Edge, Safari
- Open XAMPP Control Panel
- Click START for:
- ✅ Apache
- ✅ MySQL
- Wait for green indicators showing both are running
Status:
✓ Apache: Running (Port 80)
✓ MySQL: Running (Port 3306)
-
Navigate to XAMPP htdocs folder:
C:\xampp\htdocs\ -
Option A: Clone using Git
git clone https://github.com/mahendramahara/Hotel-Annapurna-Web.git
-
Option B: Download Manually
- Download project ZIP file
- Extract to
C:\xampp\htdocs\Hotel-Annapurna-Web
Your project should be at:
C:\xampp\htdocs\Hotel-Annapurna-Web\
Open file: config/db.php
Update these credentials:
<?php
$host = "localhost"; // Database host (localhost for local)
$username = "root"; // Default XAMPP username
$password = ""; // Leave empty for default XAMPP
$database = "hotel_annapurna"; // Database name
// Connection
$conn = new mysqli($host, $username, $password, $database);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
?>Default XAMPP Credentials:
- Host:
localhost - Username:
root - Password: `` (empty)
✅ Save the file
-
Open your browser and navigate to:
http://localhost/Hotel-Annapurna-Web/database_setup.php -
You should see:
🗄️ Hotel Annapurna - Database Setup -
The script will automatically create all tables:
- ✅ Users table
- ✅ Food Items table
- ✅ Rooms table
- ✅ Dining Tables table
- ✅ Orders table
- ✅ Blogs table
- ✅ Coupons table
- ✅ Contact Requests table
- ✅ Activity Logs table
- ✅ And more...
-
You should see:
✅ Database Setup Completed Successfully!
If tables already exist: They will be skipped, which is fine.
To populate the database with sample data for testing:
-
Navigate to:
http://localhost/Hotel-Annapurna-Web/seed_database.php -
This will add:
- 📸 Sample rooms, food items, tables
- 🎟️ Test coupon codes
- 📝 Sample blog posts
- 👥 Demo user accounts
Sample Login Credentials (if seeded):
- Email:
customer@example.com - Password:
password123
Email is needed for:
- Registration verification
- Password reset emails
- Order confirmations
- Contact form responses
Prerequisites:
-
Have a Google account
-
Enable 2-Factor Authentication:
- Go to: https://myaccount.google.com/security
- Enable 2-Step Verification
-
Generate App Password:
- Go to: https://myaccount.google.com/apppasswords
- Select: Mail → Windows Computer
- Google generates a 16-character password
- Copy this password (not your actual Gmail password)
Configure in Code:
Open: config/setup_mailer.php
Find and update:
$mail->Host = 'smtp.gmail.com'; // Gmail SMTP server
$mail->SMTPAuth = true;
$mail->Username = 'your-email@gmail.com'; // Your Gmail address
$mail->Password = 'your-app-password'; // 16-char password from above
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port = 587;
// Set sender
$mail->setFrom('your-email@gmail.com', 'Hotel Annapurna');✅ Save the file
Setup Mailtrap:
- Go to: https://mailtrap.io
- Create free account
- Create new inbox
- Copy your SMTP credentials
Configure in Code:
Open: config/setup_mailer.php
Find and update:
$mail->Host = 'smtp.mailtrap.io'; // Mailtrap SMTP
$mail->SMTPAuth = true;
$mail->Username = 'your-mailtrap-user'; // From Mailtrap dashboard
$mail->Password = 'your-mailtrap-password'; // From Mailtrap dashboard
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port = 2525;✅ Save the file
eSewa is a payment method for testing payments in Nepal.
Update File Paths:
Open: includes/esewa-helper.php
Verify/Update the base URL:
$base_url = "http://localhost/Hotel-Annapurna-Web";Ensure callback URLs match:
$success_url = $base_url . "/esewa-success.php";
$failure_url = $base_url . "/esewa-failure.php";Also update: payment.php
In the JavaScript payment form, update eSewa redirect URLs:
success_url: window.location.origin + '/Hotel-Annapurna-Web/esewa-success.php',
failure_url: window.location.origin + '/Hotel-Annapurna-Web/esewa-failure.php',For production, change to:
success_url: 'https://yourdomain.com/esewa-success.php',
failure_url: 'https://yourdomain.com/esewa-failure.php',Also check: api/esewa-status-check.php
// Verify URLs match your domain✅ Save all files
eSewa Test Credentials:
- MERCHANT CODE: (already configured in code)
- Test credentials for sandbox: Use test account in eSewa documentation
http://localhost/Hotel-Annapurna-Web/
http://localhost/Hotel-Annapurna-Web/admin/
-
Open phpMyAdmin:
http://localhost/phpmyadmin -
Select Database:
- Click on
hotel_annapurnain left panel
- Click on
-
Edit User:
- Click on
userstable - Find your user account
- Click Edit (pencil icon)
- Change
rolecolumn fromcustomertoadmin - Click Save
- Click on
-
Login to Admin:
URL: http://localhost/Hotel-Annapurna-Web/admin/ Email: (your registered email) Password: (your password)
-
Register/Login:
- Go to:
/register.php - Create new account
- Verify email (or check Mailtrap inbox)
- Go to:
-
Browse Items:
- Menu → Add food items to cart
- Rooms → Add rooms to cart
- Tables → Add tables to cart
-
Checkout:
- View Cart → Proceed to Checkout
- Select Payment Method:
- 💵 Cash - Pay at counter (instant)
- 📱 eSewa - Test payment gateway
- 💳 Stripe - Test card: 4242 4242 4242 4242
-
Track Order:
- Profile → My Orders (for food)
- Profile → My Bookings (for rooms/tables)
-
Login to Admin:
- URL:
/admin/ - Use admin credentials
- URL:
-
Explore Sections:
- 📊 Dashboard - Overview stats
- 🍽️ Food Items - Manage menu
- 🛏️ Rooms - Manage rooms
- 🪑 Tables - Manage tables
- 📋 Service Requests - View all orders
- 👥 Customers - Manage users
- 💰 Coupons - Create discounts
- 📝 Blogs - Create posts
- 💼 Staffs - Manage staff
Hotel-Annapurna-Web/
│
├── admin/ # Admin Dashboard
│ ├── index.php # Admin home page
│ ├── login.php # Admin login
│ ├── logout.php # Admin logout
│ ├── includes/
│ │ └── auth-guard.php # Authentication check
│ ├── sections/ # Admin management sections
│ │ ├── blogs.php # Blog management
│ │ ├── contacts.php # Contact management
│ │ ├── coupons.php # Coupon management
│ │ ├── customers.php # Customer management
│ │ ├── menu_items.php # Food item management
│ │ ├── profile.php # Admin profile
│ │ ├── requests.php # Order management
│ │ ├── reviews.php # Review management
│ │ ├── rooms.php # Room management
│ │ ├── staffs.php # Staff management
│ │ └── tables.php # Table management
│ └── assets/ # Admin styles and scripts
│ ├── css/
│ ├── js/
│ └── images/
│
├── api/ # Backend API Endpoints
│ ├── admin-blogs.php # Blog API
│ ├── admin-contacts.php # Contact API
│ ├── admin-coupons.php # Coupon API
│ ├── admin-dashboard.php # Dashboard stats
│ ├── admin-orders.php # Order management API
│ ├── admin-users.php # User management API
│ ├── blog-interactions.php # Blog likes/comments API
│ ├── cart-handler.php # Shopping cart API
│ ├── contact-handler.php # Contact form API
│ ├── create-booking.php # Create room/table booking
│ ├── create-cart-order.php # Cart checkout API
│ ├── esewa-status-check.php # eSewa payment verification
│ ├── menu-handler.php # Food item API
│ ├── order-handler.php # Order processing API
│ ├── profile-handler.php # User profile API
│ ├── room-handler.php # Room management API
│ ├── table-handler.php # Table management API
│ └── validate-coupon.php # Coupon validation API
│
├── config/ # Configuration Files
│ ├── db.php # Database connection
│ └── setup_mailer.php # Email configuration
│
├── includes/ # Shared Components
│ ├── activity-logger.php # Logging utility
│ ├── esewa-helper.php # eSewa payment helper
│ ├── footer.php # Footer component
│ └── header.php # Header/navigation
│
├── seeders/ # Database Seeders
│ ├── blogs_seeder.php # Sample blogs
│ ├── coupons_seeder.php # Sample coupons
│ ├── food_items_seeder.php # Sample food items
│ ├── rooms_seeder.php # Sample rooms
│ ├── tables_seeder.php # Sample tables
│ └── users_seeder.php # Sample users
│
├── assets/ # Frontend Assets
│ ├── css/ # Stylesheets
│ │ ├── style.css # Main styles
│ │ ├── responsive.css # Mobile responsive
│ │ ├── menu.css
│ │ ├── rooms-tables.css
│ │ ├── booking.css
│ │ ├── cart.css
│ │ ├── payment.css
│ │ └── ...
│ ├── js/ # JavaScript files
│ │ ├── script.js # Main script
│ │ ├── forgetpwd.js
│ │ └── ...
│ └── images/ # Static images
│ ├── home_slider/
│ ├── offer_images/
│ └── service_option/
│
├── images/ # Uploaded Content
│ ├── blogs/ # Blog images
│ ├── food/ # Food item images
│ ├── menus/ # Menu images
│ ├── profiles/ # User profile pictures
│ ├── rooms/ # Room images
│ └── tables/ # Table images
│
├── uploads/ # User Uploads
│ └── profiles/ # User profile uploads
│
├── database_setup.php # Create database tables
├── seed_database.php # Populate demo data
├── index.php # Home page
├── rooms.php # Browse rooms
├── menu.php # Browse food items
├── tables.php # Browse tables
├── blogs.php # Browse blogs
├── blog-read.php # Read blog details
├── cart.php # Shopping cart
├── payment.php # Payment processing
├── booking.php # Booking details
├── contact.php # Contact form
├── register.php # User registration
├── register-handler.php # Registration processing
├── login.php # User login
├── login-handler.php # Login processing
├── logout.php # User logout
├── profile.php # User profile
├── my-orders.php # Order history
├── my-bookings.php # Booking history
├── forget-password.php # Password reset request
├── reset-password.php # Password reset form
├── verify-register.php # Email verification
├── esewa-success.php # eSewa success callback
├── esewa-failure.php # eSewa failure callback
├── check_blogs.php # Blog checking utility
├── README.md # This file
└── composer.json # Dependencies (PHPMailer)
-
Never Commit Sensitive Data:
- Database passwords
- Email passwords
- API keys
- Payment credentials
-
Before Going to Production:
- Change default admin password
- Use HTTPS instead of HTTP
- Enable firewall rules
- Regular database backups
- Implement rate limiting
- Add CSRF token validation
- Update all credentials
-
Database Security:
- Regular backups
- Restrict database access
- Use strong passwords
- Minimal user privileges
-
Code Security:
- All queries use prepared statements ✅
- Input validation on all forms ✅
- Output escaping implemented ✅
- SQL injection protection ✅
After running seed_database.php, use these codes:
| Code | Discount | Min Purchase | Details |
|---|---|---|---|
| WELCOME10 | 10% off | RS 500 | Welcome discount |
| SAVE20 | 20% off | RS 1000 | Limited time |
| FREESHIP | RS 500 off | RS 2000 | Delivery discount |
Use these credentials for testing eSewa payments:
| Field | Value |
|---|---|
| Mobile Number | 9806800001 (or 9806800002, 9806800003, 9806800004, 9806800005) |
| Password | Nepal@123 |
| OTP | 123456 |
| Test URL | https://developer.esewa.com.np/pages/Epay#credentials&urls |
How to Test:
- Go to checkout and select eSewa payment
- You'll be redirected to eSewa sandbox
- Login with phone:
9806800001and password:Nepal@123 - Enter OTP:
123456 - Confirm payment
Use these test card numbers for testing Stripe payments:
| Card Type | Card Number | Expiry | CVC |
|---|---|---|---|
| Visa | 4242 4242 4242 4242 | 12/27 | 123 |
| Test Success | 4242 4242 4242 4242 | Any future date | Any 3 digits |
| Test Declined | 4000 0000 0000 0002 | Any future date | Any 3 digits |
| Test Documentation | https://docs.stripe.com/testing?testing-method=card-numbers | - | - |
How to Test:
- Go to checkout and select Stripe (Credit/Debit Card)
- Enter card number:
4242 4242 4242 4242 - Expiry:
12/27(or any future date) - CVC:
123(or any 3 digits) - Complete payment
| Technology | Details |
|---|---|
| Backend | PHP 7.4+ |
| Database | MySQL/MariaDB |
| Frontend | HTML5, CSS3, JavaScript (Vanilla) |
| PHPMailer | |
| Payment | eSewa API, Stripe |
| APIs | RESTful endpoints, Fetch API |
| Security | Prepared Statements, Password Hashing |
| Issue | Solution |
|---|---|
| Database won't connect | Check credentials in config/db.php |
| Email not working | Verify SMTP settings, enable 2FA (Gmail) |
| eSewa error | Update URLs in includes/esewa-helper.php |
| Admin can't access | Make sure role is set to admin in database |
| Images won't upload | Check folder permissions and file size limits |
- Database Issues: Check
config/db.php - Email Issues: Check
config/setup_mailer.php - Payment Issues: Check
includes/esewa-helper.php - Admin Issues: Check user role in phpMyAdmin
Developer: Mahendra Mahara
Connect on:
- 💼 LinkedIn: mahendramahara
- 👍 Facebook: Mahendra Mahara
- Check Documentation - Review README and code comments
- Test Locally First - Run on localhost with XAMPP
- Use Test Credentials - Email:
suresh.bdr@gmail.com, Password:12345678 - Gmail Required - For email features, use Gmail account only
- GitHub Issues: Open an issue on GitHub repository
- Email: Contact project owner
- API: See comments in
api/folder files
This project is open-source and free for educational use.
✅ Complete System - From customer interface to admin dashboard
✅ Multiple Payment Methods - Cash, eSewa, Stripe
✅ Email Integration - Notifications and verification
✅ Responsive Design - Works on all devices
✅ Admin Control - Full CRUD operations
✅ Real-time Tracking - Order status updates
✅ Security First - Prepared statements, password hashing
✅ User Friendly - Intuitive interface and navigation
Created by: Mahendra Mahara
Purpose: Educational project for learning core web development concepts without frameworks.
What Makes This Special:
- 🎯 No Frameworks - Pure PHP, HTML, CSS, JavaScript
- 🎯 No Dependencies - Only PHPMailer (email library)
- 🎯 Production Ready - Secure, scalable, maintainable code
- 🎯 Well Documented - Comments explain complex logic
- 🎯 Learning Focused - Perfect for students and learners
- 🎯 Real-World Features - Payment, Email, Booking systems
Version: 2.2.0
Last Updated: December 2025
Status: ✅ Production Ready
Built with ❤️ by Mahendra Mahara