|
|
|
ใครเก่งปฎิทินช่วยหน่อยครับผมเปลี่ยนเดือนไม่ได้ทำไง T-Tกรุณาด้วย |
|
|
|
|
|
|
|
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
</head>
<body>
<script language="JavaScript">
<!-- Begin
monthnum = new Array(
"01",
"02",
"03",
"04",
"05",
"06",
"07",
"08",
"09",
"10",
"11",
"12");
monthnames = new Array(
"January",
"Februrary",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"Decemeber");
var linkcount=0;
function addlink(month, day, href) {
var entry = new Array(3);
entry[0] = month;
entry[1] = day;
entry[2] = href;
this[linkcount++] = entry;
}
Array.prototype.addlink = addlink;
linkdays = new Array();
monthdays = new Array(12);
monthdays[0]=31;
monthdays[1]=28;
monthdays[2]=31;
monthdays[3]=30;
monthdays[4]=31;
monthdays[5]=30;
monthdays[6]=31;
monthdays[7]=31;
monthdays[8]=30;
monthdays[9]=31;
monthdays[10]=30;
monthdays[11]=31;
todayDate=new Date();
thisday=todayDate.getDay();
thismonth=todayDate.getMonth();
thisdate=todayDate.getDate();
thisyear=todayDate.getYear();
thisyear = thisyear % 100;
thisyear = ((thisyear < 50) ? (2000 + thisyear) : (1900 + thisyear));
if (((thisyear % 4 == 0)
&& !(thisyear % 100 == 0))
||(thisyear % 400 == 0)) monthdays[1]++;
startspaces=thisdate;
while (startspaces > 7) startspaces-=7;
startspaces = thisday - startspaces + 1;
if (startspaces < 0) startspaces+=7;
document.write("<table width='98%' bgcolor=white ");
document.write("bordercolor=black>");
document.write("<tr ><td colspan=7 bgcolor=gray><font color=white><center>"
+ monthnames[thismonth] + " " + thisyear
+ "</center></font></td></tr>");
document.write("<tr>");
document.write("<td align=center>อา</td>");
document.write("<td align=center>จ</td>");
document.write("<td align=center>อ</td>");
document.write("<td align=center>พ</td>");
document.write("<td align=center>พฤ</td>");
document.write("<td align=center>ศ</td>");
document.write("<td align=center>ส</td>");
document.write("</tr>");
document.write("<tr>");
for (s=0;s<startspaces;s++) {
document.write("<td align=center>"+'-'+"</td>");
}
count=1;
while (count <= monthdays[thismonth]) {
for (b = startspaces;b<7;b++) {
linktrue=false;
document.write("<td align=center>");
for (c=0;c<linkdays.length;c++) {
if (linkdays[c] != null) {
if ((linkdays[c][0]==thismonth + 1) && (linkdays[c][1]==count)) {
linktrue=true;
}
}
}
document.write("<a href=\"show.php?cdate="+thisyear+ "-" + monthnum[thismonth] + "-" + count+"\">");
if (count==thisdate) {
document.write("<font color='FF0000'><strong>");
}
if (count <= monthdays[thismonth]) {
document.write(count);
}
else {
document.write(" ");
}
if (count==thisdate) {
document.write("</strong></font>");
}
document.write("</a>");
if (linktrue)
document.write("</td>");
count++;
}
document.write("</tr>");
document.write("<tr>");
startspaces=0;
}
document.write("</table>");
// End -->
</script>
</body>
</html>
Tag : - - - -
|
|
|
|
|
|
Date :
5 ต.ค. 2549 11:25:10 |
By :
bankchan |
View :
1707 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<html>
<head><title>ปฏิทินเหตุการณ์</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<style type="text/css">
.today {font-family: ms sans serif; font-size: 9pt; font-weight: bold; background-color: #000000; color:#FFFFFF;
border:3 double #000000; }
.sunday {font-family: ms sans serif; font-size: 9pt; font-weight: bold; background-color: #FF0000; color:#FFFFFF; }
.norm {font-family: ms sans serif; font-size: 9pt; font-weight: bold; background-color: #FFFFFF; color:#000000; }
</style>
</head>
<body>
<?php
$diffHour=0;
$diffMinute=0;
if ($dfMonth =="")
{
$calTime=getdate(date(mkTime(date("H")+$diffHour,date(i)+$diffMinute)));
$today=$calTime["mday"]; // วันที่
$month=$calTime["mon"]; // เดือน
$year=$calTime["year"]; // ปี
}
else
{
if ($dfMonth==0)
{
$dfMonth=12;
$dfYear=$dfYear-1;
}
elseif(dfMonth==13)
{
$dfMonth=1;
$dfYear=$dfYear+1;
}
$calTime=getdate(date(mkTime((date("H")+$diffHour),(date("i")+$diffMinute),0,$dfMonth,$today,$dfYear)));
$today=$calTime["mday"]; // วันที่
$month=$calTime["mon"]; // เดือน
$year=$calTime["year"]; // ปี
}
$Lday=Lastday($month,$year);
$FTime=getdate(date(mkTime(0,0,0,$month,1,$year)));
$wday=$FTime["wday"];
$thmonthname=array("มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม",
"พฤศจิกายน","ธันวาคม");
function Lastday($m,$y)
{
for ($i=29;$i<=32;$i++)
{
if (checkdate($m,$i,$y)==0)
{
return $i - 1;
}
}
}
?>
<!--cellpadding="0" cellspacing="0"-->
<table border="0" bordercolor="black" width="100%" align="center" bgcolor="#efefef">
<tr class="norm"><td width="20" align="center" bgcolor="#1EB533">
<a href ="<?php echo $PHP_SELF; ?>
?today=<?php echo $today; ?>
&dfMonth=<?php echo ($month -1) ?>
&dfYear=<?php echo $year; ?> "><</a>
</td>
<td width="120" align="center" colspan="5" bgcolor="#1EB533">
<?php echo $thmonthname[$month-1]; ?>
<?php echo ($year+543); ?>
</td>
<td width="20" align="center" bgcolor="#1EB533">
<a href="<?php echo $PHP_SELF; ?>
?today=<?php echo $today; ?>
&dfMonth=<?php echo ($month+1); ?>
&dfYear=<?php echo $year; ?>">></a>
</td></tr>
<tr><td width="20" align="center" class="sunday">อา</td>
<td width="20" align="center" class="norm">จ</td>
<td width="20" align="center" class="norm">อ</td>
<td width="20" align="center" class="norm">พ</td>
<td width="20" align="center" class="norm">พฤ</td>
<td width="20" align="center" class="norm">ศ</td>
<td width="20" align="center" class="norm">ส</td></tr>
<?php
$iday=1;
//แสดงแถวแรกของปฏิทิน
for($i=0;$i<=6;$i++) {
if($i<$wday) {
if($i==0) {
echo "<td width="20" align="center" class="sunday"> </td>n";
}
else{
echo "<td width="20" align="center" class="norm"> </td>n";
}
}
else{
if($i==0 && ($iday !=$today)){
echo "<td width="20" align="center" class="sunday">$iday</td>n";
}
elseif($iday==$today){
echo "<td width="20" align="center" class="today">$iday</td>n";
}
else{
echo "<td width="20" align="center" class="norm">$iday</td>n";
}
$iday++;
}
}
//แสดงแถวที่เหลือของปฏิทิน
for($j=0;$j<=4;$j++){
if($iday<=$Lday){
echo "<tr>n";
for($i=0;$i<=6;$i++){
if($iday<=$Lday){
if($i==0 && ($iday !=$today)){
echo "<td width="20" align="center" class="sunday">$iday</td>n";
}
elseif($i==0 && ($iday ==$today)){
echo "<td width="20" align="center" class="today">$iday</td>n";
}
elseif ($iday ==$today){
echo "<td width="20" align="center" class="today">$iday</td>n";
}
else{
echo "<td width="20" align="center" class="norm">$iday</td>n";
}
$iday++;
}
else{
echo "<td width="20" align="center" class="norm"> </td>n";
}
}
echo "</tr>n";
}
else{
break;
}
}
?>
<tr bgcolor="#1EB533">
<td width="100%" colspan="7" align="center">
<a href="<?php echo $PHP_SELF; ?>">วันที่ปัจจุบัน</a></td></tr>
</table>
</body>
</html>
|
|
|
|
|
Date :
5 ต.ค. 2549 16:43:10 |
By :
wongvian |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|