
localhost1
Members-
Posts
37 -
Joined
-
Last visited
Never
Everything posted by localhost1
-
hi every body i have a problem in downloading swf file. when i click on the icon to download the swf file then it downloads but the file is blank and not showing any flash aniimations. my code is as follows $filepath="userdownloads/bulletin.swf";; $filename="bulletin.swf"; downloadFile($filename,$filepath); function downloadFile($filename,$filepath) { header("Content-type: application/x-swf-flash"); header("Content-disposition: attachment; filename=".$filename); header("Content-Length: " . filesize($filepath)); header("Pragma: no-cache"); header("Expires: 0"); readfile($filepath); return; }
-
you use logical or instead of logical and. change above code to f (!document.inputForm.radio[0].checked || !document.inputForm.radio[1].checked)
-
first pls tell me what do u want to do
-
actually i wanted to ask if there is any error in any one of above lines be it css or javascript. i mean to ask the error in link to javascript or css lines which might be the reason why my css and javascript calendar is not working
-
hi all i have a serious proble in one of the pages where i have to pop up a calendar when buton is clicked. this is exactly working in local host but not working online. i have doubt on following link to javascript pages. pls look at this if here is any error <link href="../css/common.css" rel="stylesheet" type="text/css" /> <link href="../css/visionary.css" rel="stylesheet" type="text/css" /> <link type="text/css" href="../css/calendar-win2k-cold-1.css" rel="stylesheet"> <script type="text/javascript" src="../js/common.js" ></script> <script type="text/javascript" src="../js/calendar.js"></script> <script type="text/javascript" src="../js/calendar-setup.js"></script> <script type="text/javascript" src="../js/calendar-en.js"></script> <script language="javascript" type="text/javascript" src="../js/wysiwyg.js"></script> <script language="javascript" type="text/javascript">vLangue=1;vWeekManagement=00;</script> <script language="javascript" type="text/javascript" src="../js/popcalendar.js"></script> <script language="javascript" type="text/javascript">dateFormat='yyyy/mm/dd'</script>
-
hi every body this is not the problem in HTML tather it is in PHP. What I want to do is keep some space between the lines in the paragraph and the paragraph is defined not in the page where the text is to be displayed but in the admin part(CMS ) itself. how can i do it. the code with which the text added in CMS is displayed in front is like this. here in this code all the things written inside <? ?> are responsible for fetching the CMS texts foreach($row1 as $res){ $string=$res->page_description; $stringlength =strlen($string); $pos=strpos($string,"COMMENT"); //echo $pos; $len=strlen("COMMENT J'AI DECOUVERT LA TAROLOGIE:"); if(isset($pos)) { $str1=substr($string,0,$pos); $str2="COMMENT J'AI DECOUVERT LA TAROLOGIE:"; $str3=substr($string,-($stringlength-($pos+$len)),($stringlength-($pos+$len))); } elseif($stringlength<=500) { echo "true1"; $sec= $string; } else { $thd=substr($string,0,500); $frth=substr($string,-($stringlength-500),($stringlength-500)); } ?> <td valign="top" style=" width:163px; background:url(images/left_bg.jpg) repeat-y"><img src="images/left_img.jpg" alt="" width="163" height="537" /></td> <td align="center" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td valign="top" > </td> <td align="center" valign="top" > </td> </tr> <tr> <td align="center" valign="top" class="contentfront" ><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center" class="content_heading_top"> TAROLOGIE</td> </tr> <tr> <td align="center" class="content_heading_top"> </td> </tr> <tr> <td align="left" class="content" style="padding-left:10px; width:340px"><p align="justify" style=""> <? if(isset($str1)) { echo $str1; } elseif(isset($sec)) { echo $sec; } else echo $thd; ?> </p></td> </tr> </table></td> <td align="center" valign="top" ><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> </td> </tr> <tr> <? foreach($row1 as $pg){?> <td align="center" valign="top"><img src="<? echo $pg->page_picture;?>" alt="" width="194" height="266" /></td> <? }?> </tr> </table></td> </tr> <tr> <td colspan="2" align="left" valign="top" class="contentfrontchiromancie" style="padding-left:10px; padding-right:10px "><? echo "COMMENT J’AI DECOUVERT LA TAROLOGIE:";?></td> </tr> <tr> <td colspan="2" align="left" valign="top" class="contentfront" style="padding-left:20px; padding-right:10px" > <? if(isset($str3)) { echo $str3; } else echo $frth; ?> </td> </tr> </table></td> <td valign="top" style="width:156px; background:url(images/right_bg.jpg) repeat-y"><img src="images/right_img.jpg" alt="" width="156" height="538" /></td> <? } ?>
-
hi all i m the beginner in web programming. i fwant to know more about the metatag in HTML. and how it is used for searching. is it possible to learn this in friendly manner?
-
you modify this code for ($i=0; $i<count($Name);$i++) { echo $Name[$i] . ' - ' . $Stock[$i] . ' - ' . UserID[$i] . ' - ' . Price[$i]; } to following for ($i=0; $i<count($Name);$i++) { echo $Name[$i] for ($j=0; $j<count($Stock);$j++) { echo $Stock[$j] . ' - ' . UserID[$j] . ' - ' . Price[$j]; }
-
when u click a button with name submit u write the following query in the page $sql="insert into table_name values(value1,value2,....)"; mysql_query($sql); try this
-
another method is that u can use explode function php to separate strings n then compare the corresponding values of the date
-
changing css in the calender date(urgent)
localhost1 replied to localhost1's topic in PHP Coding Help
yes i have checked the database too. the date format is also exactly in the same format of 03. thanks -
changing css in the calender date(urgent)
localhost1 replied to localhost1's topic in PHP Coding Help
do i have to change in this part of code? $string=$row['holiday_date']; is it overlapping the looping value? -
changing css in the calender date(urgent)
localhost1 replied to localhost1's topic in PHP Coding Help
yes i exactly did like this but i think there r errors in other parts also as the calender is not changing thank you very much -
changing css in the calender date(urgent)
localhost1 replied to localhost1's topic in PHP Coding Help
dont i have to make changes in the place where i have echoed the calender dates? it is still not changing -
changing css in the calender date(urgent)
localhost1 replied to localhost1's topic in PHP Coding Help
thanks but the code is still not working. color of all the dates are changing -
changing css in the calender date(urgent)
localhost1 replied to localhost1's topic in PHP Coding Help
hi all this problem of mine really needs an urgent help. i have code in which i need to change the color of the date which is holiday of an organization. and the holiday date is determined from the value added in the database which is done from admin panel. Now what i want to do is read all the dates from the database which are inserted from admin panel and check the date with each dates of the calender. if the date from the database is same with the dates of the calender then give another CSS class for the date. my previous code in which simple calender is displayed where no holidays is considered is like this <?php ob_start(); require_once("config.php"); require_once("user_info.class.php"); if(isset($_REQUEST['mon'])) $month=$_REQUEST['mon']; else $month=date("n"); if(isset($_REQUEST['yr'])) $year=$_REQUEST['yr']; else $year=date("Y"); $date=date("d"); function DisplayCalender($id,$month,$year) { $bankHolsThisYear = calculateBankHolidays($year); $date=date("d"); $month_curr=date("n"); $year_curr=date("Y"); $cnt=count($bankHolsThisYear); $date_class="cal_font"; $symbol1="car_sym"; $symbol2="sym2"; $gender=""; $sdate=$year."/".$month."/01"; $edate=$year."/".$month."/31"; echo"<table border=0 cellspacing=0 cellpadding=0 align=center width='275px'>"; echo"<tr><td class=cal_head align=center>Dim</td><td class=cal_head align=center>Lun</td><td class=cal_head align=center>Mar</td>"; echo"<td class=cal_head align=center>Mer</td><td class=cal_head align=center>Jeu</td><td class=cal_head align=center>Ven</td><td class=cal_head align=center>Sam</td></tr>"; $day= date("D",mktime(0, 0, 0,$month, 1,date("y"))); $no=1; $dayno=0; echo "<tr>"; switch($day) { case "Sun": break; case "Mon": $dayno=1; break; case "Tue": $dayno=2; break; case "Wed": $dayno=3; break; case "Thu": $dayno=4; break; case "Fri": $dayno=5; break; case "Sat": $dayno=6; break; } for($i=0;$i<$dayno;$i++) { // this is for first row image... echo '<td class=cal_mes_bg align="center"> </td>'; } if($dayno==0) $class_bg="cal_dimanches_bg"; else $class_bg="cal_mes_bg"; if($date==1 && $year_curr==$year && $month_curr==$month) { $class_bg="cal_current_bg"; $date_class="cal_font_current"; $symbol1="car_curr"; $symbol2="curr_sym"; } echo"<td align=\"center\"> <table width=\"92%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td> </td> <td align=\"center\" valign=\"middle\" class=\"cal_font\"><a href=\"#\" onClick=\"return popup('reservation.php?myseldate=1".'-'.$month.'-'.$year."', 'v1', '300', '266')\" onMouseOver=\"ajax_showTooltip('view_reservation.php?myseldate=1".'-'.$month.'-'.$year."',this);return false\" onmouseout=\"ajax_hideTooltip();\" class=".$date_class.">1</a></td> <td style=\"width:3px\"></td> </tr> <tr> <td colspan=\"3\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td colspan=\"2\" style=\"height:8px\"></td> </tr> </table></td> </tr> </table> </td>"; //} // end of else $no=$dayno+1; if($month==4||$month==6||$month==9||$month==11) $max=30; else if($month==1||$month==3||$month==5||$month==7||$month==8||$month==10||$month==12) $max=31; else if($month==2) { $x=$year%4; if($x==0) $max=29; else $max=28; } for($i=2;$i<=$max;$i++) { if($no==7||$no==14||$no==21||$no==28||$no==35) { $class_bg="vaskar"; echo"<tr>"; } else { $class_bg="cal_mes_bg"; } //$edate=$year."/".$month."/".$i; $date_class="cal_font"; /*$symbol1="car_sym"; $symbol2="sym2";*/ if($i==$date && $year_curr==$year && $month_curr==$month) { // save the curr date in session $_SESSION['mycurrdate']=$year_curr.'-'.$month_curr.'-'.$i; $_SESSION['myselecteddate']=$month_curr.'-'.$year_curr; $_SESSION['currmonth'] = $month_curr; $_SESSION['curryear'] = $year_curr; $class_bg="cal_font_current"; $date_class="cal_font_current"; //$symbol1="car_curr"; //$symbol2="curr_sym"; } // changed here /* if(checkEvent($gender,$edate)=="true") { echo"<td class=gen><a href='eventsearchlist.php?sflag=2&gender=".$gender."&type=2&edate=".$edate."'>".$i."</a></td>"; } else {*/ echo "<td class=".$date_class."> <table width=\"25\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\"> <tr> <td> </td> <td align=\"right\" valign=\"top\" class=".$date_class.">"; if (@$_SESSION['logged_in']==true) { echo "<a href=\"#\" onClick=\"return popup('reservation.php?myseldate=".$year.'-'.$month.'-'.$i."', 'v1', '300', '266')\" onMouseOver=\"ajax_showTooltip('view_reservation.php?myseldate=".$year.'-'.$month.'-'.$i."',this);return false\" onmouseout=\"ajax_hideTooltip();\" class=".$class_bg.">".$i."</a>"; } else { echo "<a href=\"#\" onMouseOver=\"ajax_showTooltip('view_reservation.php?myseldate=".$year.'-'.$month.'-'.$i."',this);return false\" onmouseout=\"ajax_hideTooltip();\" class=".$class_bg.">".$i."</a>"; } echo "</td> <td style=\"width:3px\">"; $_SESSION['mydate']= $i; echo " </td> </tr> <tr> <td colspan=\"3\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td colspan=\"2\" style=\"height:8px\"></td> </tr> </table></td> </tr> </table> </td>"; // } // end of else $no=$no+1; } $cross=0; $day_last= date("D",mktime(0, 0, 0,$month, $max,date("y"))); switch($day_last) { case "Sun": $cross=6; break; case "Mon": $cross=5; break; case "Tue": $cross=4; break; case "Wed": $cross=3; break; case "Thu": $cross=2; break; case "Fri": $cross=1; break; case "Sat": break; } for($i=0;$i<$cross;$i++) { echo '<td class=cal_mes_bg align="center"> </td>'; } echo"</table>"; } function CheckEvent($gender,$fromdate) { // $rs=mysql_query("select * from event where gender='".$gender ."' and edate='".$fromdate."'"); //$rsNum=mysql_num_rows($rs); $rsNum=""; if($rsNum!=0) { return "true"; } else { return "false"; } } function calculateBankHolidays($yr) { $bankHols = Array(); $yr = 2000; // New year's: switch (date("w", strtotime("$yr-01-01 12:00:00")) ) { //switch ( getdate("w", strtotime("$yr-01-01 12:00:00")) ) { //this is line 413 case 6: $bankHols[] = "$yr-01-03"; break; case 0: $bankHols[] = "$yr-01-02"; break; default: $bankHols[] = "$yr-01-01"; } // Good friday: $bankHols[] = date("Y-m-d", strtotime( "+".(easter_days($yr) - 2)." days", strtotime("$yr-03-21 12:00:00") )); // Easter Monday: $bankHols[] = date("Y-m-d", strtotime( "+".(easter_days($yr) + 1)." days", strtotime("$yr-03-21 12:00:00") )); // May Day: if ($yr == 1995) { $bankHols[] = "1995-05-08"; // VE day 50th anniversary year exception } else { switch (date("w", strtotime("$yr-05-01 12:00:00"))) { case 0: $bankHols[] = "$yr-05-02"; break; case 1: $bankHols[] = "$yr-05-01"; break; case 2: $bankHols[] = "$yr-05-07"; break; case 3: $bankHols[] = "$yr-05-06"; break; case 4: $bankHols[] = "$yr-05-05"; break; case 5: $bankHols[] = "$yr-05-04"; break; case 6: $bankHols[] = "$yr-05-03"; break; } } // Whitsun: if ($yr == 2002) { // exception year $bankHols[] = "2002-06-03"; $bankHols[] = "2002-06-04"; } else { switch (date("w", strtotime("$yr-05-31 12:00:00"))) { case 0: $bankHols[] = "$yr-05-25"; break; case 1: $bankHols[] = "$yr-05-31"; break; case 2: $bankHols[] = "$yr-05-30"; break; case 3: $bankHols[] = "$yr-05-29"; break; case 4: $bankHols[] = "$yr-05-28"; break; case 5: $bankHols[] = "$yr-05-27"; break; case 6: $bankHols[] = "$yr-05-26"; break; } } // Summer Bank Holiday: switch (date("w", strtotime("$yr-08-31 12:00:00"))) { case 0: $bankHols[] = "$yr-08-25"; break; case 1: $bankHols[] = "$yr-08-31"; break; case 2: $bankHols[] = "$yr-08-30"; break; case 3: $bankHols[] = "$yr-08-29"; break; case 4: $bankHols[] = "$yr-08-28"; break; case 5: $bankHols[] = "$yr-08-27"; break; case 6: $bankHols[] = "$yr-08-26"; break; } // Christmas: switch ( date("w", strtotime("$yr-12-25 12:00:00")) ) { case 5: $bankHols[] = "$yr-12-25"; $bankHols[] = "$yr-12-28"; break; case 6: $bankHols[] = "$yr-12-27"; $bankHols[] = "$yr-12-28"; break; case 0: $bankHols[] = "$yr-12-26"; $bankHols[] = "$yr-12-27"; break; default: $bankHols[] = "$yr-12-25"; $bankHols[] = "$yr-12-26"; } // Millenium eve if ($yr == 1999) { $bankHols[] = "1999-12-31"; } return $bankHols; } ?> <script> function cal_prev(mon,yr,id) { if (mon==1) { mon=12; yr--; } else mon--; document.frm_cal_sm.action="tarifs.php?mon="+mon+"&yr="+yr; document.frm_cal_sm.submit(); } function cal_next(mon,yr,id) { if (mon==12) { mon=1; yr++; } else mon++; document.frm_cal_sm.action="tarifs.php?mon="+mon+"&yr="+yr; document.frm_cal_sm.submit(); } </script> <form name="frm_cal_sm" method="post"> <table width="247" border="0" cellpadding="0" cellspacing="0" bgcolor="#AA0F61"> <!--DWLayoutTable--> <tr> <? $month_curr=date("n"); if($month!= $month_curr) { ?> <td width="35" align="center" valign="middle" bgcolor="#EB208C" class="cal_font_month" style="background-image:url(images/navigationbg.jpg);"><a href="javascript:cal_prev(<?=$month?>,<?=$year?>)" class="cal_normal_sm"><</a></td> <? }?> <td width="212" height="35" align="center" valign="middle" bgcolor="#EB208C" class="cal_font_month" style="background-image:url(images/navigationbg.jpg);"><? $ref= $year.'-'.$month.'-'.$date; echo $ref; ?></td> <td width="35" align="center" valign="middle" bgcolor="#EB208C" class="cal_font_month" style="background-image:url(images/navigationbg.jpg);"><a href="javascript:cal_next(<?=$month?>,<?=$year?>)" class="cal_normal_sm">></a></td> </tr> <tr> <td height="226" colspan="3" valign="top" bgcolor="#EB208C"><? DisplayCalender($id,$month,$year); ob_end_flush(); ?></td> </tr> </table> </form> </body> </html> and later i tried this with condition to check if the dates from database and the calender are same is like this. the section of the code distinct from above is written between /////////////////////////// sign. which is as folows <?php ob_start(); require_once("config.php"); require_once("user_info.class.php"); if(isset($_REQUEST['mon'])) $month=$_REQUEST['mon']; else $month=date("n"); if(isset($_REQUEST['yr'])) $year=$_REQUEST['yr']; else $year=date("Y"); $date=date("d"); function DisplayCalender($id,$month,$year) { $bankHolsThisYear = calculateBankHolidays($year); $date=date("d"); $month_curr=date("n"); $year_curr=date("Y"); $cnt=count($bankHolsThisYear); $date_class="cal_font"; $symbol1="car_sym"; $symbol2="sym2"; $gender=""; $sdate=$year."/".$month."/01"; $edate=$year."/".$month."/31"; echo"<table border=0 cellspacing=0 cellpadding=0 align=center width='275px'>"; echo"<tr><td class=cal_head align=center>Dim</td><td class=cal_head align=center>Lun</td><td class=cal_head align=center>Mar</td>"; echo"<td class=cal_head align=center>Mer</td><td class=cal_head align=center>Jeu</td><td class=cal_head align=center>Ven</td><td class=cal_head align=center>Sam</td></tr>"; $day= date("D",mktime(0, 0, 0,$month, 1,date("y"))); $no=1; $dayno=0; echo "<tr>"; switch($day) { case "Sun": break; case "Mon": $dayno=1; break; case "Tue": $dayno=2; break; case "Wed": $dayno=3; break; case "Thu": $dayno=4; break; case "Fri": $dayno=5; break; case "Sat": $dayno=6; break; } for($i=0;$i<$dayno;$i++) { // this is for first row image... echo '<td class=cal_mes_bg align="center"> </td>'; } if($dayno==0) $class_bg="cal_dimanches_bg"; else $class_bg="cal_mes_bg"; if($date==1 && $year_curr==$year && $month_curr==$month) { $class_bg="cal_current_bg"; $date_class="cal_font_current"; $symbol1="car_curr"; $symbol2="curr_sym"; } echo"<td align=\"center\"> <table width=\"92%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td> </td> <td align=\"center\" valign=\"middle\" class=\"cal_font\"><a href=\"#\" onClick=\"return popup('reservation.php?myseldate=1".'-'.$month.'-'.$year."', 'v1', '300', '266')\" onMouseOver=\"ajax_showTooltip('view_reservation.php?myseldate=1".'-'.$month.'-'.$year."',this);return false\" onmouseout=\"ajax_hideTooltip();\" class=".$date_class.">1</a></td> <td style=\"width:3px\"></td> </tr> <tr> <td colspan=\"3\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td colspan=\"2\" style=\"height:8px\"></td> </tr> </table></td> </tr> </table> </td>"; //} // end of else $no=$dayno+1; if($month==4||$month==6||$month==9||$month==11) $max=30; else if($month==1||$month==3||$month==5||$month==7||$month==8||$month==10||$month==12) $max=31; else if($month==2) { $x=$year%4; if($x==0) $max=29; else $max=28; } for($i=2;$i<=$max;$i++) { if($no==7||$no==14||$no==21||$no==28||$no==35) { $class_bg="vaskar"; echo"<tr>"; } else { $class_bg="cal_mes_bg"; } //$edate=$year."/".$month."/".$i; $date_class="cal_font"; /*$symbol1="car_sym"; $symbol2="sym2";*/ if($i==$date && $year_curr==$year && $month_curr==$month) { // save the curr date in session $_SESSION['mycurrdate']=$year_curr.'-'.$month_curr.'-'.$i; $_SESSION['myselecteddate']=$month_curr.'-'.$year_curr; $_SESSION['currmonth'] = $month_curr; $_SESSION['curryear'] = $year_curr; $class_bg="cal_font_current"; $date_class="cal_font_current"; //$symbol1="car_curr"; //$symbol2="curr_sym"; } ////////////////////////////////////////////////////////////// $query="select holiday_date from voyance_holidays where holiday_reservationtype='Telephone Reservation'"; //echo $query; $result=mysql_query($query); while($row=mysql_fetch_array($result)) { //$d=$year."-".$month."-".$i; $string=$row['holiday_date']; $pieces=explode("-",$string); if($i==$pieces[2]) { $class_bg="cal_font_holiday"; } else { $class_bg="cal_font_current"; } } /////////////////////////////////////////////////////////////// // changed here /* if(checkEvent($gender,$edate)=="true") { echo"<td class=gen><a href='eventsearchlist.php?sflag=2&gender=".$gender."&type=2&edate=".$edate."'>".$i."</a></td>"; } else {*/ echo "<td class=".$date_class."> <table width=\"25\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\"> <tr> <td> </td> <td align=\"right\" valign=\"top\" class=".$date_class.">"; if (@$_SESSION['logged_in']==true) { echo "<a href=\"#\" onClick=\"return popup('reservation.php?myseldate=".$year.'-'.$month.'-'.$i."', 'v1', '300', '266')\" onMouseOver=\"ajax_showTooltip('view_reservation.php?myseldate=".$year.'-'.$month.'-'.$i."',this);return false\" onmouseout=\"ajax_hideTooltip();\" class=".$class_bg.">".$i."</a>"; } else { echo "<a href=\"#\" onMouseOver=\"ajax_showTooltip('view_reservation.php?myseldate=".$year.'-'.$month.'-'.$i."',this);return false\" onmouseout=\"ajax_hideTooltip();\" class=".$class_bg.">".$i."</a>"; } echo "</td> <td style=\"width:3px\">"; $_SESSION['mydate']= $i; echo " </td> </tr> <tr> <td colspan=\"3\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td colspan=\"2\" style=\"height:8px\"></td> </tr> </table></td> </tr> </table> </td>"; // } // end of else $no=$no+1; } $cross=0; $day_last= date("D",mktime(0, 0, 0,$month, $max,date("y"))); switch($day_last) { case "Sun": $cross=6; break; case "Mon": $cross=5; break; case "Tue": $cross=4; break; case "Wed": $cross=3; break; case "Thu": $cross=2; break; case "Fri": $cross=1; break; case "Sat": break; } for($i=0;$i<$cross;$i++) { echo '<td class=cal_mes_bg align="center"> </td>'; } echo"</table>"; } function CheckEvent($gender,$fromdate) { // $rs=mysql_query("select * from event where gender='".$gender ."' and edate='".$fromdate."'"); //$rsNum=mysql_num_rows($rs); $rsNum=""; if($rsNum!=0) { return "true"; } else { return "false"; } } function calculateBankHolidays($yr) { $bankHols = Array(); $yr = 2000; // New year's: switch (date("w", strtotime("$yr-01-01 12:00:00")) ) { //switch ( getdate("w", strtotime("$yr-01-01 12:00:00")) ) { //this is line 413 case 6: $bankHols[] = "$yr-01-03"; break; case 0: $bankHols[] = "$yr-01-02"; break; default: $bankHols[] = "$yr-01-01"; } // Good friday: $bankHols[] = date("Y-m-d", strtotime( "+".(easter_days($yr) - 2)." days", strtotime("$yr-03-21 12:00:00") )); // Easter Monday: $bankHols[] = date("Y-m-d", strtotime( "+".(easter_days($yr) + 1)." days", strtotime("$yr-03-21 12:00:00") )); // May Day: if ($yr == 1995) { $bankHols[] = "1995-05-08"; // VE day 50th anniversary year exception } else { switch (date("w", strtotime("$yr-05-01 12:00:00"))) { case 0: $bankHols[] = "$yr-05-02"; break; case 1: $bankHols[] = "$yr-05-01"; break; case 2: $bankHols[] = "$yr-05-07"; break; case 3: $bankHols[] = "$yr-05-06"; break; case 4: $bankHols[] = "$yr-05-05"; break; case 5: $bankHols[] = "$yr-05-04"; break; case 6: $bankHols[] = "$yr-05-03"; break; } } // Whitsun: if ($yr == 2002) { // exception year $bankHols[] = "2002-06-03"; $bankHols[] = "2002-06-04"; } else { switch (date("w", strtotime("$yr-05-31 12:00:00"))) { case 0: $bankHols[] = "$yr-05-25"; break; case 1: $bankHols[] = "$yr-05-31"; break; case 2: $bankHols[] = "$yr-05-30"; break; case 3: $bankHols[] = "$yr-05-29"; break; case 4: $bankHols[] = "$yr-05-28"; break; case 5: $bankHols[] = "$yr-05-27"; break; case 6: $bankHols[] = "$yr-05-26"; break; } } // Summer Bank Holiday: switch (date("w", strtotime("$yr-08-31 12:00:00"))) { case 0: $bankHols[] = "$yr-08-25"; break; case 1: $bankHols[] = "$yr-08-31"; break; case 2: $bankHols[] = "$yr-08-30"; break; case 3: $bankHols[] = "$yr-08-29"; break; case 4: $bankHols[] = "$yr-08-28"; break; case 5: $bankHols[] = "$yr-08-27"; break; case 6: $bankHols[] = "$yr-08-26"; break; } // Christmas: switch ( date("w", strtotime("$yr-12-25 12:00:00")) ) { case 5: $bankHols[] = "$yr-12-25"; $bankHols[] = "$yr-12-28"; break; case 6: $bankHols[] = "$yr-12-27"; $bankHols[] = "$yr-12-28"; break; case 0: $bankHols[] = "$yr-12-26"; $bankHols[] = "$yr-12-27"; break; default: $bankHols[] = "$yr-12-25"; $bankHols[] = "$yr-12-26"; } // Millenium eve if ($yr == 1999) { $bankHols[] = "1999-12-31"; } return $bankHols; } ?> <script> function cal_prev(mon,yr,id) { if (mon==1) { mon=12; yr--; } else mon--; document.frm_cal_sm.action="tarifs.php?mon="+mon+"&yr="+yr; document.frm_cal_sm.submit(); } function cal_next(mon,yr,id) { if (mon==12) { mon=1; yr++; } else mon++; document.frm_cal_sm.action="tarifs.php?mon="+mon+"&yr="+yr; document.frm_cal_sm.submit(); } </script> <form name="frm_cal_sm" method="post"> <table width="247" border="0" cellpadding="0" cellspacing="0" bgcolor="#AA0F61"> <!--DWLayoutTable--> <tr> <? $month_curr=date("n"); if($month!= $month_curr) { ?> <td width="35" align="center" valign="middle" bgcolor="#EB208C" class="cal_font_month" style="background-image:url(images/navigationbg.jpg);"><a href="javascript:cal_prev(<?=$month?>,<?=$year?>)" class="cal_normal_sm"><</a></td> <? }?> <td width="212" height="35" align="center" valign="middle" bgcolor="#EB208C" class="cal_font_month" style="background-image:url(images/navigationbg.jpg);"><? $ref= $year.'-'.$month.'-'.$date; echo $ref; ?></td> <td width="35" align="center" valign="middle" bgcolor="#EB208C" class="cal_font_month" style="background-image:url(images/navigationbg.jpg);"><a href="javascript:cal_next(<?=$month?>,<?=$year?>)" class="cal_normal_sm">></a></td> </tr> <tr> <td height="226" colspan="3" valign="top" bgcolor="#EB208C"><? DisplayCalender($id,$month,$year); ob_end_flush(); ?></td> </tr> </table> </form> </body> </html> it is really an urgent. please helo in this regard thank you -
hi all this problem of mine really needs an urgent help. i have code in which i need to change the color of the date which is holiday of an organization. and the holiday date is determined from the value added in the database which is done from admin panel. Now what i want to do is read all the dates from the database which are inserted from admin panel and check the date with each dates of the calender. if the date from the database is same with the dates of the calender then give another CSS class for the date. my previous code in which simple calender is displayed where no holidays is considered is like this <?php ob_start(); require_once("config.php"); require_once("user_info.class.php"); if(isset($_REQUEST['mon'])) $month=$_REQUEST['mon']; else $month=date("n"); if(isset($_REQUEST['yr'])) $year=$_REQUEST['yr']; else $year=date("Y"); $date=date("d"); function DisplayCalender($id,$month,$year) { $bankHolsThisYear = calculateBankHolidays($year); $date=date("d"); $month_curr=date("n"); $year_curr=date("Y"); $cnt=count($bankHolsThisYear); $date_class="cal_font"; $symbol1="car_sym"; $symbol2="sym2"; $gender=""; $sdate=$year."/".$month."/01"; $edate=$year."/".$month."/31"; echo"<table border=0 cellspacing=0 cellpadding=0 align=center width='275px'>"; echo"<tr><td class=cal_head align=center>Dim</td><td class=cal_head align=center>Lun</td><td class=cal_head align=center>Mar</td>"; echo"<td class=cal_head align=center>Mer</td><td class=cal_head align=center>Jeu</td><td class=cal_head align=center>Ven</td><td class=cal_head align=center>Sam</td></tr>"; $day= date("D",mktime(0, 0, 0,$month, 1,date("y"))); $no=1; $dayno=0; echo "<tr>"; switch($day) { case "Sun": break; case "Mon": $dayno=1; break; case "Tue": $dayno=2; break; case "Wed": $dayno=3; break; case "Thu": $dayno=4; break; case "Fri": $dayno=5; break; case "Sat": $dayno=6; break; } for($i=0;$i<$dayno;$i++) { // this is for first row image... echo '<td class=cal_mes_bg align="center"> </td>'; } if($dayno==0) $class_bg="cal_dimanches_bg"; else $class_bg="cal_mes_bg"; if($date==1 && $year_curr==$year && $month_curr==$month) { $class_bg="cal_current_bg"; $date_class="cal_font_current"; $symbol1="car_curr"; $symbol2="curr_sym"; } echo"<td align=\"center\"> <table width=\"92%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td> </td> <td align=\"center\" valign=\"middle\" class=\"cal_font\"><a href=\"#\" onClick=\"return popup('reservation.php?myseldate=1".'-'.$month.'-'.$year."', 'v1', '300', '266')\" onMouseOver=\"ajax_showTooltip('view_reservation.php?myseldate=1".'-'.$month.' -'.$year."',this);return false\" onmouseout=\"ajax_hideTooltip();\" class=".$date_class.">1</a></td> <td style=\"width:3px\"></td> </tr> <tr> <td colspan=\"3\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td colspan=\"2\" style=\"height:8px\"></td> </tr> </table></td> </tr> </table> </td>"; //} // end of else $no=$dayno+1; if($month==4||$month==6||$month==9||$month==11) $max=30; else if($month==1||$month==3||$month==5||$month==7||$month==8||$month==10||$month== 12) $max=31; else if($month==2) { $x=$year%4; if($x==0) $max=29; else $max=28; } for($i=2;$i<=$max;$i++) { if($no==7||$no==14||$no==21||$no==28||$no==35) { $class_bg="vaskar"; echo"<tr>"; } else { $class_bg="cal_mes_bg"; } //$edate=$year."/".$month."/".$i; $date_class="cal_font"; /*$symbol1="car_sym"; $symbol2="sym2";*/ if($i==$date && $year_curr==$year && $month_curr==$month) { // save the curr date in session $_SESSION['mycurrdate']=$year_curr.'-'.$month_curr.'-'.$i; $_SESSION['myselecteddate']=$month_curr.'-'.$year_curr; $_SESSION['currmonth'] = $month_curr; $_SESSION['curryear'] = $year_curr; $class_bg="cal_font_current"; $date_class="cal_font_current"; //$symbol1="car_curr"; //$symbol2="curr_sym"; } // changed here /* if(checkEvent($gender,$edate)=="true") { echo"<td class=gen><a href='eventsearchlist.php?sflag=2&gender=".$gender."&type=2&edate=".$edate."'> ".$i."</a></td>"; } else {*/ echo "<td class=".$date_class."> <table width=\"25\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\"> <tr> <td> </td> <td align=\"right\" valign=\"top\" class=".$date_class.">"; if (@$_SESSION['logged_in']==true) { echo "<a href=\"#\" onClick=\"return popup('reservation.php?myseldate=".$year.'-'.$month.'-'.$i."', 'v1', '300', '266')\" onMouseOver=\"ajax_showTooltip('view_reservation.php?myseldate=".$year.'-'.$mo nth.'-'.$i."',this);return false\" onmouseout=\"ajax_hideTooltip();\" class=".$class_bg.">".$i."</a>"; } else { echo "<a href=\"#\" onMouseOver=\"ajax_showTooltip('view_reservation.php?myseldate=".$year.'-'.$mo nth.'-'.$i."',this);return false\" onmouseout=\"ajax_hideTooltip();\" class=".$class_bg.">".$i."</a>"; } echo "</td> <td style=\"width:3px\">"; $_SESSION['mydate']= $i; echo " </td> </tr> <tr> <td colspan=\"3\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td colspan=\"2\" style=\"height:8px\"></td> </tr> </table></td> </tr> </table> </td>"; // } // end of else $no=$no+1; } $cross=0; $day_last= date("D",mktime(0, 0, 0,$month, $max,date("y"))); switch($day_last) { case "Sun": $cross=6; break; case "Mon": $cross=5; break; case "Tue": $cross=4; break; case "Wed": $cross=3; break; case "Thu": $cross=2; break; case "Fri": $cross=1; break; case "Sat": break; } for($i=0;$i<$cross;$i++) { echo '<td class=cal_mes_bg align="center"> </td>'; } echo"</table>"; } function CheckEvent($gender,$fromdate) { // $rs=mysql_query("select * from event where gender='".$gender ."' and edate='".$fromdate."'"); //$rsNum=mysql_num_rows($rs); $rsNum=""; if($rsNum!=0) { return "true"; } else { return "false"; } } function calculateBankHolidays($yr) { $bankHols = Array(); $yr = 2000; // New year's: switch (date("w", strtotime("$yr-01-01 12:00:00")) ) { //switch ( getdate("w", strtotime("$yr-01-01 12:00:00")) ) { //this is line 413 case 6: $bankHols[] = "$yr-01-03"; break; case 0: $bankHols[] = "$yr-01-02"; break; default: $bankHols[] = "$yr-01-01"; } // Good friday: $bankHols[] = date("Y-m-d", strtotime( "+".(easter_days($yr) - 2)." days", strtotime("$yr-03-21 12:00:00") )); // Easter Monday: $bankHols[] = date("Y-m-d", strtotime( "+".(easter_days($yr) + 1)." days", strtotime("$yr-03-21 12:00:00") )); // May Day: if ($yr == 1995) { $bankHols[] = "1995-05-08"; // VE day 50th anniversary year exception } else { switch (date("w", strtotime("$yr-05-01 12:00:00"))) { case 0: $bankHols[] = "$yr-05-02"; break; case 1: $bankHols[] = "$yr-05-01"; break; case 2: $bankHols[] = "$yr-05-07"; break; case 3: $bankHols[] = "$yr-05-06"; break; case 4: $bankHols[] = "$yr-05-05"; break; case 5: $bankHols[] = "$yr-05-04"; break; case 6: $bankHols[] = "$yr-05-03"; break; } } // Whitsun: if ($yr == 2002) { // exception year $bankHols[] = "2002-06-03"; $bankHols[] = "2002-06-04"; } else { switch (date("w", strtotime("$yr-05-31 12:00:00"))) { case 0: $bankHols[] = "$yr-05-25"; break; case 1: $bankHols[] = "$yr-05-31"; break; case 2: $bankHols[] = "$yr-05-30"; break; case 3: $bankHols[] = "$yr-05-29"; break; case 4: $bankHols[] = "$yr-05-28"; break; case 5: $bankHols[] = "$yr-05-27"; break; case 6: $bankHols[] = "$yr-05-26"; break; } } // Summer Bank Holiday: switch (date("w", strtotime("$yr-08-31 12:00:00"))) { case 0: $bankHols[] = "$yr-08-25"; break; case 1: $bankHols[] = "$yr-08-31"; break; case 2: $bankHols[] = "$yr-08-30"; break; case 3: $bankHols[] = "$yr-08-29"; break; case 4: $bankHols[] = "$yr-08-28"; break; case 5: $bankHols[] = "$yr-08-27"; break; case 6: $bankHols[] = "$yr-08-26"; break; } // Christmas: switch ( date("w", strtotime("$yr-12-25 12:00:00")) ) { case 5: $bankHols[] = "$yr-12-25"; $bankHols[] = "$yr-12-28"; break; case 6: $bankHols[] = "$yr-12-27"; $bankHols[] = "$yr-12-28"; break; case 0: $bankHols[] = "$yr-12-26"; $bankHols[] = "$yr-12-27"; break; default: $bankHols[] = "$yr-12-25"; $bankHols[] = "$yr-12-26"; } // Millenium eve if ($yr == 1999) { $bankHols[] = "1999-12-31"; } return $bankHols; } ?> <script> function cal_prev(mon,yr,id) { if (mon==1) { mon=12; yr--; } else mon--; document.frm_cal_sm.action="tarifs.php?mon="+mon+"&yr="+yr; document.frm_cal_sm.submit(); } function cal_next(mon,yr,id) { if (mon==12) { mon=1; yr++; } else mon++; document.frm_cal_sm.action="tarifs.php?mon="+mon+"&yr="+yr; document.frm_cal_sm.submit(); } </script> <form name="frm_cal_sm" method="post"> <table width="247" border="0" cellpadding="0" cellspacing="0" bgcolor="#AA0F61"> <!--DWLayoutTable--> <tr> <? $month_curr=date("n"); if($month!= $month_curr) { ?> <td width="35" align="center" valign="middle" bgcolor="#EB208C" class="cal_font_month" style="background-image:url(images/navigationbg.jpg);"><a href="javascript:cal_prev(<?=$month?>,<?=$year?>)" class="cal_normal_sm"><</a></td> <? }?> <td width="212" height="35" align="center" valign="middle" bgcolor="#EB208C" class="cal_font_month" style="background-image:url(images/navigationbg.jpg);"><? $ref= $year.'-'.$month.'-'.$date; echo $ref; ?></td> <td width="35" align="center" valign="middle" bgcolor="#EB208C" class="cal_font_month" style="background-image:url(images/navigationbg.jpg);"><a href="javascript:cal_next(<?=$month?>,<?=$year?>)" class="cal_normal_sm">></a></td> </tr> <tr> <td height="226" colspan="3" valign="top" bgcolor="#EB208C"><? DisplayCalender($id,$month,$year); ob_end_flush(); ?></td> </tr> </table> </form> </body> </html> and later i tried this with condition to check if the dates from database and the calender are same is like this. the section of the code distinct from above is written between /////////////////////////// sign. which is as folows <?php ob_start(); require_once("config.php"); require_once("user_info.class.php"); if(isset($_REQUEST['mon'])) $month=$_REQUEST['mon']; else $month=date("n"); if(isset($_REQUEST['yr'])) $year=$_REQUEST['yr']; else $year=date("Y"); $date=date("d"); function DisplayCalender($id,$month,$year) { $bankHolsThisYear = calculateBankHolidays($year); $date=date("d"); $month_curr=date("n"); $year_curr=date("Y"); $cnt=count($bankHolsThisYear); $date_class="cal_font"; $symbol1="car_sym"; $symbol2="sym2"; $gender=""; $sdate=$year."/".$month."/01"; $edate=$year."/".$month."/31"; echo"<table border=0 cellspacing=0 cellpadding=0 align=center width='275px'>"; echo"<tr><td class=cal_head align=center>Dim</td><td class=cal_head align=center>Lun</td><td class=cal_head align=center>Mar</td>"; echo"<td class=cal_head align=center>Mer</td><td class=cal_head align=center>Jeu</td><td class=cal_head align=center>Ven</td><td class=cal_head align=center>Sam</td></tr>"; $day= date("D",mktime(0, 0, 0,$month, 1,date("y"))); $no=1; $dayno=0; echo "<tr>"; switch($day) { case "Sun": break; case "Mon": $dayno=1; break; case "Tue": $dayno=2; break; case "Wed": $dayno=3; break; case "Thu": $dayno=4; break; case "Fri": $dayno=5; break; case "Sat": $dayno=6; break; } for($i=0;$i<$dayno;$i++) { // this is for first row image... echo '<td class=cal_mes_bg align="center"> </td>'; } if($dayno==0) $class_bg="cal_dimanches_bg"; else $class_bg="cal_mes_bg"; if($date==1 && $year_curr==$year && $month_curr==$month) { $class_bg="cal_current_bg"; $date_class="cal_font_current"; $symbol1="car_curr"; $symbol2="curr_sym"; } echo"<td align=\"center\"> <table width=\"92%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td> </td> <td align=\"center\" valign=\"middle\" class=\"cal_font\"><a href=\"#\" onClick=\"return popup('reservation.php?myseldate=1".'-'.$month.'-'.$year."', 'v1', '300', '266')\" onMouseOver=\"ajax_showTooltip('view_reservation.php?myseldate=1".'-'.$month.' -'.$year."',this);return false\" onmouseout=\"ajax_hideTooltip();\" class=".$date_class.">1</a></td> <td style=\"width:3px\"></td> </tr> <tr> <td colspan=\"3\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td colspan=\"2\" style=\"height:8px\"></td> </tr> </table></td> </tr> </table> </td>"; //} // end of else $no=$dayno+1; if($month==4||$month==6||$month==9||$month==11) $max=30; else if($month==1||$month==3||$month==5||$month==7||$month==8||$month==10||$month== 12) $max=31; else if($month==2) { $x=$year%4; if($x==0) $max=29; else $max=28; } for($i=2;$i<=$max;$i++) { if($no==7||$no==14||$no==21||$no==28||$no==35) { $class_bg="vaskar"; echo"<tr>"; } else { $class_bg="cal_mes_bg"; } //$edate=$year."/".$month."/".$i; $date_class="cal_font"; /*$symbol1="car_sym"; $symbol2="sym2";*/ if($i==$date && $year_curr==$year && $month_curr==$month) { // save the curr date in session $_SESSION['mycurrdate']=$year_curr.'-'.$month_curr.'-'.$i; $_SESSION['myselecteddate']=$month_curr.'-'.$year_curr; $_SESSION['currmonth'] = $month_curr; $_SESSION['curryear'] = $year_curr; $class_bg="cal_font_current"; $date_class="cal_font_current"; //$symbol1="car_curr"; //$symbol2="curr_sym"; } ////////////////////////////////////////////////////////////// $query="select holiday_date from voyance_holidays where holiday_reservationtype='Telephone Reservation'"; //echo $query; $result=mysql_query($query); while($row=mysql_fetch_array($result)) { //$d=$year."-".$month."-".$i; $string=$row['holiday_date']; $pieces=explode("-",$string); if($i==$pieces[2]) { $class_bg="cal_font_holiday"; } else { $class_bg="cal_font_current"; } } /////////////////////////////////////////////////////////////// // changed here /* if(checkEvent($gender,$edate)=="true") { echo"<td class=gen><a href='eventsearchlist.php?sflag=2&gender=".$gender."&type=2&edate=".$edate."'> ".$i."</a></td>"; } else {*/ echo "<td class=".$date_class."> <table width=\"25\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\"> <tr> <td> </td> <td align=\"right\" valign=\"top\" class=".$date_class.">"; if (@$_SESSION['logged_in']==true) { echo "<a href=\"#\" onClick=\"return popup('reservation.php?myseldate=".$year.'-'.$month.'-'.$i."', 'v1', '300', '266')\" onMouseOver=\"ajax_showTooltip('view_reservation.php?myseldate=".$year.'-'.$mo nth.'-'.$i."',this);return false\" onmouseout=\"ajax_hideTooltip();\" class=".$class_bg.">".$i."</a>"; } else { echo "<a href=\"#\" onMouseOver=\"ajax_showTooltip('view_reservation.php?myseldate=".$year.'-'.$mo nth.'-'.$i."',this);return false\" onmouseout=\"ajax_hideTooltip();\" class=".$class_bg.">".$i."</a>"; } echo "</td> <td style=\"width:3px\">"; $_SESSION['mydate']= $i; echo " </td> </tr> <tr> <td colspan=\"3\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td colspan=\"2\" style=\"height:8px\"></td> </tr> </table></td> </tr> </table> </td>"; // } // end of else $no=$no+1; } $cross=0; $day_last= date("D",mktime(0, 0, 0,$month, $max,date("y"))); switch($day_last) { case "Sun": $cross=6; break; case "Mon": $cross=5; break; case "Tue": $cross=4; break; case "Wed": $cross=3; break; case "Thu": $cross=2; break; case "Fri": $cross=1; break; case "Sat": break; } for($i=0;$i<$cross;$i++) { echo '<td class=cal_mes_bg align="center"> </td>'; } echo"</table>"; } function CheckEvent($gender,$fromdate) { // $rs=mysql_query("select * from event where gender='".$gender ."' and edate='".$fromdate."'"); //$rsNum=mysql_num_rows($rs); $rsNum=""; if($rsNum!=0) { return "true"; } else { return "false"; } } function calculateBankHolidays($yr) { $bankHols = Array(); $yr = 2000; // New year's: switch (date("w", strtotime("$yr-01-01 12:00:00")) ) { //switch ( getdate("w", strtotime("$yr-01-01 12:00:00")) ) { //this is line 413 case 6: $bankHols[] = "$yr-01-03"; break; case 0: $bankHols[] = "$yr-01-02"; break; default: $bankHols[] = "$yr-01-01"; } // Good friday: $bankHols[] = date("Y-m-d", strtotime( "+".(easter_days($yr) - 2)." days", strtotime("$yr-03-21 12:00:00") )); // Easter Monday: $bankHols[] = date("Y-m-d", strtotime( "+".(easter_days($yr) + 1)." days", strtotime("$yr-03-21 12:00:00") )); // May Day: if ($yr == 1995) { $bankHols[] = "1995-05-08"; // VE day 50th anniversary year exception } else { switch (date("w", strtotime("$yr-05-01 12:00:00"))) { case 0: $bankHols[] = "$yr-05-02"; break; case 1: $bankHols[] = "$yr-05-01"; break; case 2: $bankHols[] = "$yr-05-07"; break; case 3: $bankHols[] = "$yr-05-06"; break; case 4: $bankHols[] = "$yr-05-05"; break; case 5: $bankHols[] = "$yr-05-04"; break; case 6: $bankHols[] = "$yr-05-03"; break; } } // Whitsun: if ($yr == 2002) { // exception year $bankHols[] = "2002-06-03"; $bankHols[] = "2002-06-04"; } else { switch (date("w", strtotime("$yr-05-31 12:00:00"))) { case 0: $bankHols[] = "$yr-05-25"; break; case 1: $bankHols[] = "$yr-05-31"; break; case 2: $bankHols[] = "$yr-05-30"; break; case 3: $bankHols[] = "$yr-05-29"; break; case 4: $bankHols[] = "$yr-05-28"; break; case 5: $bankHols[] = "$yr-05-27"; break; case 6: $bankHols[] = "$yr-05-26"; break; } } // Summer Bank Holiday: switch (date("w", strtotime("$yr-08-31 12:00:00"))) { case 0: $bankHols[] = "$yr-08-25"; break; case 1: $bankHols[] = "$yr-08-31"; break; case 2: $bankHols[] = "$yr-08-30"; break; case 3: $bankHols[] = "$yr-08-29"; break; case 4: $bankHols[] = "$yr-08-28"; break; case 5: $bankHols[] = "$yr-08-27"; break; case 6: $bankHols[] = "$yr-08-26"; break; } // Christmas: switch ( date("w", strtotime("$yr-12-25 12:00:00")) ) { case 5: $bankHols[] = "$yr-12-25"; $bankHols[] = "$yr-12-28"; break; case 6: $bankHols[] = "$yr-12-27"; $bankHols[] = "$yr-12-28"; break; case 0: $bankHols[] = "$yr-12-26"; $bankHols[] = "$yr-12-27"; break; default: $bankHols[] = "$yr-12-25"; $bankHols[] = "$yr-12-26"; } // Millenium eve if ($yr == 1999) { $bankHols[] = "1999-12-31"; } return $bankHols; } ?> <script> function cal_prev(mon,yr,id) { if (mon==1) { mon=12; yr--; } else mon--; document.frm_cal_sm.action="tarifs.php?mon="+mon+"&yr="+yr; document.frm_cal_sm.submit(); } function cal_next(mon,yr,id) { if (mon==12) { mon=1; yr++; } else mon++; document.frm_cal_sm.action="tarifs.php?mon="+mon+"&yr="+yr; document.frm_cal_sm.submit(); } </script> <form name="frm_cal_sm" method="post"> <table width="247" border="0" cellpadding="0" cellspacing="0" bgcolor="#AA0F61"> <!--DWLayoutTable--> <tr> <? $month_curr=date("n"); if($month!= $month_curr) { ?> <td width="35" align="center" valign="middle" bgcolor="#EB208C" class="cal_font_month" style="background-image:url(images/navigationbg.jpg);"><a href="javascript:cal_prev(<?=$month?>,<?=$year?>)" class="cal_normal_sm"><</a></td> <? }?> <td width="212" height="35" align="center" valign="middle" bgcolor="#EB208C" class="cal_font_month" style="background-image:url(images/navigationbg.jpg);"><? $ref= $year.'-'.$month.'-'.$date; echo $ref; ?></td> <td width="35" align="center" valign="middle" bgcolor="#EB208C" class="cal_font_month" style="background-image:url(images/navigationbg.jpg);"><a href="javascript:cal_next(<?=$month?>,<?=$year?>)" class="cal_normal_sm">></a></td> </tr> <tr> <td height="226" colspan="3" valign="top" bgcolor="#EB208C"><? DisplayCalender($id,$month,$year); ob_end_flush(); ?></td> </tr> </table> </form> </body> </html> it is really an urgent. please helo in this regard thank you
-
it can be said something precisely if u send the code that u have writen
-
i m getting the following errror Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\wamp\www\directory\filename.php on line 176
-
hi everybody i have a problem in the sql query. my query is this $sSqlQuery="select user_reserve_time_start,user_reserve_time_end,user_reserve_date from voyance_user WHERE user_id= '".$u_id."' and user_reservetype='Domicile Reservation'"; $row=mysql_query($sSqlQuery); while($rest=mysql_fetch_array($row)) { $start_time=$rest['reserve_time_start']; $end_time=$rest['reserve_time_end']; $reserve_date=$rest['reserve_date']; echo $reserve_date; } where is the error in the query.
-
first u query the selected month from database and display the fetched value greater by one fro the datbase. i think this will help u out
-
hello this code is correct n work. no need to filter the php variable. "SELECT count(*) FROM gallery WHERE category == $current_category"; ]just try this one
-
u can try this way define the default database field value as 0 and from check box pass the value this way <input type="checkbox" name="name1" value="1" /> <input type="checkbox" name="name2" value="1" /> <input type="checkbox" name="name3" value="1" /> abnd write the sql query to insert the value of the checkbox when the it is checked
-
this is also the way of writing the query "SELECT count(*) FROM gallery WHERE category == $current_category";
-
u can also write the query this way "SELECT count(*) FROM gallery WHERE category == "$current_category";