The calendar has it’s own database and my site has it’s own as well. I need to synchronize them so when I select a date duration, it automatically calculates the price for the duration selected.
Please help.
This is the code for the page with the calendar…
[php]
Pick Start Date |
Pick end date |
|
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
<?
for($ci=$i=date(‘Y’);$i<=$ci+10;$i++) {
print " <option value="$i">$i\n";
}
?>
|
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
<?
for($ci=$i=date(‘Y’);$i<=$ci+10;$i++) {
print " <option value="$i">$i\n";
}
?>
|
Price for duration: $
<?php if($pamount!='0.00') echo $resproduct_fetch['price_status']." ".$pamount; else echo "N/A";?>
</strong> </td>
</tr>
<tr>
<td height="13" colspan="3" style="font-size:8pt;"> <table>
<tr height=11pt>
<td bgcolor="#bbbbbb" style="height:11pt;width:11pt;"> </td>
<td style="font-size:8pt;">Unavailable</td>
<td bgcolor="red" style="height:11pt;width:11pt;"> </td>
<td style="font-size:8pt;">Booked</td>
<td bgcolor="green" style="height:11pt;width:11pt;"> </td>
<td style="font-size:8pt;">Available</td>
<td bgcolor="navy" style="height:11pt;width:11pt;"> </td>
<td style="font-size:8pt;">No price set</td>
</tr>
</table></td>
</tr>
<tr>
<td height="13" colspan="3" style="font-size:8pt;">You can also select the duration of your rental by clicking on the calendar.</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td align=center>
<?
print “
”;
for($i=0;$i<3;$i++) {
print “
”;
for($j=0;$j<4;$j++) {
print "<td>";
$cal->SetDate($month,$year);
$cal->Show();
$month++;
if ($month==13) {
$month=1;
$year++;
}
print "</td>";
}
print “
”;
}
print “
”;
if ($page>1) {
$prev=$page-1;
print “<a class=“link” href=”".$_SERVER[‘PHP_SELF’]."?p=$prev">Prev ";
}
if ($page>=1) {
$next=$page+1;
print “<a class=“link” href=”".$_SERVER[‘PHP_SELF’]."?p=$next">Next";
}
?>
|
[/php] |
|