供各種圖案窗簾、壁紙裝潢服務 專業到府丈量、送樣估價 | ![]() | 專業壁癌處理,效率施作、價格公道 人員現場估價,完全免費! |
[測試]月曆 |
房東:小乖 發表時間:2010-11-06 |
現在卡在 怎把線上新增的行事 tile 加入到月曆表格裡面 $mydate = date("d",$date); 抓出要比對的日期 那要怎麼把資料顯示在月曆表格裡面 $query = "select * from $calendar where username='$username' and FROM_UNIXTIME(date, '%Y-%c') = '$MyYear-$MyMonth' order by date"; $result=mysql_query($query); $number = mysql_num_rows($result); $i = 1; while ($i <= $number){ $row = mysql_fetch_array($result); $id=$row["id"]; $title=$row["title"]; $date=$row["date"]; $mydate = date("d",$date); echo"title "; $i++; } 下面是月曆表格 的 script //檢查是否query string有指定年月 if (isset($_GET['m']) && is_numeric($_GET['m']) && $_GET['m'] <=12 && isset($_GET['y']) && is_numeric($_GET['y']) ) { $MyMonth = (int)$_GET['m']; $MyYear = (int)$_GET['y']; } else { $MyYear = date("Y");// 如沒有 使用當下年月 $MyMonth = date("n"); } $MyDay = date("j"); //抓出 現在的年月的1號的timestamp $MyDays = mktime(0,0,1,$MyMonth,1,$MyYear); //先決定1號從表格中哪一位置開始擺 //抓出 現在年月的1號是星期幾,然後顯示在對應的表格方格內 //計算上個月 $pm = date("n", mktime(0,0,0,$MyMonth-1, 1, $MyYear)); $py = date("Y", mktime(0,0,0,$MyMonth-1, 1, $MyYear)); //下個月 $nm = date("n", mktime(0,0,0,$MyMonth+1, 1, $MyYear)); $ny = date("Y", mktime(0,0,0,$MyMonth+1, 1, $MyYear)); $previousMonthLink = " $nextMonthLink = "下個月 echo "$previousMonthLink 新增行程 $nextMonthLink"; ?>
|
|
租屋網 提供租屋資訊、租屋廣告刊登、房屋託租、房客尋屋、租屋配對、電子地圖、房屋資料上傳 明日黃金屋 買屋、賣屋、租屋、出租、房東租屋刊登、並提供租屋、最專業的服務、最安全親切的交易。 搬家公司 本公司為政府立案專業搬家公司,我們秉持客戶至上,正派經營理念,在大台北縣市一直有口碑 |