index.php
来自「通达OA2007SE源代码 非常好的」· PHP 代码 · 共 152 行
PHP
152 行
<?
include_once 'inc/reg_check.php';
if (($OA_REG_ON != 2008))
{
exit ();
}
include_once 'inc/auth.php';
echo '
<html>
<head>
<title>角色管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
';
echo '<s';
echo 'cript>
function delete_priv(USER_PRIV)
{
msg="确认要删除该角色么?";
if(window.confirm(msg))
{
URL="delete.php?USER_PRIV="+USER_PRIV;
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">';
echo '<s';
echo 'pan class="big3"> 新建角色</span><br>
</td>
</tr>
</table>
<div align="center">
<input type="button" value="新建角色" class="BigButton" onClick="location=\'edit.php\';" title="新建角色">
</div>
<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%" cellspa';
echo 'cing="0" cellpadding="3" class="small">
<tr>
<td class="Big"><img src="/images/notify_open.gif" WIDTH="22" HEIGHT="20" align="absmiddle">';
echo '<s';
echo 'pan class="big3"> 管理角色</span>
</td>
</tr>
</table>
<br>
<div align="center">
';
$query = 'SELECT * from USER_PRIV order by PRIV_NO';
$cursor = exequery ($connection, $query);
$PRIV_COUNT = 0;
while ($ROW = mysql_fetch_array ($cursor))
{
++$PRIV_COUNT;
$USER_PRIV = $ROW['USER_PRIV'];
$PRIV_NO = $ROW['PRIV_NO'];
$PRIV_NAME = $ROW['PRIV_NAME'];
$USER_COUNT1 = 0;
$USER_COUNT2 = 0;
$query = (((''.'SELECT count(*) from USER where USER_PRIV=\'').$USER_PRIV).'\'');
$cursor1 = exequery ($connection, $query);
if ($ROW1 = mysql_fetch_array ($cursor1))
{
$USER_COUNT1 = $ROW1[0];
}
$query = (((''.'SELECT count(*) from USER where USER_PRIV=\'').$USER_PRIV).'\' and NOT_LOGIN=\'1\'');
$cursor1 = exequery ($connection, $query);
if ($ROW1 = mysql_fetch_array ($cursor1))
{
$USER_COUNT2 = $ROW1[0];
}
$query = (((''.'SELECT count(*) from USER where FIND_IN_SET(').$USER_PRIV).',USER_PRIV_OTHER)');
$cursor1 = exequery ($connection, $query);
if ($ROW1 = mysql_fetch_array ($cursor1))
{
$USER_COUNT3 = $ROW1[0];
}
if (($PRIV_COUNT == 1))
{
echo '
<table border="0" cellspacing="1" width="450" class="small" bgcolor="#000000" cellpadding="3">
';
}
echo ' <tr class="TableData">
<td nowrap align="center" width="60">';
echo $PRIV_NO;
echo '</td>
<td nowrap align="center">';
if (($USER_PRIV == 1))
{
echo '<font color=red>';
}
echo $PRIV_NAME;
echo '</td>
<td nowrap align="center">';
echo $USER_COUNT1;
echo '/';
echo $USER_COUNT2;
echo '/';
echo $USER_COUNT3;
echo '</td>
<td nowrap>
<a href="edit.php?USER_PRIV=';
echo $USER_PRIV;
echo '"> 编辑角色</a>
<a href="edit_priv.php?USER_PRIV=';
echo $USER_PRIV;
echo '"> 编辑权限</a>
<a href="clone?USER_PRIV=';
echo $USER_PRIV;
echo '">克隆</a>
';
if (($USER_PRIV != 1))
{
echo ' <a href="javascript:delete_priv(\'';
echo $USER_PRIV;
echo '\')"> 删除</a>
';
}
echo ' </td>
</tr>
';
}
if ((0 < $PRIV_COUNT))
{
echo ' <thead class="TableHeader">
<td nowrap align="center">角色排序号</td>
<td nowrap align="center">角色名称</td>
<td nowrap align="center">总用户数/禁止登录数/辅助角色数</td>
<td nowrap align="center">操作</td>
</thead>
</table>
';
}
else
{
message ('', '尚未定义');
}
echo '
</div>
</body>
</html>';
?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?