#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    2
    Rep Power
    0

    Smile Hotel management application in php


    I am beginner in php, finished learning PHP with MySQL course. I want to start with making a live project. I want to make a Hotel management application/software for one of my friend's hotel at my place, for free of cost. I have noted down all the maximum possible information about the hotel and present ongoing manual process, including, number of room, number of floors, different rooms with different facilities and cost of the rooms based on the facilities provided, room vacancies status [presently maintained in a book]etc,. Now my big question is, how do i design/convert this real time problem/scenario in to a php application. How many tables should i take or for what data i have to take tables in database. And coming to coding part, where do i start, do i have to use classes or anything else. I need the flow of software design, including the database design also. Please any experts please guide me. Thanks a lot in advance.
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Location
    Iran
    Posts
    149
    Rep Power
    140
    You said
    Originally Posted by bob1432
    I am beginner in php, finished learning PHP with MySQL course.
    And you also said
    Originally Posted by bob1432
    Now my big question is, how do i design/convert this real time problem/scenario in to a php application. How many tables should i take or for what data i have to take tables in database. And coming to coding part, where do i start
    Are you sure you have taken any courses?

    Comments on this post

    • ptr2void agrees : Nailed it!
    Regards,
    Dariyoosh
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Dec 2004
    Posts
    3,031
    Rep Power
    377
    the way to start would be design. design the page layout, think about navigation and site functionality (login, register, search etc etc) then Create a database making sure your database can do all the site functionality i.e. register a user, search for rooms etc
  6. #4
  7. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,689
    Rep Power
    171
    In general for a property management systems - who can also connect to channel managers like Site Minder - Something with this structure would do the job. Please note this is a simplified version of the real database. For my system we have 64 tables, here are the main ones:

    hotels table:

    hotel_id, hotel_name, address, star_rating, country_id, state_id, suburb_id,..

    hotel_rooms table
    room_id, hotel_id, room_name, room_type,...

    rate_plans table:
    id, room_id, hotel_id, type,

    allocations table:
    id, rate_plan_id, day_date, day_rate, number_of_rooms, minimum_stay, .....

    You will have to be EXCELLENT with SQL (writting queries and understanding indexing properly). You quite often end up with relatively mid-size queries
    Code:
    $q_get_package= "SELECT 
    q_allotments.TOTAL,
    q_allotments.ALLOTMENTS_STATS,
    q_allotments.ALLOTMENTS_NOR,
    q_allotments.ALLOTMENTS_STATUSES,
    packages.id AS PPIIDD,
    hotelrooms.roomname,
    packages.name AS PPNN,
    hotelrooms.room_id as RID,
    packages.description AS PDESC,
    hotels.hotelname,
    regions.regionname,
    places.name AS PLACENAME,
    destinations.destinationname,
    hotels.property_desc AS DESCRIPTION,
    hotels.hotel_id AS HID,
    room_rates.high AS ROOM_HIGH,
    packages.low AS PLOW,
    packages.id AS PID,
    hotels.startype,
    hotels.address1,
    hotels.address2,
    hotels.town,
    hotels.postcode,
    hotelrooms.room_id AS RID,
    packages.type AS PTYPE,
    countries.countryname AS COUNTRY,
    regions.regionname AS REGION_NAME,
    destinations.destinationname AS DESTINATION,
    hotels.destination_id,
    hotels.disttocityctr ,
    hotels.distancetoairport,
    hotels.carparking,
    hotels.instructions,
    room_rates.based_on_guests AS based_on_guests,
    room_rates.extra_guest_charge AS extra_guest_charge
    		
    FROM
    
    packages 
    
    INNER JOIN (
    				SELECT 
    				allotments_new.package_id,
    				SUM(day_rate) AS TOTAL,
    				GROUP_CONCAT(allotments_new.status) AS ALLOTMENTS_STATS,
    				GROUP_CONCAT(allotments_new.number_of_rooms) AS ALLOTMENTS_NOR,
    				GROUP_CONCAT(allotments_new.status) AS ALLOTMENTS_STATUSES
    				
    				FROM allotments_new 
    				WHERE allotments_new.day_date >= '".$checkin."' 
    				AND allotments_new.day_date < '".$last."' 
    				AND allotments_new.day_rate > 0
    
    				AND allotments_new.minimum_number_of_nights<=".$nights." 
    				GROUP BY package_id
    			) AS q_allotments on q_allotments.package_id = packages.id
    
    LEFT OUTER  JOIN hotels ON hotels.hotel_id=packages.hotel_id AND hotels.status='active'
    LEFT OUTER  JOIN countries ON hotels.country_id=countries.country_id
    
    LEFT OUTER JOIN hotelrooms ON hotelrooms.room_id=packages.room_id AND hotelrooms.status='active'
    LEFT OUTER JOIN room_rates ON room_rates.room_id = hotelrooms.room_id
    LEFT OUTER  JOIN destinations ON destinations.destination_id = hotels.destination_id
    LEFT OUTER  JOIN regions ON regions.region_id = hotels.region_id
    ".$room_type."
    LEFT OUTER JOIN places ON places.id = hotels.places_id
    WHERE 
    hotels.hotel_id = '".$clean_data_get['hid']."'
    AND packages.status='active'
    AND hotels.status='active'
    AND hotelrooms.status='active'
    AND maximum_number_of_adults_and_children >= '".$maximum_number_of_adults_and_children."'
    ".$refine_vars."
    GROUP BY PPIIDD
    ".$order."
    ;";
    If you want to do this properly you have to know EXACTLLY what you are doing. You also have to be very resourceful.
    This is not a project for a beginner. You can have a simple little website for fun but don't expect to make a allotments distribution system in a month.

    I recommend you to build a small login system first, post it here see the reviews and comments then think about building something like that.

    Ben

    Comments on this post

    • ManiacDan agrees
    Last edited by zxcvbnm; June 25th, 2013 at 04:22 AM.
  8. #5
  9. No Profile Picture
    Permanently Banned
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    23
    Rep Power
    0
    You have to create database containing
    login (usr id,login name,password)
    Registration(Rid,fnm,lnm,dob,etc.)
    rooms(room no,room name,room type,floor no)

IMN logo majestic logo threadwatch logo seochat tools logo