?
Path : /home/admin/domains/happytokorea.com/private_html/libs-bak/ |
Current File : /home/admin/domains/happytokorea.com/private_html/libs-bak/calendar.php |
<? function calendar2(){ //$month$year,$lastMonth,$lastYear,$nextMonth,$nextYear, $dayadd=Array("15","18","20","24","28","30"); $objResponse = new xajaxResponse(); if($day==''){ $day = "01"; }if($month==''){ $month = date("m"); }if($year==''){ $year = date("Y"); } if($lastMonth!= "" and $lastMonth != 1){ $month = $lastMonth - 1; }if($lastMonth != "" and $lastMonth == 1){ $month = 12; $year = $year - 1; }if($nextMonth != "" and $nextMonth != 12){ $month = $nextMonth + 1; }if($nextMonth != "" and $nextMonth == 12){ $month = 1; $year = $year + 1; }if($lastYear != ""){ $year = $lastYear - 1; }if($nextYear != ""){ $year = $nextYear + 1; } $zzz = strtotime($year."-".$month."-".$day); $yyy = getdate($zzz); $www = $yyy['wday']; $lastday = mktime(0,0,0,$month+1,0,$year); $lastday = strftime("%d", $lastday); $rows_cal = ceil($lastday/7); if($www == 5 and $lastday > 30){ $data_day[0] = $lastday; }if($www == 6 and $lastday == 30){ $data_day[0] = $lastday; }if($www == 6 and $lastday > 30){ $data_day[0] = $lastday-1; $data_day[1] = $lastday; }if($www < 5){ for($f=2;$f<$www;$f++){ $data_day[$f] = ""; } } $m = 1; for($i=$www;$i<=($lastday + ($www - 1));$i++){ $data_day[$i] = $m; $m++; } if($month == '01' or $month == 1){ $que_month = 'January'; }if($month == '02' or $month == 2){ $que_month = 'February'; }if($month == '03' or $month == 3){ $que_month = 'March'; }if($month == '04' or $month == 4){ $que_month = 'April'; }if($month == '05' or $month == 5){ $que_month = 'May'; }if($month == '06' or $month == 6){ $que_month = 'June'; }if($month == '07' or $month == 7){ $que_month = 'July'; }if($month == '08' or $month == 8){ $que_month = 'August'; }if($month == '09' or $month == 9){ $que_month = 'September'; }if($month == '10' or $month == 10){ $que_month = 'October'; }if($month == '11' or $month == 11){ $que_month = 'November'; }if($month == '12' or $month == 12){ $que_month = 'December'; } if($month > 0 and $month < 10){ $lastMonth = substr($month,1,1); }else{ $lastMonth = $month; } $output="<table width=\"150\"> <tr bgcolor=#BBEEFF> <td> "; if(($year >= 1970 and $month > 1) or ($year > 1970)){ $output.="<a href=\"$PHP_SELF?lastMonth=$month&Year=$year\"> <font face=verdana size=1><</a> "; } $output.="</td> <td> "; if($year > 1970){ $output.="<a href=\"$PHP_SELF?lastYear=$year&month=$month\"> <font face=verdana size=1><<</a> "; } $output.="</td> <td colspan=\"3\"><center> <font face=verdana size=1> $que_month $year </font></center></td> <td> "; if($year < 2020){ $output.="<a href=\"$PHP_SELF?nextYear=$year&month=$month\"> <font face=verdana size=1>>></a> "; } $output.=" </td> <td> "; if(($year <= 2020 and $month < 12) or ($year < 2020)){ $output.=" <a href=\"$PHP_SELF?nextMonth=$month&year=$year\"> <font face=verdana size=1>> "; } $output.="</a> </td> </tr> <tr> <td width=\"20\"><center><font face=verdana size=1>S</center></td> <td width=\"20\"><center><font face=verdana size=1>M</center></td> <td width=\"20\"><center><font face=verdana size=1>T</center></td> <td width=\"20\"><center><font face=verdana size=1>W</center></td> <td width=\"20\"><center><font face=verdana size=1>T</center></td> <td width=\"20\"><center><font face=verdana size=1>F</center></td> <td width=\"20\"><center><font face=verdana size=1>S</center></td> </tr> "; $z = 0; while($z <= $lastday){ for($i=1;$i<=$rows_cal;$i++){ $output.="<tr id=\"[$i]\">"; for($j=0;$j<=6;$j++){ if($j==0){ $clr = "red"; }else{ $clr = "black"; } if($data_day[$z] == date("d") and ($month == date("m"))){ $blk = "<strong>"; $col = "#fea398"; }else{ $blk = ""; $col = ""; } $output.=" <td bgcolor=$col><center> <font color=$clr>"; ?> <? if($var_cnt[$z] !=""){ $output.="<a title=\"xxxxxxx\" href=\"$PHP_SELF?dat=$year-$month-$data_day[$z]\"> <font color=blue>$data_day[$z]</a> "; }else{ if(in_array($data_day[$z],$dayadd)){ $output.="<a title=\"xxxxx\" href=\"$PHP_SELF?dat=$year-$month-$data_day[$z]\">$data_day[$z]</a>"; }else{ $output.= "<div id=\"$data_day[$z]\">$data_day[$z]</div>"; } } $output.="</font> "; $z++; $output.="</center></td> "; } $output.="</tr> "; } } $output.=" </table> "; } ?>