?
Path : /home/admin/domains/happytokorea.com/public_html/backend/modules/goods/ |
Current File : /home/admin/domains/happytokorea.com/public_html/backend/modules/goods/test.php |
<? session_start(); require_once('../../../config.php'); require_once('../../../libs/MySql.php'); require_once('../../../libs/MySqlDB.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'); require_once('../../../libs/xajax/xajaxExtend.php'); require_once('../../modules/users/mod_user.php'); $db=new MySql; $xajax = new xajaxExtend; $id= $_GET[id]; function inser_index($value) { global $db; $objResponse = new xajaxResponse(); $id=$value; $db->Query("DELETE FROM goods_recommend WHERE GoodsRecommendRanking = '".$_GET['id']."' "); $dataa=Array('GoodsID'=>$value,'GoodsRecommendRanking'=> $_GET[id]); $db->Insert('goods_recommend',$dataa); $objResponse->addAlert('บันทึกเรียบร้อยค่ะ'); $objResponse->addRedirect("test.php?id=$_GET[id]"); return $objResponse; } $xajax->registerFunction("inser_index"); $xajax->processRequests(); $data=$db->getDataOneRow('goods_recommend',"$id",'GoodsRecommendRanking'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>แสดงผลสินค้าหน้าหลัก</title> <?php $xajax->printJavascript('../../../libs/xajax'); ?> </head> <body> <form action="<?=$_SERVER['PHP_SELF']?>" method="post" enctype="multipart/form-data"> <table width="500" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#AAAAAA"> <tr> <td width="490" align="center">เลือกสินค้า</td> </tr> <tr> <td align="center"><? echo "<input type=hidden name={$data['GoodsID']} size=20 id={$data['GoodsID']} value='".$data['GoodsID']."'>"; echo "<select class=\"backend_inputbox\" onchange=\"xajax_inser_index(this.value)\"> <option>--หมวดหมู่--</option>"; $sql=$db->Query("SELECT * FROM goods WHERE GoodsPublic = 1 Order By GoodsID DESC"); while($rs1=mysql_fetch_array($sql)){ if($rs1[GoodsID] == $data['GoodsID']){ echo "<option value=\"".$rs1[GoodsID]."\" selected=\"selected\">".$rs1[GoodsName]."</option>"; }else{ echo "<option value=\"".$rs1[GoodsID]."\">".$rs1[GoodsName]."</option>"; } } echo "</select>"; ?> </td> </tr> <tr> <td align="center"> </td> </tr> </table> </form> </body> </html>