?
Path : /home/admin/domains/happytokorea.com/public_html/backend/modules/tour/ |
Current File : /home/admin/domains/happytokorea.com/public_html/backend/modules/tour/add_do.php |
<? session_start(); require_once('../../../config.php'); require_once('../../../libs/MySql.php'); require_once('../../../libs/function.php'); require_once('../../../libs/global.php'); require_once('../../../libs/backoff_ajax.php'); require_once('../../../libs/backoff.php'); require_once('../../modules/users/mod_user.php'); $db=new MySql; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML xmlns="http://www.w3.org/1999/xhtml"> <HEAD> <TITLE><?echo $cfg['site_name'];?></TITLE> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <META content="" name=Keywords> <META content="<?echo $cfg['site_name'];?>" name="Description"> <META content="<?echo $cfg['site_name'];?>" name="Author"> <META content="<?echo $cfg['site_name'];?>" name="Copyright"> <LINK href="../../css/backend_style.css" type="text/css" rel="stylesheet"> <? //check date time $start_date=$_POST['check_in']; $end_date=$_POST['check_out']; //$start_date=explode("/",$start); // $start_date=$start_date[2]."-".$start_date[1]."-".$start_date[0]; // $end_date=explode("/",$end); // $end_date=$end_date[2]."-".$end_date[1]."-".$end_date[0]; $sp_start_date=strtotime($start_date); $sp_end_date=strtotime($end_date); if ($_SESSION["la"] == 1){ $sql="SELECT * FROM time_schedule1 WHERE tour_id='".$tour_id."' AND start_date='".$start_date."' AND end_date='".$end_date."'"; }else{ $sql="SELECT * FROM time_schedule1_en WHERE tour_id='".$tour_id."' AND start_date='".$start_date."' AND end_date='".$end_date."'"; } $db->setQuery($sql); $db->QueryReturn(); if($db->numRows()>0){ echo"<br><center><font size=3> ช่วงเวลานี้มีในฐานข้อมูลแล้ว"; echo"<meta http-equiv=\"refresh\" content=\"2;url=add_.php\">"; }else{ $chkm=substr($start_date,5,2); $chkm=$chkm+0; $data=Array( 'tour_id'=>$_POST['tour_id'], 'start_date'=>$start_date, 'end_date'=>$end_date, 'sp_start_date'=>$sp_start_date, 'sp_end_date'=>$sp_end_date, 'cost1'=>$_POST['cost1'], 'cost2'=>$_POST['cost2'], 'cost3'=>$_POST['cost3'], 'cost4'=>$_POST['cost4'], 'poster'=>$user_login['ID'], 'comment'=>$_POST['comment'], 'checkM'=>$chkm, 'timeupdate'=>Date('Y-m-d H:i:s',time()), ); if ($_SESSION["la"] == 1){ if($db->Insert('time_schedule1',$data)){ echo"<br><center><font size=3> บันทึกข้อมูลสำเร็จ"; echo"<script language=\"JavaScript\"> window.parent.frames[0].location = \"list_.php?tour_id=".$_POST['tour_id']."\"; </script>"; echo"<meta http-equiv=\"refresh\" content=\"0;url=add_.php?tour_id=".$_POST['tour_id']."\">"; }else{ echo"<br><center><font size=3> ไม่สามารถบันทึกข้อมูลได้".$db->mysqlError(); echo"<meta http-equiv=\"refresh\" content=\"2;url=add_.php?tour_id=".$_POST['tour_id']."\">"; } }else{ if($db->Insert('time_schedule1_en',$data)){ echo"<br><center><font size=3> บันทึกข้อมูลสำเร็จ"; echo"<script language=\"JavaScript\"> window.parent.frames[0].location = \"list_.php?tour_id=".$_POST['tour_id']."\"; </script>"; echo"<meta http-equiv=\"refresh\" content=\"0;url=add_.php?tour_id=".$_POST['tour_id']."\">"; }else{ echo"<br><center><font size=3> ไม่สามารถบันทึกข้อมูลได้".$db->mysqlError(); echo"<meta http-equiv=\"refresh\" content=\"2;url=add_.php?tour_id=".$_POST['tour_id']."\">"; } } }//end check ซ้ำของข้อมูล ?>