?
Path : /home/admin/domains/happytokorea.com/public_html/backend/modules/tour/ |
Current File : /home/admin/domains/happytokorea.com/public_html/backend/modules/tour/ajaxContent.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('../../../libs/xajax/xajax.inc.php'); $db=new MySql; if ($_SESSION["la"] == 1){ $data=$db->getDataOneRow('tour',$_GET['tour_id'],'id'); }else{ $data=$db->getDataOneRow('tour_en',$_GET['tour_id'],'id'); } $xajax = new xajax(); require_once('content.server.php'); $xajax->registerFunction("addHeader"); $xajax->registerFunction("addCondition"); $xajax->registerFunction("loadRound"); $xajax->registerFunction("plus_tr"); $xajax->registerFunction("addTable"); $xajax->registerFunction("createTable"); $xajax->registerFunction("addDataTable"); $xajax->registerFunction("editTable"); $xajax->registerFunction("editDataTable"); $xajax->registerFunction("undotable"); $xajax->registerFunction("refreshCondition"); $xajax->registerFunction("delTable"); $xajax->processRequests(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <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"> <!--<script src="../../nicEdit/nicEdit.js" type="text/javascript"></script> <script type="text/javascript"> bkLib.onDomLoaded(function() { new nicEditor({fullPanel : true}).panelInstance('header'); }); </script> <script type="text/javascript" src="../../tinymce_3_0b3/tinymce/jscripts/tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init({ // General options mode : "textareas", theme : "advanced", plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template", // Theme options theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Example content CSS (should be your site CSS) content_css : "css/content.css", // Drop lists for link/image/media/template dialogs template_external_list_url : "lists/template_list.js", external_link_list_url : "lists/link_list.js", external_image_list_url : "lists/image_list.js", media_external_list_url : "lists/media_list.js", // Replace values for the template plugin /*template_replace_values : { username : "Some User", staffid : "991234" }*/ }); </script>--> <SCRIPT language="JavaScript" src="../../js/function.js"></SCRIPT> <SCRIPT language="JavaScript" src="../../js/backend_function.js"></SCRIPT> <SCRIPT language="JavaScript" src="../../js/global.js"></SCRIPT> <SCRIPT language="JavaScript" src="../../js/checkdate.js"></SCRIPT> <?php $xajax->printJavascript('../../../libs/xajax'); ?> <style> .inputDbClick{ border:1px solid #cccccc; } .inputMouseOut{ border:0px; } </style> <script> function editInput(obj){ obj.style.border='1px solid #cccccc'; obj.style.background='#FFFFFF'; } function InputTxt(obj){ obj.style.border='0px'; obj.style.background='#57c0f9'; } function plus_tr(table){ var tb=document.getElementById(table); var tr=document.createElement('TR'); var td=document.createElement('TD'); } function addRow(tbName) { var table=document.getElementById(tbName); var tr=document.createElement("TR"); var td=document.createElement("TD"); var td2=document.createElement("TD"); td.innerHTML ='<input type="hidden" name="subId[]"><input type=text name=subTopic[] style="width:100px;">'; td2.innerHTML ='<textarea name=detail[] style="width:520px;height:100px;"></textarea><br>ภาพที่ 1 <input type="file" name="photos1[]" id="photos1[]" /><br>ภาพที่ 2 <input type="file" name="photos2[]" id="photos2[]" /><br>ภาพที่ 3 <input type="file" name="photos3[]" id="photos3[]" />'; tr.appendChild(td); tr.appendChild(td2); table.appendChild(tr); } function addTable() { var div=document.getElementById('DivNewTable'); // var id=div.childNodes.length; var div2=document.createElement("DIV"); div2.setAttribute("id","NewTable"); div.appendChild(div2); xajax_createTable("NewTable"); } function removeTr(table,tr){ table.removeChild(tr); } function addRowCondition(tbName) { var table=document.getElementById(tbName); var tr=document.createElement("TR"); var td=document.createElement("TD"); td.innerHTML ='เงื่อนไข:<input type=text name=Condition[] style="width:200px;"> Order :<input type="text" name="orderCondition[]" style="width:20px;"><br> <textarea name=ConDetail[] style="width:620px;height:100px;" id=orderCondition[]><li>sdad</li><li>sadsad </li></textarea>'; tr.appendChild(td); table.appendChild(tr); } </script> </HEAD> <body onLoad="xajax_loadRound()"> <div style="width:100%"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="81%" valign="top"> <FORM id="webForm1" enctype="multipart/form-data" onSubmit="return false;"> <table border="1" width="100%" height="10"style="border-collapse: collapse"> <tr> <td width="620" valign="middle" align="center" height="30" colspan="2">ตารางการเดินทาง ของทัวร์ <font size=3 color=#58A8DB><?=$data['name'];?></td> </tr> <tr> <td width="620" valign="middle" align="left" height="30" colspan="2"><!--<a href="view_public_content.php?tour_id=<?=$_GET['tour_id'];?>">ดูตัวอย่าง</a> <a href="list_content_reorder.php?tour_id=<?=$_GET['tour_id'];?>"> จัดเรียงใหม่</a>--> </td> </tr><!-- <tr> <td width="620" valign="middle" align="center" height="30" colspan="2">หัวเรื่อง<br> <textarea name="header" style="width:620px;height:100px;"><?=$data['title'];?> </textarea> <label></label></td> </tr> <tr> <td width="620" valign="middle" align="right" height="20" colspan="2"><input type="submit" value=" บันทึกหัวเรื่อง " onClick="xajax_addHeader(xajax.getFormValues('webForm1')); return false;" /></td> </tr>--> </table> </form> <!-- END HEADER --> <!-- START ตารางเดินทาง ---> <div id="txtRound"> </div> <div id="DivNewTable"> <table border="1" width="100%" height="10"style="border-collapse: collapse"> <tr> <td width="620" valign="middle" align="right" height="20" colspan="2"><input type="button" value=" เพิ่มตาราง " onClick="addTable()"></td> </tr> </table> </div> <!-- START เงื่อนไข ---> <br /> <br /> <br /> <br /> <br /> <FORM id="webForm3" onSubmit="return false;"> <table border="1" width="100%" height="10"style="border-collapse: collapse"> <tbody id="tb_condition"> <tr> <td width="100%" valign="middle" align="center" height="30" colspan="2">เงื่อนไข [<a href="javascript:void(0);" onClick="addRowCondition('tb_condition')">เพิ่มเงื่อนไขราคา</a>]</td> </tr> <? if ($_SESSION["la"] == 1){ $rs=$db->Query("SELECT * FROM tour_content_condition WHERE condition_tour_id='{$_GET['tour_id']}' ORDER BY condition_order ASC"); }else{ $rs=$db->Query("SELECT * FROM tour_content_condition_en WHERE condition_tour_id='{$_GET['tour_id']}' ORDER BY condition_order ASC"); } while($data=mysql_fetch_array($rs)){ echo "<tr> <td width=\"620\" valign=\"middle\" align=\"left\" height=\"30\" colspan=\"2\"> เงื่อนไข:<input type=\"text\" name=\"Condition[]\" style=\"width:200px;\" value=\"{$data['condition_name']}\"> Order :<input type=\"text\" name=\"orderCondition[]\" style=\"width:20px;\" value=\"{$data['condition_order']}\"><br><textarea name=\"ConDetail[]\" style=\"width:620px;height:100px;\">{$data['condition_detail']}</textarea></td> </tr>"; } ?> </tbody> </table><br /> <br /> <table border="1" width="100%" height="10"style="border-collapse: collapse"> <tr> <td width="100%" valign="middle" align="right" height="20" colspan="2"><input type='button' value=" ยกเลิก " onClick="xajax_refreshCondition()"> <input type="submit" value=" บันทึกเงื่อนไข " onClick="xajax_addCondition(xajax.getFormValues('webForm3'));return false;" /></td> </tr> </table> </form></td> <td width="19%" valign="top"> </td> </tr> </table>