Reservations via calendar

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
zbrdlowski
Forum Newbie
Posts: 2
Joined: Sat Oct 01, 2005 3:32 am

Reservations via calendar

Post by zbrdlowski »

I got this problem:

In my db (MySQL) I have 3 tables - Movies(all informations about films) , users, and orders (contains Movie ID, user ID and date of reservation). Is there any chance to implement these records from "orders" table into some Calendar or datepicker, so users can easily see which date is still available for current title ? My vision is that in this calendar will be this date highlited with red color, or this dates will be inactive, so you can´t klick on it. Could you give me some advises how to proceed in this ? pleeeeeeeeeeeeease :lol:
foobar
Forum Regular
Posts: 613
Joined: Wed Sep 28, 2005 10:08 am

Post by foobar »

Well, you should first insert an integer (of length 10) into your db table and call it "timestamp" or something along those lines. Then, you retrieve the data from the db into an array; followed by cycling through the array and printing out the stuff you want to (eg: a calender), and, depending on the timestamp, you either print an anchor (<a ... >...</a>) or you don't.

I hope that answered your question.
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

you could also search for event calendar I believe and you'll find a calendar system i posted a bit ago.damn thing is useful i tell ya.
zbrdlowski
Forum Newbie
Posts: 2
Joined: Sat Oct 01, 2005 3:32 am

Post by zbrdlowski »

Thanx guys.
I did it like you said. I put to that table column "date" size "10" Now I need put these db records here:

Code: Select all

echo "<td align=center";
            if (($d == $thisDay) && ($mon == $thisMon)) :
            echo " BGCOLOR=\"red\"><font color=black> $d </font>"; // highlight current day
            else:
            echo " BGCOLOR=\"black\" class=kale><a href=\"#\">$d</a> ";
            endif;
            echo "</td>";
I have to put there:

Code: Select all

elseif ($d= ... //I don´t know what. Tell me if you know.//
At the top of the page I have this:

Code: Select all

require_once ('mysql_connect.php');
$query = "SELECT * FROM orders WHERE movie = $ID";
$result = @mysql_query ($query);
here I need to get these date record into some variables which could be compare in that

Code: Select all

elseif ($d= ...
field. Could you gimme some clue how to write this ?
Thanx
Post Reply