最新xoops模組開發
一、流程
- switch
	
  #---- 更新商品狀態 ----
  case "opUpdateEnable":
    opUpdateEnable();
    XoopsCache::clear();
    redirect_header($_SESSION['return_url'], 3, _BP_SUCCESS);
    exit;
	
 
二、函數
- opUpdateEnable()
	
#########################################
#  更新商品狀態
#########################################
function opUpdateEnable() {
  global $xoopsDB;
  #權限
  /***************************** 過瀘資料 *************************/
  $enable = intval($_GET['enable']);
  $sn = intval($_GET['sn']);
  /****************************************************************/
  //更新
  $sql = "update " . $xoopsDB->prefix("cnu_show_prod") . " set  `enable` = '{$enable}' where `sn`='{$sn}'";
  $xoopsDB->queryF($sql) or redirect_header($_SERVER['PHP_SELF'], 3, web_error());
  return;
}