?? index.php
字號:
<?
include_once 'inc/auth.php';
echo '
<html>
<head>
<title>系統訪問控制</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script Language="JavaScript">
function CheckForm()
{
if(document.form1.BEGIN_IP.value=="")
{ alert("起始IP不能為空!");
return (false);
}
if(document.form1.END_IP.value=="")
{ alert("結束IP不能為空!");
return (false);
}
if(document.form1.TYPE.value=="")
{ alert("規則類型不能為空!");
return (false);
}
}
function delete_rule(RULE_ID)
{
msg=\'確認要刪除該項規則么?\';
if(window.confirm(msg))
{
URL="delete.php?RULE_ID=" + RULE_ID;
window.location=URL;
}
}
function delete_all()
{
msg=\'確認要刪除所有規則么?\';
if(window.confirm(msg))
{
URL="delete_all.php";
window.location=URL;
}
}
</script>
</head>
<body class="bodycolor" topmargin="5">
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
<tr>
<td class="Big"><img src="/images/notify_new.gif" align="absmiddle"><span class="big3"> 添加允許訪問IP規則</span>
</td>
</tr>
</table>
<table border="0" cellspacing="1" width="450" class="small" bgcolor="#000000" cellpadding="3" align="center" >
<form action="add.php" method="post" name="form1" onsubmit="return CheckForm();">
<tr>
<td nowrap class="TableData">起始IP:</td>
<td nowrap class="TableData">
<input type="text" name="BEGIN_IP" class="BigInput" size="25" maxlength="25"> (例如:192.168.0.10)
</td>
</tr>
<tr>
<td nowrap class="TableData">結束IP:</td>
<td nowrap class="TableData">
<input type="text" name="END_IP" class="BigInput" size="25" maxlength="25"> (例如:192.168.0.10)
</td>
</tr>
<tr>
<td nowrap class="TableData">規則類型:</td>
<td nowrap class="TableData">
<select name="TYPE" class="BigSelect">
<option value="0" selected>OA登錄規則</option>
<option value="1">考勤限制規則</option>
</select>
</td>
</tr>
<tr>
<td nowrap class="TableControl" colspan="2" align="center">
<input type="submit" value="添加" class="BigButton" title="添加允許訪問IP段" name="button">
</td>
</form>
</table>
<br>
<table width="95%" border="0" cellspacing="0" cellpadding="0" height="3">
<tr>
<td background="/images/dian1.gif" width="100%"></td>
</tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
<tr>
<td class="Big"><img src="/images/notify_open.gif" align="absmiddle"><span class="big3"> 管理IP訪問規則</span>
</td>
</tr>
</table>
<br>
<div align="center">
';
$query = 'SELECT * from IP_RULE';
$connection = openconnection ();
$cursor = exequery ($connection, $query);
$RULE_COUNT = 0;
while ($ROW = mysql_fetch_array ($cursor))
{
++$RULE_COUNT;
$RULE_ID = $ROW['RULE_ID'];
$BEGIN_IP = $ROW['BEGIN_IP'];
$END_IP = $ROW['END_IP'];
$TYPE = $ROW['TYPE'];
if ($TYPE == 0)
{
$TYPE_DESC = 'OA登錄規則';
}
else
{
if ($TYPE == 1)
{
$TYPE_DESC = '考勤限制規則';
}
}
if ($RULE_COUNT == 1)
{
echo '
<table border="0" cellspacing="1" width="450" class="small" bgcolor="#000000" cellpadding="3">
';
}
echo ' <tr class="TableData">
<td nowrap align="center">';
echo $BEGIN_IP;
echo '</td>
<td nowrap align="center">';
echo $END_IP;
echo '</td>
<td nowrap align="center">';
echo $TYPE_DESC;
echo '</td>
<td nowrap align="center" width="80">
<a href="edit.php?RULE_ID=';
echo $RULE_ID;
echo '"> 編輯</a>
<a href="javascript:delete_rule(\'';
echo $RULE_ID;
echo '\');"> 刪除</a>
</td>
</tr>
';
}
if (0 < $RULE_COUNT)
{
echo ' <thead class="TableHeader">
<td nowrap align="center">起始IP</td>
<td nowrap align="center">結束IP</td>
<td nowrap align="center">規則類型</td>
<td nowrap align="center">操作</td>
</thead>
<thead class="TableControl">
<td nowrap align="center" colspan="4">
<input type="button" class="BigButton" OnClick="javascript:delete_all();" value="全部刪除">
</td>
</thead>
</table>
';
}
else
{
message ('', '尚未定義訪問規則');
}
echo '
</div>
</body>
</html>';
?>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -