|
|
|
เกี่ยวกับโค้ดปฏิทินครับ ผู้รู้ช่วยที ผมได้โค้ดมา แต่พอรันแล้วมันขึ้น ดังรูป |
|
|
|
|
|
|
|
ผมได้โค้ดมา คือ
<?
echo "<html>";
echo "<head>";
echo "</head>";
echo "<body bgcolor=\"#F2A20D\" VLINK = \"#6699cc\">";
echo "<P>";
echo "<table border=\"1\" cellpadding=\"1\" style=\"border-collapse: collapse\" bordercolor=\"#6699cc\" width=\"20%\" id=\"AutoNumber1\">";
echo "<TR><TD>";
$GoToDay = $_GET['txtDay'];
if (!empty($GoToDay)) {
$StartDate=date("m/d/y",strtotime ("$GoToDay"));
} else if (empty($StartDate)) $StartDate=date("m/d/y");
echo WriteMonth($StartDate);
function WriteMonth($StartDate)
{
$thaimonth=array("ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.", "พ.ย.","ธ.ค.");
$WriteMonth="";
$CurrentDate=date("m/1/y", strtotime ("$StartDate"));
$setMonth=date("m",strtotime ($CurrentDate));
$todaysDate=date("j",strtotime(date("m/d/y")));
$mmon=date("m",strtotime ($CurrentDate));
$myear=date("Y",strtotime ($CurrentDate));
$noOfDays=date("t",strtotime ($CurrentDate));
$WriteMonth.="";
$WriteMonth.="<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" width=\"200\"><tr><td colspan=\"2\" valign=top align=\"left\">";
$WriteMonth.="<a href=\"?txtDay=".date("m/1/y", strtotime ("$CurrentDate -1 months"))."\"><font color=\"#6699cc\"><<</font></a></td><td colspan=\"3\" align=\"center\"><a href=\"?txtDay=".date("m/1/y", strtotime ("$StartDate months"))."\"><b><font color=\"#6699cc\">".$thaimonth[date("m", strtotime ($StartDate)) - 1]." ".(date("Y",strtotime ($StartDate)) + 543);
$WriteMonth.="</font></b> </a></td><td colspan=\"2\" valign=top align=\"right\">";
$WriteMonth.="<a href=\"?txtDay=".date("m/1/y", strtotime ("$StartDate +1 months"))."\"><font color=\"#6699cc\">>></font></a>";
$WriteMonth.="</td></tr><tr bgcolor=\"#6699cc\">";
$WriteMonth.="<td align='center'><B><font color=\"#000066\">??.</font></B></td>";
$WriteMonth.="<td align='center'><B><font color=\"#000066\">?.</font></B></td>";
$WriteMonth.="<td align='center'><B><font color=\"#000066\">?.</font></B></td>";
$WriteMonth.="<td align='center'><B><font color=\"#000066\">?.</font></B></td>";
$WriteMonth.="<td align='center'><B><font color=\"#000066\">??.</font></B></td>";
$WriteMonth.="<td align='center'><B><font color=\"#000066\">?.</font></B></td>";
$WriteMonth.="<td align='center'><B><font color=\"#000066\">?.</font></B></td>";
$WriteMonth.="</tr>";
$startMonth=date("$myear/$setMonth/01");
$endMonth=date("$myear/$setMonth/$noOfDays");
$WriteMonth .= "<tr>";
for($i=1;$i<=$noOfDays;$i++) {
$coolmonth=date("$setMonth/$i/$myear");
$TBD=date("j",strtotime ($coolmonth));
$BD=date("j",strtotime ($coolmonth));
$BDay=date("D",strtotime ($coolmonth));
if ($todaysDate==$TBD) {
$BD= "<B><font color=\"#FFFFFF\">$TBD</font></B>";
}
$BD = "<td align=\"center\" bgcolor = \"#6699cc\"><font color=\"#000066\">$BD</font></td>";
switch($BDay){
case 'Sun':
$WriteMonth .= "$BD";
break;
case 'Mon':
if ($TBD==1) $WriteMonth .= "<td> </td>";
$WriteMonth .= "$BD";
break;
case 'Tue':
if($TBD==1) $WriteMonth .= "<td> </td><td> </td>";
$WriteMonth .= "$BD";
break;
case 'Wed':
if($TBD==1) $WriteMonth .= "<td> </td><td> </td><td> </td>";
$WriteMonth .= "$BD";
break;
case 'Thu':
if($TBD==1) $WriteMonth .= "<td> </td><td> </td><td> </td><td> </td>";
$WriteMonth .= "$BD";
break;
case 'Fri':
if($TBD==1) $WriteMonth .= "<td> </td><td> </td><td> </td><td> </td><td> </td>";
$WriteMonth .= "$BD";
break;
case 'Sat':
if($TBD==1) $WriteMonth .= "<td> </td><td> </td><td> </td><td> </td><td> </td><td>;</td>";
$WriteMonth .= "$BD";
$WriteMonth .="</tr><tr>";
break;
}
}
$WriteMonth .="</table>";
return $WriteMonth;
}
echo "</TD></TR>";
echo "</TABLE>";
echo "<BR>";
echo "</body>";
echo "</html>";
?>
แต่พอรันแล้วมันขึ้น ดังรูป
[url=http://www.uppic.net/showpic.php?picid=8d933adf31497099e0895ddb6a74e8a3][/url]
ช่วยแก้ที่ครับ
Tag : - - - -
|
|
|
|
|
|
Date :
12 ก.พ. 2550 13:59:55 |
By :
ryuzoom |
View :
1895 |
Reply :
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
รูปไม่ขึ้น
<a href='http://www.uppic.net/showpic.php?picid=8d933adf31497099e0895ddb6a74e8a3' target="_blank"><img border="0" src="http://www.uppic.net/iu/1185untitled.jpg"></a>
|
|
|
|
|
Date :
12 ก.พ. 2550 14:01:19 |
By :
ryuzoom |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ลองเพิ่ม tag นี้เข้าไปดูนะคับ
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
|
|
|
|
|
Date :
12 ก.พ. 2550 14:02:50 |
By :
Rutz |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ตัวนี้ครับ ..
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
</head>
<body bgcolor="#F2A20D" VLINK = "#6699cc">
<P>
<table border="1" cellpadding="1" style="border-collapse: collapse" bordercolor="#6699cc" width="20%" id="AutoNumber1">
<TR><TD>
<?
$GoToDay = $_GET['txtDay'];
if (!empty($GoToDay)) {
$StartDate=date("m/d/y",strtotime ("$GoToDay"));
} else if (empty($StartDate)) $StartDate=date("m/d/y");
echo WriteMonth($StartDate);
function WriteMonth($StartDate)
{
$thaimonth=array("ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.", "พ.ย.","ธ.ค.");
$WriteMonth="";
$CurrentDate=date("m/1/y", strtotime ("$StartDate"));
$setMonth=date("m",strtotime ($CurrentDate));
$todaysDate=date("j",strtotime(date("m/d/y")));
$mmon=date("m",strtotime ($CurrentDate));
$myear=date("Y",strtotime ($CurrentDate));
$noOfDays=date("t",strtotime ($CurrentDate));
$WriteMonth.="";
$WriteMonth.="<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" width=\"200\"><tr><td colspan=\"2\" valign=top align=\"left\">";
$WriteMonth.="<a href=\"?txtDay=".date("m/1/y", strtotime ("$CurrentDate -1 months"))."\"><font color=\"#6699cc\"><<</font></a></td><td colspan=\"3\" align=\"center\"><a href=\"?txtDay=".date("m/1/y", strtotime ("$StartDate months"))."\"><b><font color=\"#6699cc\">".$thaimonth[date("m", strtotime ($StartDate)) - 1]." ".(date("Y",strtotime ($StartDate)) + 543);
$WriteMonth.="</font></b> </a></td><td colspan=\"2\" valign=top align=\"right\">";
$WriteMonth.="<a href=\"?txtDay=".date("m/1/y", strtotime ("$StartDate +1 months"))."\"><font color=\"#6699cc\">>></font></a>";
$WriteMonth.="</td></tr><tr bgcolor=\"#6699cc\">";
$WriteMonth.="<td align='center'><B><font color=\"#FF0000\">Sun</font></B></td>";
$WriteMonth.="<td align='center'><B><font color=\"#000066\">Mon</font></B></td>";
$WriteMonth.="<td align='center'><B><font color=\"#000066\">Tue</font></B></td>";
$WriteMonth.="<td align='center'><B><font color=\"#000066\">Wed</font></B></td>";
$WriteMonth.="<td align='center'><B><font color=\"#000066\">Thu</font></B></td>";
$WriteMonth.="<td align='center'><B><font color=\"#000066\">Fri</font></B></td>";
$WriteMonth.="<td align='center'><B><font color=\"#000066\">Sat</font></B></td>";
$WriteMonth.="</tr>";
$startMonth=date("$myear/$setMonth/01");
$endMonth=date("$myear/$setMonth/$noOfDays");
$WriteMonth .= "<tr>";
for($i=1;$i<=$noOfDays;$i++) {
$coolmonth=date("$setMonth/$i/$myear");
$TBD=date("j",strtotime ($coolmonth));
$BD=date("j",strtotime ($coolmonth));
$BDay=date("D",strtotime ($coolmonth));
if ($todaysDate==$TBD) {
$BD= "<B><font color=\"#FFFFFF\">$TBD</font></B>";
}
$BD = "<td align=\"center\" bgcolor = \"#6699cc\"><font color=\"#000066\">$BD </font></td>";
switch($BDay){
case 'Sun':
$WriteMonth .= "$BD";
break;
case 'Mon':
if ($TBD==1) $WriteMonth .= "<td> </td>";
$WriteMonth .= "$BD";
break;
case 'Tue':
if($TBD==1) $WriteMonth .= "<td> </td><td> </td>";
$WriteMonth .= "$BD";
break;
case 'Wed':
if($TBD==1) $WriteMonth .= "<td> </td><td> </td><td> </td>";
$WriteMonth .= "$BD";
break;
case 'Thu':
if($TBD==1) $WriteMonth .= "<td> </td><td> </td><td> </td><td> </td>";
$WriteMonth .= "$BD";
break;
case 'Fri':
if($TBD==1) $WriteMonth .= "<td> </td><td> </td><td> </td><td> </td><td> </td>";
$WriteMonth .= "$BD";
break;
case 'Sat':
if($TBD==1) $WriteMonth .= "<td> </td><td> </td><td> </td><td> </td><td> </td><td>;</td>";
$WriteMonth .= "$BD";
$WriteMonth .="</tr><tr>";
break;
}
}
$WriteMonth .="</table>";
return $WriteMonth;
}
echo
?> </TD></TR>
</TABLE>
<BR>
</span>
</body>
</html>
|
|
|
|
|
Date :
12 ก.พ. 2550 16:31:18 |
By :
arsachi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|