|
 |
|
เกี่ยวกับ ปฏิทิน กิจกรรม ช่วยดูุโค๊ดให้หน่อยครับ |
|
 |
|
|
 |
 |
|
เมื่อผม คลิก ตรงวันที่ ในปฏิทิน มันเรียกค่าจากฐานข้อมูล มา แต่มันว่าง ป่าวอ่ะครับ

ผลที่ออกมาครับ

แต่ถ้าผมพิมพ์ วันที่ลงใน ช่อง มันจะเรียกจากฐานข้อมูลได้อะคับ

ผลที่เรียกจากฐานข้อมูล

นี่code ครับ ต้องแก้ตรงไหน ถึงจะคลิกจากวันที่ได้โดยตรงเลยอ่ะครับบบ ดูให้หน่อยครับบบ ^^
Code (PHP)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<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>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title>Untitled Document</title>
<form id="form1" name="form1" method="post" action="sample2.php">
<table width="0" border="0" cellpadding="1" cellspacing="1">
<tr>
<td bgcolor="f2f2f2"><div align="center"><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);
echo"
<script>
function d_s( su , mnp){
if(mnp == 'm'){
document.dat_form.mon.value = su - 1 ;
}else{
document.dat_form.mon.value = su + 1 ;
}
document.dat_form.submit();
}
</script>
<table border=1 width=140 cellpadding=0 cellspacing=0 bordercolor=#999999>
<tr bgcolor=pink>
<td colspan=7 align=center><a href=\"javascript:d_s($mon,'m')\"><</a> $year_view - $mon_view <a href=\"javascript:d_s($mon,'p')\">></a></td>
</tr>
<tr align=center><td><font color=red>อา</a></td><td>จ</td><td>อ</td><td>พ</td><td>พฤ</td><td>ศ</td><td><font color=blue>ส</font></td></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><font size=2 color=red><a href=\"sample2.php?date=$i/$mon_view/$year_view\">$i</a></font></td>";
}else if($week%7==6){
echo"<td $bgcolor><font size=2 color=blue><a href=\"sample2.php?date=$i/$mon_view/$year_view\">$i</a></font></td>";
}else{ //
echo"<td $bgcolor><font size=2><a href=\"sample2.php?date=$i/$mon_view/$year_view\">$i</a></font></td>";
}
$week++;
}
while($week%7!=0){
echo"<td> </td>";
$week++;
}
echo"</tr>
</table>
";
?>
</font></div></td>
<td bgcolor="f2f2f2"><div align="center">เลือกวันที่ต้องการค้นหาตารางนัด</div></td>
</tr>
<tr>
<td bgcolor="f2f2f2"></td>
<td bgcolor="f2f2f2"><img name="" src="" width="250" height="2" alt="ห" /></td>
</tr>
<tr>
<td bgcolor="f2f2f2">วัน/เดือน/ปี</td>
<td bgcolor="f2f2f2"><label>
<input name="date" type="text" id="date" value="<? echo $test; ?>" />
</label></td>
</tr>
<tr>
<td bgcolor="f2f2f2"> </td>
<td bgcolor="f2f2f2"><label>
<label></label>
</label>
<label>
<div align="center">
<input type="submit" name="Submit" value="ค้นหา""/>
</div>
</label></td>
</tr>
</table>
</form>
</body>
</html>
Tag : PHP, MySQL

|
|
 |
 |
 |
 |
Date :
2012-05-14 14:20:31 |
By :
B[O]YA |
View :
1045 |
Reply :
4 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองอธิบายเพิ่มเติมครับ เผื่อจะช่วยตอบได้ครับ 
|
 |
 |
 |
 |
Date :
2012-05-14 15:48:03 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คืออย่างงี้นะครับพี่วิน ถ้าผม ใส่วันที่จะค้นหา ลงในช่อง textfield มันจะสามารถ เรียก ข้อมูล กิจกรรม จากฐานข้อมูลมาได้
แต่ ถ้า ผม คลิกโดยตรงจาก ปฏิทิน ในวันที่ เลย มันจะไม่โชว์ค่าอะไรออกมาเลย ทั้งๆที่มีกิจกรรมของวันนั้น อยู่ในฐานข้อมูล อ่ะครับ
ผมจึงอยากให้มัน คลิ๊ก ที่วันที่ในปฏิทิน แล้ว แสดงหน้า กิจกรรมออกมาอีก หน้าเลย ไม่ต้อง ไป search
พอเข้าใจไหมครับ 
|
 |
 |
 |
 |
Date :
2012-05-14 16:06:46 |
By :
B[O]YA |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
     
|
 |
 |
 |
 |
Date :
2012-05-14 17:23:36 |
By :
B[O]YA |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|

แจกฟรี ปฏิทินกิจกรรม PHP กับฐานข้อมูล MySQL Database เอาไปใช้กันแบบฟรี !!
|
 |
 |
 |
 |
Date :
2013-04-05 10:39:57 |
By :
tc |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|