<?php 
$table_name = $_SESSION['db_prefix']."_permissions";
$view_query = "SELECT access_id  FROM  $table_name  WHERE access_id ='". $_SESSION['access_id']."' AND page_name = 'HR-management' ";
$view_result = mySQL_query($view_query);
$view_num = mysql_num_rows($view_result);
if ($view_num!=0) {
	$management_view='yes';
}
else {
$management_view='no';
}


$table_name = $_SESSION['db_prefix']."_saved_hr_reports";
$hr_report_query = "SELECT saved_report_id FROM $table_name WHERE department = 'hr' AND user_name = '".$_SESSION['username']."' AND read_done = 'no' ";
$hr_report_result = mySQL_query($hr_report_query);
$hr_report_num = mysql_num_rows($hr_report_result);
if ($hr_report_num>5) { $hr_report_num=6; }

?>
<div class="side_frame"><br />

<div class="menu_block_frame">

<div class="side_menu_caption">Input</div>
<a href="../hr_module/employeeWiz0.php"> <div class="side_menu_button">New Employee</div></a>
<a href="../hr_module/record_time_select.php"> <div class="side_menu_button">Time recording</div> </a>
<a href="../hr_module/leave_select_hr.php"> <div class="side_menu_button">Leave</div> </a>
<a href="../hr_module/discipline_select_hr.php"> <div class="side_menu_button">Discipline</div> </a>
<a href="../hr_module/finance_select.php"> <div class="side_menu_button">Finance</div> </a>
<a href="../hr_module/edit_select_hr.php"> <div class="side_menu_button">Edit</div> </a>
<br />


<div class="side_menu_caption">Reporting</div>
<?php 
if ($management_view=='yes'){ ?>
      <a href="../hr_module/group_select_hr.php"> <div class="side_menu_button">Employees</div></a>
<?php }
else { ?>
<a href="../hr_module/employee_list.php?g=0"> <div class="side_menu_button">Employees</div></a>
<?php } ?>
<a href="../hr_module/view_time_select.php"> <div class="side_menu_button">Attendance</div> </a>
<a href="../hr_module/leave_report_select_hr.php?date="> <div class="side_menu_button">Leave</div> </a>
<a href="../hr_module/warnings_list.php?date="> <div class="side_menu_button">Discipline</div> </a>
<a href="../hr_module/pettycash_list.php?date=&emp_id="> <div class="side_menu_button">Petty cash</div> </a>
<a href="../hr_module/loans_list.php?date=&emp_id="> <div class="side_menu_button">Loans</div> </a>
<a href="../hr_module/severance_list.php?date=&emp_id="> <div class="side_menu_button">Severance</div> </a>
<a href="../hr_module/issue_list.php"> <div class="side_menu_button">Issues</div> </a>
<a href="../hr_module/hr_alerts_list.php?date=&set=&delete="> <div class="side_menu_button">
<div align="center">
      <table width="85" border="0" >
        <tr>
        <td height="30" align="center" valign="top" <?php if ($hr_alert_num>0) {?> style="background-image:url(../images/alert_circle_<?php echo $hr_alert_num ?>.png); background-repeat:no-repeat;" <?php } ?>>Alerts</td>
        </tr>
        </table>
      </div>
        </div>
       </a>
<a href="../hr_module/hr_report_list.php?date=&set="> <div class="side_menu_button">
<div align="center">
      <table width="85" border="0" >
        <tr>
        <td height="30" align="center" valign="top" <?php if ($hr_report_num>0) {?> style="background-image:url(../images/alert_circle_<?php echo $hr_report_num ?>.png); background-repeat:no-repeat;" <?php } ?>>Reports</td>
        </tr>
        </table>
      </div>
        </div>
       </a>


</div>   
</div>
