Check Room Availability System
I am super new to php/mysql etc. i am just trying to do a room availability system.
I have 5 rooms in 5 different category. i like to know how to design a DB and write a php that takes two different dates[checkin date / checkout date] and verifies the DB for availble rooms.
View Complete Forum Thread with Replies
Related Forum Messages:
Checking Room Availability For Hotel Booking System
I was wondering if anyone could help me with a problem I'm having. I've been using Dreamweaver to create a hotel booking system for a friend of mine, using MySQL (version 4.0.21) and PHP 5. The bit I'm struggling with is checking the Room Availability based on dates that are typed into a textfield and then returning a list of the available rooms on the next page. The three tables involved in this function are: CREATE TABLE `room` ( Room_Number tinyint(1) UNSIGNED NOT NULL, Price_Double_per_Night decimal(5,2) NOT NULL, Price_Twin_per_Night decimal(5,2) NOT NULL, Price_Single_per_Night decimal(5,2) NOT NULL, Price_Double_per_Week decimal(5,2) NOT NULL, Price_Twin_per_Week decimal(5,2) NOT NULL, Price_Single_per_Week decimal(5,2) NOT NULL, PRIMARY KEY(`Room_Number`), ) TYPE=InnoDB ROW_FORMAT=fixed; CREATE TABLE `room_booking_link_entity` ( Room_Number tinyint(1) UNSIGNED NOT NULL, Room_Booking_ID int(11) NOT NULL, Single_Double_Twin enum('Single','Double','Twin') NOT NULL, PRIMARY KEY(`Room_Number`, `Room_Booking_ID`), INDEX `Room_Number`(`Room_Number`), INDEX `Room_Booking_ID`(`Room_Booking_ID`), FOREIGN KEY `Reference_14`(`Room_Number`) REFERENCES `room`(`Room_Number`) ON DELETE NO ACTION ON UPDATE NO ACTION, FOREIGN KEY `Reference_85`(`Room_Booking_ID`) REFERENCES `room_booking`(`Room_Booking_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION ) TYPE=InnoDB ROW_FORMAT=fixed; CREATE TABLE `room_booking` ( Room_Booking_ID int(11) NOT NULL AUTO_INCREMENT, Customer_ID int(11) NOT NULL, Bill_ID int(11) NOT NULL, Date_of_Arrival date NOT NULL, Date_of_Departure date NOT NULL, Number_of_Nights tinyint(3) NOT NULL, Date_Booking_Made date, Status_of_Booking enum('Booked','Arrived','Departed') NOT NULL, Total_Cost decimal(7,2) NOT NULL, PRIMARY KEY(`Room_Booking_ID`), INDEX `Room_Booking_ID`(`Room_Booking_ID`), INDEX `Customer_ID`(`Customer_ID`), INDEX `Bill_ID`(`Bill_ID`), INDEX `Date_of_Arrival`(`Date_of_Arrival`), INDEX `Date_of_Departure`(`Date_of_Departure`), INDEX `Status_of_Booking`(`Status_of_Booking`), FOREIGN KEY `Reference_03`(`Customer_ID`) REFERENCES `customer`(`Customer_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION, FOREIGN KEY `Reference_14`(`Bill_ID`) REFERENCES `bill`(`Bill_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION ) TYPE=InnoDB ROW_FORMAT=fixed; I've just discovered that MySQL 4.0.21 does not support subqueries. I'm basically stuck with this version of MySQL. I think I've got round the subquery problem by using a multi query option as follows: 1.Create a temptable that will store all of the room numbers that have bookings for the particular dates requested as follows: SELECT DISTINCT a.room_number INTO temptable FROM booking_link_entity AS a INNER JOIN room_booking AS b WHERE b.departure_date >$_POST[‘ARRIVAL'] And b.arrival_date < $_POST[‘DEPART']; 2.Left join this with the room table and pull out rows with no match SELECT a.room_number, b.room_number FROM room AS a LEFT JOIN temptable AS b ON a.room_number=b.room_number WHERE b.room_number IS NULL; 3.Delete temp table I've tried doing this in Dreamweaver, but to no avail. I have a feeling it is too complex for Dreamweaver. My php knowledge is very basic and was wondering if anyone could give me some pointers as how to do this in PHP?.
View Replies !
Room Booking System
Loooking for a simple script to help reserve rooms in a building, 10 rooms where some times are booked week - on - week and also have two diffrent time tbale weeks?
View Replies !
Check Availability Button
I have a form that accepts user info. I want to create a button that enables the user to check for the availability of the username entered before continuing with the rest of the form. I have tried using the button onclick to call a JS function. The JS function have codes to compare the username with database select.
View Replies !
File Check-in/check-out System?
I'd like to a build a PHP-based interface for sharing documents (MS Office docs, latex, etc). I need to be able to allow users to "check-out" the files for their exclusive use and then go through a "check in" process when they re-upload the doc so it's accessible again to everyone else. I'd also like to implement some form of version control where older versions of the docs can be in some sort of repository. I'm not quite sure how to approach either concept. I'm wondering if anyone can give me tips on how I might go about this.
View Replies !
Message System - Do A Mysql Query And Check Against A Flag?
I am creating a small message system for internal use for my IT dept. We want a graphical notification for new messages. We have a link that says SonoMail and when a new message or when there are un-read messages we want a small graphic of an envelope to appear. I just need to be pointed in the right direction to get started. should I do a mysql query and check against a flag? and how would I do that with out a while loop so the graphic only appears once? thanks for your help and I hope I explained things well enough.
View Replies !
PEAR Availability
I'm starting to look into PEAR, and it looks like there's some interesting stuff in there. I'm wondering how much I can rely on it for a distributed app. If I understand correctly, it's now included in the PHP distro, and installed by default. What version did this start with? Is the default installation just the base class, or are some of the packages included as well? The tricky question is: does anyone have any idea of how commonly it's installed? Do most hosting companies provide it? I know end users can install it for themselves, but I have enough support issues without having to hold users' hands on that.
View Replies !
PHP Availability Calendar
Do you guys know somewhere where i can find a script which creates a Calendar which can be controled via a database, so if a date is "occupied" then the date will be marked at BOOKED.
View Replies !
Availability Checker
I'm trying to build a site for Broadband and I am wanting to put a Broadband availability checker on my site like alot of other site have, However i am quite new to PHP. Could someone point me in the right direction as how to go about producing the above?
View Replies !
Availability Calendar
where I could get a PHP based availability calendar for a holiday apartment website? I currently have the calendar as a html tables based affair that is updated via DW, but I am trying to migrate the site to PHP and wish to introduce a web based calendar that can be updated online. I am looking for something similar to http://www.lanzarotebreaks.com/vill...ar.php/3882.htm that displays in a table format but is controlled by PHP/MySQL, would like it to have online admin functionality. Am willing to learn how to handcode one if there are any good tutorials. Any help is gratefully received.
View Replies !
Php Chat Room On Irc
Does anyone know of the name of the mirc server address, that i can connect to to join a php chatroom where people talk about php. i used to go in to one, but I have new computer and have lost the detail.
View Replies !
No Room To Explain
Right now when I use this script <? ' echo $row['name']; echo '- ' ?><? ' echo $row['category']; echo '- ' ?>TITLE OF MY SITE I get this when there is no 'name' or 'category' --TITLE OF SITE I want it so that - only shows if there is indead a 'name' or 'category'.
View Replies !
Availability Script
i have a number of villas in spain but id like to be able to show there availability online to prosepctive clients to cut down on wasting there time when a particular villa is not available! i need to be able to show booked and available periods from anything from 1 day to two months, does anyone know i way i could do this, are there any ready made scripts out there doing this.
View Replies !
Irc Php Chat Room
I used to use a IRC and go in to a php chat room, does anyone know of the IRC network that i need to connect to to talk to other people interested in php.
View Replies !
PEAR Availability On Web Hosts
Just wondering if anybody knew the availability of PEAR classes on most web hosts... i mean like if i write a script using say the PEAR db abstraction class, would most web hosts have the PEAR class installed and in the include_path so that my script would work?
View Replies !
Simple Room Booking App?
I'm lazily looking for a simple app that will let us match up teachers, classes, and instructors, preferably with a php/mysql infrastructure so that it's accessible via the web. If there is a single good repository of free scripts that would be useful as well.
View Replies !
Chat Room Needed
I'm in a need of a chatroom for my website, and I'm assuming PHP would be the best option. There is one feature I must have: I need to be able to assign a user mod powers so any time he logs in, he'll have that power. I also would like for his text to show up in a different color than everyone else's.
View Replies !
Small Bug With My Chat Room.............................................. .....
Take a look at PHP chat with no login screen! Try changing your alias from guest, and click the SEND button, it works. But change it and then press ENTER and the input frame dissapears . This is the main parts of the message and alias text boxes, they are in different forms, how can I stop it going blank when people hit enter? ************************************************** ** <FORM NAME="MsgForm" ACTION="<?php echo($action); ?>" METHOD="POST" AUTOCOMPLETE="OFF" TARGET="<?php echo($target); ?>" onSubmit="return window.parent.validateSubmission();"> <INPUT TYPE="text" NAME="M" SIZE="45" taborder=1 tabindex=1 MAXLENGTH="299" VALUE="<?php echo(htmlspecialchars(stripslashes($ValM))); ?>"> <INPUT TYPE="hidden" NAME="sent" VALUE="0"> <INPUT TYPE="submit" NAME="sendForm" VALUE="<?php echo(L_OK); ?>"> </FORM> <form name="aliasform"> <INPUT TYPE="text" NAME="ZU" SIZE="5" MAXLENGTH="29" VALUE="<?php echo(htmlspecialchars(stripslashes(urlencode($U))) ); ?>"> </form> ************************************************** ** Can I detect if they hit Enter while in the alias text box, then set focus somewhere? Its like it submits a blank form and goes nowhere. is there a setting I can use on <form name="aliasform"> to stop that?
View Replies !
PHP Chat Room Server
I'm looking for a chatroom server - one that has an API, so I can use a non-web GUI. All searches on Google have yielded the wrong stuff.
View Replies !
Varying Availability Of Libraries
I'm having problems connecting to postgres via php. Error message = 'undefined function' when I make the call to pg_connect. I have modified the php.ini file to enable the extension=php_pgsql.dll line. The .dll in question exists in both windows and the defined php extensions directory. I have confidence that the php.ini file in question is the one in use by Apache (if I rename, everything bombs). Code:
View Replies !
Writing Pseudo For Availability
creating an online store for a project in on of my classes. I've searched around and cant really find how to create some availability scripts. How can I create a script to check our database on whether certain things are available? Any suggestions? Just asking for a good starting point.
View Replies !
Very Simple Chat Room
I would like to set up a very simple chat room for my daughter to use with her friends. I am reasonably competent in PHP and MySQL and was wondering if anybody could suggest a simple way to create a script. The obvious way using what I alredy know would be to have the page auto refresh at regular intervals but I can think of several disadvantages of having the chat updated in this way. Is there an alternative way to update new message without refreshing the whole page?
View Replies !
A Busy PHP Chat Room
I know phpfreaks has its own chat room but whenever I visit its only got about 18 vistors and no chat going on! Anyone know of a bigger and more active php chat room?
View Replies !
Date Columns Availability
I done an availabilitycheck that until now seems to work just perfect, except 1 problem. For exampel in the database if I have an booking in datecolumns llegada and salida dates 25/11 and 15/12, I would like the days 25/11 and 15/12 to be marked as available. This is the code I have: $result = mysql_query ("SELECT llegada, salida, propiedad from bookings where ( propiedad = '$propiedad' ) AND (('$llegada' BETWEEN llegada AND salida) or ('$salida' BETWEEN llegada AND salida) or (llegada < '$llegada' AND salida > '$salida') or (llegada > '$llegada' AND salida < '$salida'))", $dbh); In this piece of the code this is what I would like to do but don´t work: ('$llegada' BETWEEN llegada AND salida-1) or ('$salida' BETWEEN llegada-1 AND salida)
View Replies !
Calender - Availability Chart
I have availability on my site in an calendar and I manually introduces if available for that day or not. But I want to do it autmatically. At the moment I have the reservations in an database table, I have arrival in one column and departures in another column, both date types.
View Replies !
Members To Chat Room
i have got a website and I want members to log in to the chatroom when when they are loged in to the website without having to enter a nick name I know it is something like <param name="username" value="<?php print("$sql_array->member[ID]"); ?>"> <param name="password" value="<?php print("$sql_array->member[Password]"); ?>">
View Replies !
Redirection And Server Availability
I have two servers, one hosted and one local. My local server uses dynamic dns and I am trying to write a script on my hosted server that will check to see if my local server is accessible. If it is accessible I would like the script to do a browser redirect to my local server. If the connection can't be made I would like the script to be in the header of an index page on the hosted server or redirect to a valid page one the hosted server. From what I've found on the net it should be possible using socket() but am not sure how to go about it.
View Replies !
Chat Room For Paid Members
I have a dating site that I want to put a chat room on. I just want the paying members to be able to have access to it. I already have the chat room installed on the site. Whats the best way to go about doing this? I understand that you have to use cookies but I have no clue how to put that in the coding. Is there a reference where I can look it up?
View Replies !
System(); Command Not Working On Remote System. Windows.
My server is a windows machine, on the same domain as python(also a windows machine). Apache is running as a service as an administrator. This is a test only environment to whom it may concern(I hate people telling me how insecure my system is) I'm just trying to run: $last_line = exec('dir pythonc$', $retval, $g); print_r($retval); echo '<br>'.$g.'<br>'; echo '$last_line= '.$last_line.'<br>'; Which outputs: Array ( ) 1 $last_line= The command from the command line works fine. And apache can access directories that only administrators can access on the local machine.
View Replies !
Add A Drop Down Menu For Check In And Check Out Date
i have done a booking system and want to add a drop down menu for check in and check out date. I have done the drop down menu and the date display in is today's date. I wanted to make the the date 3 days in advanced of todays date. <select name="dayIn" > <? for ($i=1;$i<=$days;$i++) { if($i == $_POST['dayIn']) { ?> <option value="<?=sprintf('%02d', $i)?>" selected><?=$i?></option> <? } else if($_POST['dayIn'] == "" && $i==date(d)){?> <option value="<?=sprintf('%02d', $i)?>" selected><?=$i?></option> <? } else { ?> <option value="<?=sprintf('%02d', $i)?>"><?=$i?></option> <? } } ?> </select> and here is my code for check out: <td>Check-out date</td> <td> </td> </tr> <tr> <td><select name="dayOut"> <? #$nextDayOut=$_POST['dayIn']+1; $nextDayOut = date('d', strtotime('+1 days')); for ($i=1;$i<=$days;$i++) { if($i == $nextDayOut) { ?> <option value="<?=sprintf('%02d', $i)?>" selected><?=$i?></option> <? } else { ?> <option value="<?=sprintf('%02d', $i)?>"><?=$i?></option> <? } } ?> can anyone help me figure this thing out?
View Replies !
Login System - News System
i have to do a news system wich use php/mysql. i need 3 accounts: * a 'reader' who doesn't need to log in to read the news * a 'writer' who can write news in a pending news table * a 'moderator' which validate a pending news, and make it a regular news, viewable from the site (by the 'reader') This is a small web site, so i can't use SSL; and i use php sessions. Right now, i deal with account from a mysql users point of view, which means, that a 'reader' can access all the admin part of the site, but will ger errors when trying to read/write by sql query. I was wondering if somedody could give me a trick to deny access to the admin pages. Rigth now, i though about these: * by decoding mydql rights? (how) * by doing only-to-test query? (bad i think, especially for write right)
View Replies !
Sort Of IP Check Or Other Security Check
Do sessions already do some sort of IP check or other security check or do I have to do this manually? My problem is that I want to use sessions to log in users to my message board. My concern is that a non-cookie user, we'll call her Mary, will post a link to another message at my site and that link will include her session id. If someone else, call him John, clicks on that link, will John now have the same session id as Mary? Or are sessions smart enough not to let that happen?
View Replies !
$system = New Java('java.lang.System');
I am trying to get Java to work from within PHP. I have been looking at: http://us2.php.net/java The error and line of PHP code: $system = new Java('java.lang.System'); Fatal error: Class 'Java' not found in C:Documents and SettingsEd TaylorMy DocumentsProjects Eclipseworkspacesworkspace PHPScrapboardJavaExample.php on line 3 I have looked at the 'User Contributed Notes'. It seems there is a proliferative of different way people have defined the Java configuration options. Some have links in quotes some do not. Not sure if I am suppose to use the eight byte Windows dir name? I am a Java programmer. Sun's JAVA_HOME points to the base directory name for the JDK installed. In PHP it looks like it points to the bin subdirectory. This is what is documented: java.class.path The path and name of the PHP jar file (usually called php_java.jar) as well as any other jar files or directories where PHP will search for compiled Java classes. java.home The root directory of the installed JDK java.library The location of the Java virtual machine library java.library.path The location of the PHP java library (usually in the modules/ directory) This is what I have defined in my PHP.ini: extension=php_java.dll java.class.path = "C:php5.2extphp_java.jar" java.home = "C:Program FilesJavajdk1.5.0_07" java.library = "C:Program FilesJavajdk1.5.0_07jreinserverjvm.lib" java.library.path = "C:php5.2ext" I am running: - Windoze XP SP 2 - PHP 5.2 - Java JDK and JRE 1.5.0_07 - Eclipse 3.2 - PHPEclipse 0.2.0
View Replies !
MLM System
Is there anyone who has developed some online MLM System, i need to develope a system where i need to calculate the total numbers of members in the downline both, seperately for left and right leg. This system works on 2 x 2 matrix.
View Replies !
Pat System..
How would you use patsystem for your templates in php? How would it make it easier? Where can i learn more about this? Also, Is their a script for making a today's featured sites? Thanks a lot.. I am learning more php with my books, i also want some good tutorials online.
View Replies !
Doc System...
Any one have any idea where I ca get a documentation system like the one php.net uses? Have a list (and sub lists) of topics, display details about a topic, and allow users to BLOG that item at the bottom.
View Replies !
An API System?
I am creating widgets on my website. but right now I am limited. because the ones I have are hard coded into the page. Like (if i have the notepad widget, then show it here), etc. How would I make an API type system to allow people to make their own, similar to Facebok, Google, and now Meebo. Well not like Google. more like Facebook.
View Replies !
System?`
I need i Affiliate tracking system so i can see what person there have registered on my sponsers products like mattcashback and other rewards site. Is there somewhere i can but i system like that?
View Replies !
POS System
it is possible to use PHP to built a POS system which connect to cashier and bar code scanner ?? Any information related to this?
View Replies !
CRM System
May be somebody have any wish to make a CRM system with me? It would be great if you have experience in a pear or some other high level scripts for php.
View Replies !
A Help System
I am developing a CMS/web-building website, and I need to include a good help system to help my customers learn how to use the features of what my project offers. Does anyone have suggestions about what help products I could incorporate into my site? I want the standard outline system, with a column showing chapters, an index, and search box.
View Replies !
System() Help
Having a bit of an issue here. I am wanting to do a database backup using the system command. This is the command I am runing: $systemcmd="mysqldump -hlocalhost -uuser -ppass db_name > backups/`date +\%d-\%Y--\%H:\%M`-Backup.sql"; system($systemcmd,$retval); echo $systemcmd."<br>"; echo $retval."<br>"; The command works fine from SSH, but when running the system function, all that gets returned is the number 1 from $retval (outputs $systemcmd fine as well). No backup is made using system(). Can anyone think of a reason as to why this is happening?
View Replies !
System()
I try to do a mysql backup using mysqldump. I've written a php script that uses system() to execute mysqldump. I have two unix servers and the script runs fine on the frist one but fails without any error on the second server. I have following script to test it: ---------------------------------- <?php print system ('/usr/bin/mysqldump --opt -u user -ppassword database 2> /home/user/public_html/backup/error.txt | gzip > /home/user/public_html/backup/bck120404.sql.gz'); ?> ---------------------------------- This script doesn't return anything. No error.txt and no bck120404.sql.gz are written. It's a unix server and register_globals is off. All directories should be fine and "print system ('ls');" runs ok. I also tried exec(), passthru() and shell_exec().
View Replies !
|