查看文件: editnoheader.php
大小: 3.72 KB
类型: application/octet-stream
<?php require('system/login.php'); ?> <?php require_once('../Connections/BE2.php'); ?> <?php if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { $alltrim=trim($_POST['nname']); if($alltrim<>''){ if($_POST['nid']>0){ $updateSQL = sprintf("UPDATE noheader SET nname=%s, ncknav=%s, nckreg=%s WHERE nid=%s", GetSQLValueString($_POST['nname'], "text"), GetSQLValueString($_POST['ncknav'], "text"), GetSQLValueString($_POST['nckreg'], "text"), GetSQLValueString($_POST['nid'], "int")); }else{ $updateSQL = sprintf("INSERT INTO noheader(nname,ncknav,nckreg)VALUES(%s,%s,%s)", GetSQLValueString($_POST['nname'], "text"), GetSQLValueString($_POST['ncknav'], "text"), GetSQLValueString($_POST['nckreg'], "text") ); } mysql_select_db($database_BE2, $BE2); $Result1 = mysql_query($updateSQL, $BE2) or die(mysql_error()); } $updateGoTo = $_POST['url']; //header(sprintf("Location: %s", $updateGoTo)); echo "<script>location.href = '".$updateGoTo."';</script>"; } $colname_Rt2 = "-1"; if (isset($_GET['id'])) { $colname_Rt2 = $_GET['id']; } mysql_select_db($database_BE2, $BE2); $query_Rt2 = sprintf("SELECT * FROM noheader WHERE nid = %s", GetSQLValueString($colname_Rt2, "int")); $Rt2 = mysql_query($query_Rt2, $BE2) or die(mysql_error()); $row_Rt2 = mysql_fetch_assoc($Rt2); $totalRows_Rt2 = mysql_num_rows($Rt2); ?> <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><?= ($colname_Rt2>0)?'編輯':'新增'?>-隱藏頁面導航選單</h3> </div> <form action="" method="post" name="form1" id="form1"> <table cellspacing="0" class="table table-small-font table-bordered table-striped"> <tr valign="baseline"> <th width="146" align="right" nowrap="nowrap"><span class="font2"><span class="panel-title">頁面</span>說明</span>:</th> <td width="281"><input name="nname" type="text" id="nname" value="<?php echo htmlentities($row_Rt2['nname'], ENT_COMPAT, 'utf-8'); ?>" size="40" /></td> </tr> <tr valign="baseline"> <th height="25" align="right" nowrap="nowrap">關閉上方導航選單:</th> <td><select name="ncknav" id="ncknav"> <option value="N" <?php if (!(strcmp("N", $row_Rt2['ncknav']))) {echo "selected=\"selected\"";} ?>>N</option> <option value="Y" <?php if (!(strcmp("Y", $row_Rt2['ncknav']))) {echo "selected=\"selected\"";} ?>>Y</option> <? if($myadmin){?> <? }?> </select></td> </tr> <tr valign="baseline"> <th nowrap="nowrap" align="right">關閉下方登入註冊:</th> <td><select name="nckreg" id="nckreg"> <option value="N" <?php if (!(strcmp("N", $row_Rt2['nckreg']))) {echo "selected=\"selected\"";} ?>>N</option> <option value="Y" <?php if (!(strcmp("Y", $row_Rt2['nckreg']))) {echo "selected=\"selected\"";} ?>>Y</option> <? if($myadmin){?> <? }?> </select></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right"> </td> <td><input type="submit" value="更新記錄" /></td> </tr> </table> <input type="hidden" name="MM_update" value="form1" /> <input type="hidden" name="nid" value="<?= $colname_Rt2 ?>" /> <input name="url" type="hidden" id="url" value="<? echo $_SERVER['HTTP_REFERER'];?>" /> </form> <div id="back"><a href="javascript:history.back();"><img src="images/back.gif" alt="回上一頁" title="回上一頁" width="115" height="32" border="0"></a></div> <?php mysql_free_result($Rt2); ?>
保存
取消
返回文件列表