ESH/pdf_user_role_report.php
2024-10-23 18:28:06 +05:30

123 lines
2.4 KiB
PHP

<?php
include('pdf_header.php');
//include('pop_up_top.php');
?>
<html>
<link href="includes/css-js/admin.css" rel="stylesheet" type="text/css" />
<body>
<?php
$role_id = $_REQUEST['role_id3'];
$role_name = getFieldFromTable (role_name, role_master, role_id, $role_id);
$acc = $_REQUEST['access_id3'];
if ($acc=='W')
{
$access = 'Write';
}
else if ($acc=='R')
{
$access = 'Read';
}
else if ($acc=='E')
{
$access = 'Execute';
}
else if ($acc=='A')
{
$access = 'ALL';
}
?>
<table width="100%" >
<tr><div style="font-size:12px">
<td width="33%" align="left"> Run Date : <?php echo date("d-M-Y"); ?></td>
<td width="34%" align="center" style="font-size:17px"><strong>USER ROLE REPORT</strong></td>
<td width="33%" align="right"> User : <?php echo $username ?></td>
</tr>
<tr>
<td align="left">User Role : <b><?php echo $role_name?></b></td>
<td align="center" style="font-size:17px"></td>
<td align="right">Access : <?php echo $access?></td>
</tr>
<?php
$logins ="";
$sql_login = mysqli_query($conn,"Select user_name from tbl_users where role_id='$role_id' Order by user_name ASC" );
while ($row_login=@mysqli_fetch_array($sql_login))
{
$user_name = $row_login['user_name'];
$logins = $logins.', '.$user_name;
}
?>
<tr>
<td colspan='3' align="left">Logins : <?php echo $logins?></td>
</tr>
</table>
<hr>
<table width="100%" border="1">
<tr bgcolor="#eeeeee" ><strong>
<td width="5%" align="left">Sr</td>
<td width="10%" align="left">Menu ID</td>
<td width="45%" align="left">Menu</td>
<td width="40%" align="left">Access</td>
</tr></strong>
<?php
$count=1;
if ($acc=='A')
{
$sql = mysqli_query($conn,"Select menu_id,access_level from assign_menu where role_id='$role_id' Order by menu_id ASC");
}
else
{
$sql = mysqli_query($conn,"Select menu_id,access_level from assign_menu where role_id='$role_id' and access_level='$acc' Order by menu_id ASC");
}
while ($row1=@mysqli_fetch_array($sql))
{
$menu_id = $row1['menu_id'];
$menu_name = getFieldFromTable(menu_name, menu_master, menu_id, $menu_id);
$acc= $row1['access_level'];
if ($acc=='W')
{
$access = 'Write';
}
else if ($acc=='R')
{
$access = 'Read';
}
else if ($acc=='E')
{
$access = 'Execute';
}
?>
<tr>
<td align="left"><?php echo $count?></td>
<td align="left"><?php echo $menu_id?></td>
<td align="left"><?php echo $menu_name?></td>
<td align="left"><?php echo $access?></td>
</tr>
<?php
$count = $count+1;
}
?>
</table>
</body>
</html>
<?php
include('pdf_footer.php');
?>