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
Reservations via calendar
Moderator: General Moderators
-
zbrdlowski
- Forum Newbie
- Posts: 2
- Joined: Sat Oct 01, 2005 3:32 am
Reservations via calendar
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
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
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.
I hope that answered your question.
-
Charles256
- DevNet Resident
- Posts: 1375
- Joined: Fri Sep 16, 2005 9:06 pm
-
zbrdlowski
- Forum Newbie
- Posts: 2
- Joined: Sat Oct 01, 2005 3:32 am
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:
I have to put there:
At the top of the page I have this:
here I need to get these date record into some variables which could be compare in that field. Could you gimme some clue how to write this ?
Thanx
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>";Code: Select all
elseif ($d= ... //I don´t know what. Tell me if you know.//Code: Select all
require_once ('mysql_connect.php');
$query = "SELECT * FROM orders WHERE movie = $ID";
$result = @mysql_query ($query);Code: Select all
elseif ($d= ...Thanx