form for reservation

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hrubos
Forum Contributor
Posts: 172
Joined: Sat Oct 07, 2006 3:44 pm

form for reservation

Post by hrubos »

Actually I need a suggestion. I have to do a page about reservation, which is written by PHP.
And I have a form :
+ output all of room, in which is nobody from database in to a table
+ the last collumn of table is date, when traveller come to --> I want display a calendar and I can chose day on this calendar.

Ah, I have tried popup calendar but I have had error.

Anyway, who have a good link for this, so please send me!!!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I'm not sure what you're asking us. Is there a question?
hrubos
Forum Contributor
Posts: 172
Joined: Sat Oct 07, 2006 3:44 pm

Post by hrubos »

Yeah,
who would show me a solve for a calendar in my form.

Thank in advance
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You want a calendar, that's it?

:roll:

Have you searched for forums for "calendar" .. there's a few results.
hrubos
Forum Contributor
Posts: 172
Joined: Sat Oct 07, 2006 3:44 pm

Post by hrubos »

Thank much your answer
But I don't need a normal calendar.

Beside poup calendar in java script, what any thing else, which I can chose date in this calendar and get this variable to do for command sql.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Multiple drop-downs, text boxes..
hrubos
Forum Contributor
Posts: 172
Joined: Sat Oct 07, 2006 3:44 pm

Post by hrubos »

I have done this, but I got a error : calendar.select :input object passed is not a valid form input object
This is my code :

Code: Select all

<html>
<body>
<FORM name="example" action="../admin/stu_lend.php" method="POST" >
<table border =1 bordercolor="#CC0033" cellspacing=0 cellpading=5>
<?php
db_connect();            
$query = "SELECT DISTINCT id_thing,deposit,title,thing_store,place,time_interval
            FROM things ";

$result = mysql_query($query)or die(mysql_error());
$num=mysql_numrows($result);
mysql_close();
$i=0;
while($i<$num){

  $id_thing=mysql_result($result,$i,"id_thing");
  $deposit=mysql_result($result,$i,"deposit");
  $title=mysql_result($result,$i,"title");
  $thing_store=mysql_result($result,$i,"thing_store");
  $place=mysql_result($result,$i,"place");
  $time_interval=mysql_result($result,$i,"time_interval");
?>
 <tr>
 <?php
 echo "<td>$thing_store</td>";
 echo "<td>$place</td>";
 echo "<td>$deposit</td>";
 echo "<td>$time_interval</td>";
 echo "<td><div align= 'center'> <input type= 'radio' value = '$id_thing' name= 'id_numberRoom'></div></td>";
 ?>
   <td>
   <INPUT TYPE="text" NAME="date1" VALUE="" SIZE=10> 

<A HREF="#"
   onClick="cal.select(document.forms['example'].date1,'anchor1','MM/dd/yyyy'); return false;"
   NAME="anchor1" ID="anchor1">vybrat</A>
</td>
<?php
echo "<td><div align= 'center'> <input type= 'radio' value = '$id_thing' name= 'id_numberRoom'></div></td>";
$i++;
}
echo "</tr></table>";
?>
<p></p>
<input type="submit" name="lend" value="P&#367;j&#269;it si">
</form>
<?php
bottom_title();
?>
</body>
</html>
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Your code does not have a "cal" object for javascript.
hrubos
Forum Contributor
Posts: 172
Joined: Sat Oct 07, 2006 3:44 pm

Post by hrubos »

I have repaired :

Code: Select all

<html>
<head><SCRIPT LANGUAGE="JavaScript" SRC="../temp/js/CalendarPopup.js"></SCRIPT>
	<SCRIPT LANGUAGE="JavaScript">
	var cal = new CalendarPopup();
	</SCRIPT>
 </head><body>
...............
..................
</body>
</html>
but I have given the same message error
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Are you sure "cal" is being created?
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

you probably shouldn't have posted a new topic since this is basically the same as your last topic:
viewtopic.php?t=64486
hrubos
Forum Contributor
Posts: 172
Joined: Sat Oct 07, 2006 3:44 pm

Post by hrubos »

The Ninja Space Goat wrote:you probably shouldn't have posted a new topic since this is basically the same as your last topic:
viewtopic.php?t=64486
I'm sorry. I posted it here because I think I have had problem with code PHP.

@feyd : I'm sure "cal" has been created in calendar.js
Post Reply