一、轉向
//更新狀態 case "opUpdateEnable": opUpdateEnable(); XoopsCache::clear(); redirect_header($_SESSION['return_url'], 3, _BP_SUCCESS); exit;
########################################################### # 更新啟用 ########################################################### function opUpdateEnable() { global $xoopsDB,$tbl; #權限 /***************************** 過瀘資料 *************************/ $enable = intval($_GET['enable']); $sn = intval($_GET['sn']); /****************************************************************/ //更新 $sql = "update " . $xoopsDB->prefix($tbl) . " set `enable` = '{$enable}' where `sn`='{$sn}'";//die($sql); $xoopsDB->queryF($sql) or web_error($sql); return; }
<td class="text-center"> <{if $row.enable}> <a href='?op=opUpdateEnable&sn=<{$row.sn}>&enable=0' title='停用' atl='停用' class='btn-success btn-xs'><i class='fa fa-check' aria-hidden='true'></i></a> <{else}> <a href='?op=opUpdateEnable&sn=<{$row.sn}>&enable=1' title='啟用' atl='啟用' class='btn-danger btn-xs'><i class='fa fa-times' aria-hidden='true'></i></a> <{/if}> </td>
二、