Page 1 of 1

Reservations via calendar

Posted: Sat Oct 01, 2005 3:44 am
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:

Posted: Sat Oct 01, 2005 8:25 am
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.

Posted: Sat Oct 01, 2005 8:46 am
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.

Posted: Sat Oct 01, 2005 2:33 pm
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