Booking system

(This is not easy so i need master expert for this code)I need code about availability of the rooms.I have three different rooms with different prices,one room cost 100 euros,room two 200 euros and room number three 300 euros.In form of the rooms if you enter number 1 that room cost 100 euros,if enter number 2 that room cost 200 euros,if you enter 3 it cost 300 euros.

[php]<?php

if($_POST[‘rooms’]==“1”)
{
$s1=100;

echo “
”;
//echo $s1. " -21";
}
else if ($_POST[‘rooms’]==“2”)
{
$s1=200;
echo “
”;
//echo $s1. " -22";
}
else if($_POST[‘rooms’]==“3”)
{
$s1=300;
echo “
”;
//echo $s1. " -23";
}
else if ($_POST[‘rooms’]==“4”)
{
$s1=400;
echo “
”;
//echo $s1. " -24";
}

echo “
”;

echo “
”;
echo “
”;
$price=$numbersdays*$s1;

<?[/php]

OK. You want a code that will display the users how much the room costs and how many are left??? Am I right?

Just is room free or occupied.

I recommend keeping a database of all your customers. Anyways here is the code, I hope this is what you intended :-X
[php]<?php

/*
I am assuming you are not using any database, therefore you have to manually set the room availability value to “Available” or “Unavailable”
*/

$room1 = “Available”;
$room2 = “Available”;
$room3 = “Available”;

if (isset($_POST[‘rooms’]) && $_POST[‘rooms’] == “1”){

  if ($room1 == "Available"){

    echo "This room will cost you 100 Euros";
  } else {

    echo "Sorry the room you selected is occupied at the moment";
  }

}

if (isset($_POST[‘rooms’]) && $_POST[‘rooms’] == “2”){

  if ($room2 == "Available"){

    echo "This room will cost you 200 Euros";
  } else {

    echo "Sorry the room you selected is occupied at the moment";
  }

}

if (isset($_POST[‘rooms’]) && $_POST[‘rooms’] == “3”){

  if ($room3 == "Available"){

    echo "This room will cost you 300 Euros";
  } else {

    echo "Sorry the room you selected is occupied at the moment";
  }

}

?>[/php]

Can you give to me code if i have 30 rooms (rooms number one) which cost 100 euros,30 rooms (rooms number two) which cost 200 euros,30 rooms (rooms number three) which cost 300 euros.

www.webdesigngroup1999.com/dobar%20websajt/23.php
This is website where is booking engine.Tell me do you like and much money is worthy.

You mean if a user enters a room type for example it will show him room availability and price???
Are you intending to use any databases or not??

Yes i am going to use date base.

Any way date base is place where spouse to be check by dates is room available or not.

Well I can’t say about the price but I think it’s a simple script nothing fancy except for the drop-down calendar. If you want to use database then please share all your work in this thread so that I can evaluate where you stand and what needs to be done. :slight_smile:

hahaha… I meant database not date base. It’s a software where you can store all your customer’s record.

I do want post all my work,because it works which i am doing for six months,i know what is datebase very vell, you saw my website and i have everything ready but i need some code which will check datebase if i have 30(example) rooms number one,30 rooms number 2 and 3o rooms number 3.So if customer want book room number one 8/28/2013 by 8/29/2013(example )for price of 100 euros and it is 31 customers which want that,message coming out that all rooms occupied try room with different number.

I am using php admin datebase.

I was thinking to say i do no want post my work.Sorry

I tried the link you posted, but it doesn’t work for me.

www.webdesigngroup1999.com/dobar%20websajt/23.php
That’s link where is bookig engine.

I ??? have everything ready but i need some code which will check datebase if i have 30(example) rooms number one,30 rooms number 2 and 3o rooms number 3.So if customer want book room number one 8/28/2013 by 8/29/2013(example )for price of 100 euros and it is 31 customers which want that,message coming out that all rooms occupied try room with different number.

www.webdesigngroup1999.com/dobar%20websajt/23.php
This is link for booking engine.

Sponsor our Newsletter | Privacy Policy | Terms of Service