?? index.php
字號:
<?php
include_once( "inc/auth.php" );
echo "\r\n<html>\r\n<head>\r\n<title>系統(tǒng)訪問控制</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n\r\n";
echo "<s";
echo "cript Language=\"JavaScript\">\r\nfunction CheckForm()\r\n{\r\n if(document.form1.BEGIN_IP.value==\"\")\r\n { alert(\"起始IP不能為空!\");\r\n return (false);\r\n }\r\n if(document.form1.END_IP.value==\"\")\r\n { alert(\"結(jié)束IP不能為空!\");\r\n return (false);\r\n }\r\n if(document.form1.TYPE.value==\"\")\r\n { alert(\"規(guī)則類型不能為空!\");\r\n return (false);\r\n }\r\n}\r\n\r\nfunction delete_rule(RULE_ID)\r\n{\r\n ";
echo "msg='確認要刪除該項規(guī)則么?';\r\n if(window.confirm(msg))\r\n {\r\n URL=\"delete.php?RULE_ID=\" + RULE_ID;\r\n window.location=URL;\r\n }\r\n}\r\n\r\n\r\nfunction delete_all()\r\n{\r\n msg='確認要刪除所有規(guī)則么?';\r\n if(window.confirm(msg))\r\n {\r\n URL=\"delete_all.php\";\r\n window.location=URL;\r\n }\r\n}\r\n</script>\r\n</head>\r\n\r\n<body class=\"bodycolor\" topmargin=\"5\" onload=\"document.form1.BEGIN_IP.focus();\">\r\n<form action=\"add.ph";
echo "p\" method=\"post\" name=\"form1\" onsubmit=\"return CheckForm();\">\r\n<table border=\"0\" width=\"100%\" cellspacing=\"1\" cellpadding=\"0\" >\r\n <tr class=\"tablehead1\">\r\n <td ><img src=\"/images/manage/system.gif\" align=\"absmiddle\"> 添加IP訪問方式\r\n </td>\r\n </tr>\r\n <tr class=\"tablehead2\">\r\n <td ><input type=\"image\" src=\"/images/button/submit.gif\" title=\"添加允許訪問IP段\">\r\n </td>\r\n </tr>\r\n</table>\r\n<br>\r\n<ta";
echo "ble border=\"0\" cellspacing=\"1\" width=\"100%\" class=\"small\" cellpadding=\"3\" >\r\n \r\n <tr>\r\n <td nowrap class=\"TableLine2\">起始IP:</td>\r\n <td nowrap class=\"TableLine1\">\r\n <input type=\"text\" name=\"BEGIN_IP\" class=\"BigInput\" size=\"25\" maxlength=\"25\"> (例如:192.168.0.10)\r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableLine2\">結(jié)束IP:</td>\r\n <td nowrap class=\"TableLine1\">\r\n ";
echo " <input type=\"text\" name=\"END_IP\" class=\"BigInput\" size=\"25\" maxlength=\"25\"> (例如:192.168.0.10)\r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableLine2\">訪問方式:</td>\r\n <td nowrap class=\"TableLine1\">\r\n ";
echo "<s";
echo "elect name=\"TYPE\" class=\"BigSelect\">\r\n <option value=\"0\" selected>登錄</option>\r\n <option value=\"1\">個人考勤</option>\r\n </select>\r\n </td>\r\n </tr>\r\n \r\n</table>\r\n</form>\r\n<br>\r\n\r\n<table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"3\">\r\n <tr>\r\n <td background=\"/images/dian1.gif\" width=\"100%\"></td>\r\n </tr>\r\n</table>\r\n\r\n<table border=\"0\" width=\"100%\" cellspacing=\"";
echo "0\" cellpadding=\"5\">\r\n <tr>\r\n <td>IP訪問方式\r\n </td>\r\n </tr>\r\n</table>\r\n\r\n";
$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 = "登錄";
}
else if ( $TYPE == 1 )
{
$TYPE_DESC = "個人考勤";
}
if ( $RULE_COUNT == 1 )
{
echo "\r\n <table border=\"0\" cellspacing=\"1\" width=\"100%\" class=\"small\" cellpadding=\"3\">\r\n\r\n";
}
echo " <tr class=\"TableLine2\">\r\n <td nowrap >";
echo $BEGIN_IP;
echo "</td>\r\n <td nowrap >";
echo $END_IP;
echo "</td>\r\n <td nowrap >";
echo $TYPE_DESC;
echo "</td>\r\n <td nowrap width=\"80\">\r\n <a href=\"edit.php?RULE_ID=";
echo $RULE_ID;
echo "\"> 編輯</a>\r\n <a href=\"javascript:delete_rule('";
echo $RULE_ID;
echo "');\"> 刪除</a>\r\n </td>\r\n </tr>\r\n";
}
if ( 0 < $RULE_COUNT )
{
echo " <thead class=\"TableHeader\">\r\n <td nowrap >起始IP</td>\r\n <td nowrap >結(jié)束IP</td>\r\n <td nowrap >訪問方式</td>\r\n <td nowrap >操作</td>\r\n </thead>\r\n <thead class=\"TableLine1\">\r\n <td nowrap colspan=\"4\">\r\n <input type=\"button\" class=\"BigButton\" OnClick=\"javascript:delete_all();\" value=\"全部刪除\">\r\n </td>\r\n </thead>\r\n </table>\r\n";
}
else
{
message( "", "尚未定義訪問規(guī)則" );
}
echo "\r\n</div>\r\n\r\n</body>\r\n</html>";
?>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -