β οΈ 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