จองคิวเข้าเยียมชมอุทยานวิทยาศาสตร์พระจอมเกล้า ณ หว้ากอ

จังหวัดประจวบคีรีขันธ์

','',''); ?>
'; echo $exday1.'
'; echo $exday2.'
'; echo $exday3.'
'; echo $exday4.'
'; echo $exday5.'
'; echo $exday6.'
'; echo $exday7.'
'; echo $type.'
'; echo $org.'
'; echo $resercount.'
'; echo $province.'
'; echo $resername.'
'; echo $tel.'
'; echo $email.'
'; echo $uploadday.'
'; echo $uploadtime.'
'; if ($exday1 == "18"){ } $strSQL = "INSERT INTO ".$tablename." (ID,exday18,exday19,exday20,exday21,exday22,exday23,exday24,resertype,reserorg,resercount,reserprovince,resername,resertel,reseremail,uploadday,uploadtime)"; $strSQL = $strSQL."VALUES('','$exday1','$exday2','$exday3','$exday4','$exday5','$exday6','$exday7','$type','$org','$resercount','$province','$resername','$tel','$email','$uploadday','$uploadtime')"; if (! mysql_query($strSQL)){ $dberr="mysql_errer"; return false; } mysql_close(); return true; }//จบinsertdata function resercount($tablename,$year,$month){ //echo 'ปี'.$year.'
'; //echo 'เดือน'.$month.'
'; $strSQL = "SELECT * FROM ".$tablename." WHERE bookDate LIKE '%$month/$year%' ORDER BY ID"; $result = mysql_query($strSQL); //echo 'ฟังก์ชั่น resercount'.$strSQL.'
'; //echo $strSQL.'
'; $Num_Rows = mysql_num_rows($result); //echo $Num_Rows.'แถว
'; $daycount = 0; while ($row = mysql_fetch_array($result)){ $resercount = stripslashes($row["resercount"]); $daycount = $daycount + $resercount; } echo '
เดือนนี้มีผู้จองคิว จำนวน '.$daycount.' คน คลิ๊กวันที่ เพื่อดูรายละเอียดผู้จองคิว

'; return $daycount.'
'; } function Showdatabase() { global $tablename; $year = '2020'; $month = '6'; //resercount($tablename,$year,$month); } function Showdatabase2() { global $tablename; echo '
'; $month_array=array("01"=>"มกราคม","02"=>"กุมภาพันธ์","03"=>"มีนาคม","04"=>"เมษายน","05"=>"พฤษภาคม","06"=>"มิถุนายน","07"=>"กรกฎาคม","08"=>"สิงหาคม","09"=>"กันยายน","10"=>"ตุลาคม","11"=>"พฤษจิกายน","12"=>"ธันวาคม"); $day_array=array(0 => "อาทิตย์", 1 => "จันทร์", 2 => "อังคาร", 3 => "พุธ", 4 => "พฤหัสบดี", 5 => "ศุกร์", 6 => "เสาร์"); $shortday_array=array(0 => "อา", 1 => "จ", 2 => "อ", 3 => "พ", 4 => "พฤ", 5 => "ศ", 6 => "ส"); $current_day=date("d");//หาค่าวันที่ปัจจุบัน $current_day_name=date("w");//หาตัวเลข0-6วันในสัปดาห์ $current_year=date("Y");//หาค่าปี ค.ศ. ปัจจุบัน $current_month=date("m");//หาค่าตัวเลขเดือน 01-12 $current_month_name=date("F");//หาค่าชื่อเดือนภาษาอังกฤษ $current_date=date("Ymd"); $month = mysql_real_escape_string($_GET['month']); $year = mysql_real_escape_string($_GET['year']) ; if(!$month){ $month=$current_month; } if(!$year){ $year=$current_year; } //$month = str_pad($month, 2,'0',STR_PAD_LEFT); $nonzeromonth = (int)$month; ///ตัดเลข 0 หน้าเดือน //echo $nonzeromonth; resercount($tablename,$year,$nonzeromonth); //$hhh = 6; //echo str_pad($hhh, 2,'0',STR_PAD_LEFT); $startDay = $year.'-'.$month."-01"; //วันที่เริ่มต้นของเดือน ///echo 'startDay = '.$startDay; $timeDate = strtotime($startDay); //เปลี่ยนวันที่เป็น timestamp ///echo 'timeDate = '.$timeDate; //$month = 1; $days_in_month=cal_days_in_month(CAL_GREGORIAN,$month,$year);//หาจำนวนวันในเดือนและปีที่แสดงผล $first_day_of_month=date("w",mktime(0,0,0,$month,1,$year)); //หาวันแรกขอเดือน /* echo '
วัน'.$day_array[$current_day_name]; echo '
วันที่ '.$current_day; echo '
เดือนที่ '.$month; echo '
เดือน '.$month_array[$month]; echo '
ปี '.$year; echo '
จำนวนวันในเดือนนี้ '.$days_in_month; echo '
วันแรกของเดือนคือ วัน'.$day_array[$first_day_of_month].'


'; echo $month; */ $showdate = 'เดือน '.$month_array[$month].' ปี '.($year+543); //ลดเวลาลง 1 เดือน $prevMonTime = strtotime ( '-1 month' , $timeDate ); $prevMon = date('m', $prevMonTime); $prevYear = date('Y', $prevMonTime); //เพิ่มเวลาขึ้น 1 เดือน $nextMonTime = strtotime ( '+1 month' , $timeDate ); $nextMon = date('m', $nextMonTime); $nextYear = date('Y', $nextMonTime); echo '
'; echo '
'; echo ''; echo ''; echo ""; //เปิดแถวใหม่ $col = $first_day_of_month; //ให้นับลำดับคอลัมน์จาก ตำแหน่งของ วันในสับดาห์ //echo $col; if($first_day_of_month < 7){ //ถ้าวันอาทิตย์จะเป็น 7 echo str_repeat("", $first_day_of_month); } for($i = 1;$i <= $days_in_month ; $i++){ $col++; //นับจำนวนคอลัมน์ เพื่อนำไปเช็กว่าครบ 7 คอลัมน์รึยัง echo ''; if($col % 7 == false){ //ถ้าครบ 7 คอลัมน์ให้ขึ้นบรรทัดใหม่ echo ""; //ปิดแถวเดิม และขึ้นแถวใหม่ $col = 0; //เริ่มตัวนับคอลัมน์ใหม่ } } if($col < 7){ // ถ้ายังไม่ครบ7 วัน echo str_repeat("", 7-$col); //สร้างคอลัมน์ให้ครบตามจำนวนที่ขาด } echo ''; //ปิดแถวสุดท้าย echo '
อาทิตย์จันทร์อังคารพุธพฤหัสบดีศุกร์เสาร์
';//สร้างคอลัมน์ แสดงวันที่ echo ''.$i.''; echo '
'; echo '
'; changelang("

ไปหน้าจอง","",""); } if ($tablename == "booking"){ if ((($exday1)or($exday2)or($exday3)or($exday4)or($exday5)or($exday6)or($exday7))and $resercount and $resername and $tel){ $result=insertData($exday1,$exday2,$exday3,$exday4,$exday5,$exday6,$exday7,$type,$org,$resercount,$province,$resername,$tel,$email); if (! $result){ echo "ไม่สามารถเพิ่มข้อมูลการจองได้"; }else{ echo"เพิ่มข้อมูลเรียบร้อยแล้ว"; if ($tablename == "booking"){ echo ""; } } }else{ //Showdatabase(); Showdatabase2(); } }else{ echo''; } ?>