|
|
|
ขอผู้รู้ช่วยดูให้หน่อยครับ ทำใมผมกดเปลี่ยนเดือนไม่ได้ |
|
|
|
|
|
|
|
ช่วยดูให้หน่อยครับ ทำใมผมกดเปลี่ยนเดือนไม่ได้
Code (PHP)
<center><form action="add2.php" method="POST" enctype="multipart/form-date">
<table>
<tr>
<td align="right"><b><span style='color:#0000FF;'>นัดวันรับสิงค้า :</span></b></td>
<style type="text/css">
<!--
body { margin: 0px 0px; padding: 0px 0px}
a:link { color: #005CA2; text-decoration: none}
a:visited { color: #005CA2; text-decoration: none}
a:active { color: #0099FF; text-decoration: underline}
a:hover { color: #0099FF; text-decoration: underline}
-->
</style>
<td><div align="lift"><font color="#0000FF" style="font-family:sans-serif" size="+6">
<?
$a= date(j); // , 1 to 31
$b = date(a); // am,
$c = date(A); // AM,
$d = date(B); // Swatch Internet time 000 -999
$e = date(d); // , 01 to 31
$f = date(D); // , sat
$g = date(F); // , November
$h = date(g); // , 1 through 12
$hh = date(G); // , 0 through 23
$i = date(h); // , 01 through 12
$j = date(H); // , 00 through 23
$k = date(i); // , 00 to 59
$l = date(I); // 0, 1 if Daylight Savings Time, 0 otherwise.
$m = date(l); // , Sunday through Saturday
$n = date(L); // 0, 1 if it is a leap year, 0 otherwise.
$o = date(m); // , 01 through 12
$p = date(M); // , Jan through Dec
$q = date(n); // , 1 through 12
$r = date(o); // Example: +0200
$s = date(r); // Example: Thu, 21 Dec 2000 16:01:07 +0200
$t = date(s); // 00 through 59
$u = date(S); // st, nd, rd or th. Works well with j
$v = date(t); // 28 through 31
$w = date(T); // time zoneseting Examples: EST, MDT ...
$x = date(u); // See also time()
$y = date(w); // 0 (for Sunday) through 6 (for Saturday)
$z = date(W); // Example: 42 (the 42nd week in the year)
$aa = date(y); // Examples: 99 or 03
$bb = date(Y); // Examples: 1999 or 2003
$cc = date(z);
$dd = date(Z);
if(!$mon){
$mon = $o ;
}else{
$mon = $mon ;
}
if(!$year){
$year = $bb ;
}else{
$year = $year;
}
$firstday = mktime(0,0,0,$mon,1,$bb);
$firstdays = date('w',$firstday);
$lastdays = date('t',$firstday);
$year_view = date('Y',$firstday);
$mon_view = date('m',$firstday);
$thaimon=array("","มค.","กพ.","มีค.","เมย.","พค.","มิย.","กค.","สค.","กย.","ตค.", "พย.","ธค.");
$thai_mon=$thaimon[$mon_view];
echo"
<script>
function d_s( su , mnp){
if(mnp=='n'){
document.dat_form.mon.value=su-1;
}else{
document.dat_form.mon.value=su+1;
}
document.dat_form.submit();
}
</script>
<form name=dat_form action='$PHP_SELF' method=post>
<input type=hidden name=mon value=''>
<table border=1 width=200 cellpadding=0 cellspacing=0 bordercolor=#999999>
<tr bgcolor=pink>
<td colspan=7 align=center><a href=\"javascript:d_s($mon,'n')\"> << </a> $thai_mon $year_view <a href=\"javascript:d_s($mon,'m')\"> >> </a>
</td>
</tr>
</form>
<tr align=center>
<td><center><font color=red>อา</a></td><td>จ</td><td>อ</td><td>พ</td><td>พฤ</td><td>ศ</td><td><font color=blue>ส</font></td></center>
</tr>
<tr align=right>";
////
for($i = 0; $i < 7 ; $i++){
if($firstdays == $i){
break;
}else{
echo"<td width=8> </td>";
}
$week++;
}
for($i=1; $i<=$lastdays ;$i++){
if($week % 7 == 0){
echo"</tr><tr align=right>";
}
if($a == $i){
$bgcolor = "bgcolor=pink";
}else{
$bgcolor = '';
}
if($week%7==0){
echo"<td $bgcolor><center><font size=2 color=red><a href=\"add.php?date_n=$i/$mon_view/$year_view\">$i</a></font></center></td>";
}else if($week%7==6){
echo"<td $bgcolor><center><font size=2 color=blue><a href=\"add.php?date_n=$i/$mon_view/$year_view\">$i</a></font></center></td>";
}else{ //
echo"<td $bgcolor><center><font size=2><a href=\"add.php?date_n=$i/$mon_view/$year_view\">$i</a></font></center></td>";
}
$week++;
}
while($week%7!=0){
echo"<td> </td>";
$week++;
}
echo"</tr></table>";
?>
</td>
</tr>
<tr>
<td align="right"><b><span style='color:#0000FF;'>ชื่อ - นามสกุล :</span></b></td>
<td><input name="ืname" type="text" size="30"></td>
</tr>
<tr>
<td align="right"><b><span style='color:#0000FF;'>หมายเลขบัตรประชาชน :</span></b></td>
<td><input name="post" type="text" size="13" maxlength="13"></td>
</tr>
<tr>
<td align="right"><b><span style='color:#0000FF;'>เบอร์โทรศัพท์ :</span></b></td>
<td><input name="tel" type="text" size="10" maxlength="10"></td>
</tr>
<tr>
<td align="right" valign="top"><b><span style='color:#0000FF;'>ที่อยู่ ติดต่อ :</span></b></td>
<td><textarea name="address" cols="50" rows="5"></textarea></td>
</tr>
<tr>
<td align="right" valign="top"><b><span style='color:#0000FF;'>อาการ :</span></b></td>
<td><textarea name="title" cols="50" rows="5"></textarea></td>
</tr>
<tr>
<td align="right" valign="top"><b><span style='color:#0000FF;'>วันนัด :</span></b></td>
<td><input name="post" type="text" size="7" value="<? echo $date_n; ?>" disabled="disabled" readonly="readonly"></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="บันทึกรายงาน"><input type="reset" value="ล้างออก"></td>
</tr>
</table>
</form></center>
มันบอกว่า error ตรงนี้นะครับ
Code (PHP)
script>
function d_s( su , mnp){
if(mnp=='n'){
document.dat_form.mon.value=su-1;
}else{
document.dat_form.mon.value=su+1;
}
document.dat_form.submit();
}
</script>
ช่วยดูให้หน่อยครับ
Tag : PHP, JavaScript
|
|
|
|
|
|
Date :
2010-10-19 10:57:19 |
By :
mosaddzero |
View :
853 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณมากครับ ที่ให้คำแนะนำ ได้แล้วครับ ผมพลาดเอง ผมลืมใส่ชื่อ from ครับ
|
|
|
|
|
Date :
2010-10-20 09:04:21 |
By :
mosaddzero |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|