|
|
|
อยากได้ Code php ปฏิทิน ผมขอ Code แบบ ที่เขยนง่ายๆๆ พอดีต้องการทำ ความเข้าจัยเองเเล้วเขียนเพื่มเติม |
|
|
|
|
|
|
|
แสดงทั้งปีในหน้าเดียว
--------------------------------------------------------------------------------
<!--
th { font-size:12pt;
line-height:14pt;
font-family:Helvetica,Arial;
}
//-->
</style>
<?
$year=1999;
print("<table border='0' width='200'>\n");
for($month=1;$month<13;$month++) {
printf("<tr>\n<th colspan='7'>%s</th></tr>\n",date("F",mktime(0,0,0,$month,1,$year)));
printf
("<tr><th>อา.</th><th>จ.</th><th>อ.</th><th>พ.</th><th>พฤ.</th><th>ศ.</th><th>ส.</th></tr>");
$fdom=date("w",mktime(0,0,0,$month,1,$year));
$ct=0;
for($row=1;$row<7;$row++)
{
print("\n<tr>");
for($week=1;$week<8;$week++)
{
$ct++;
$value=mktime(0,0,0,$month,$ct-$fdom,$year);
if (date("m",$value)==$month)
{
printf ("<th>%s</th>",date("d",$value));
}
else { print("<td></td>"); }
}
print("</tr>\n");
}
print("<tr><td colspan='7'><br><br></td></tr>");
}
print("</table>");
?>
|
|
|
|
|
Date :
10 ม.ค. 2550 15:38:35 |
By :
lfc_may |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
แสดงทีละเดือน
--------------------------------------------------------------------------------
<?
echo "<html>";
echo "<head>";
echo "</head>";
echo "<body bgcolor=\"#000066\" VLINK = \"#6699cc\">";
echo "<P>";
echo "<table border=\"1\" cellpadding=\"1\" style=\"border-collapse: collapse\" bordercolor=\"#6699cc\" width=\"15%\" 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=\"150\" ><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>";
?>
|
|
|
|
|
Date :
10 ม.ค. 2550 15:39:21 |
By :
lfc_may |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณมากคับบบ
|
|
|
|
|
Date :
11 ม.ค. 2550 14:04:59 |
By :
DeviL |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ไว้ จะ ลอง ไป ใช้ ดู บ้าง นะ แล้ว จะ มา บอก ใหม่ ว่า เจ๋ง แค่ ไหน เหอ ๆ
|
|
|
|
|
Date :
18 ม.ค. 2550 00:47:49 |
By :
ka!nhoon |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุงคับผม
singbaba
|
|
|
|
|
Date :
9 พ.ย. 2550 09:53:06 |
By :
singbaba |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอด้วยคน
ขอบคุณค่ะ
|
|
|
|
|
Date :
3 ม.ค. 2551 08:36:56 |
By :
Starnic |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
thank you
|
|
|
|
|
Date :
26 ส.ค. 2551 14:34:30 |
By :
jangfake |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณมากครับ ขอไปศึกษานะครับ
|
|
|
|
|
Date :
2009-11-21 19:30:42 |
By :
BigTUI |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
แล้วแบบที่เลือกดูวันที่ เดือนของแต่ละปีได้ละ
เขยีนไงอะคับ
|
|
|
|
|
Date :
2010-01-15 10:20:48 |
By :
adunafah |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบใจมากครับ
|
|
|
|
|
Date :
2010-05-20 09:54:01 |
By :
yokami |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณครับผม
|
|
|
|
|
Date :
2010-08-19 13:36:13 |
By :
champ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
thanks
|
|
|
|
|
Date :
2010-08-19 22:00:26 |
By :
nirunsu |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณมากค่ะ
|
|
|
|
|
Date :
2010-10-19 21:44:56 |
By :
meaw |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณค๊าาา
|
|
|
|
|
Date :
2011-04-11 18:39:29 |
By :
แพรว |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[2b]ขอบคุณค่าาา[/2b]
|
|
|
|
|
Date :
2011-12-11 18:10:43 |
By :
เฟือง |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<i>ขอบคุณด้วยคนครับ</i>
|
|
|
|
|
Date :
2011-12-11 20:40:25 |
By :
The3estwishes |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณมากๆเลยคะ
|
|
|
|
|
Date :
2012-06-26 16:13:22 |
By :
Meme |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|