<div class="card blue-grey darken-1"> <form action="deleteFactory.php" method="POST"> <div class="card-content white-text"> <table class="bordered highlight"> <thead> <tr> <th class="center-align"><input type="checkbox" id="selectAllDepartmentCheckBox" name="department"><label for="selectAllFactoryCheckBox"></label></th> <th>Name</th> <th>Code</th> <th>Factory</th> </tr> </thead> <tbody> <?php $html = ''; foreach (fetchAllRecordsFromTable('department') as $row) { $html .= '<tr>'; $html .= '<td class="center-align"> <input type="checkbox" id="department_' . $row['department_id'] . '" name="department_' . $row['department_id'] . '"> <label for="department_' . $row['department_id'] . '"></label> </td>'; $html .= '<td>' . $row['department_name'] . '</td>'; $html .= '<td>' . $row['department_code'] . '</td>'; $html .= '<td>' . queryDatabase('SELECT `factory_name` FROM `factory` WHERE `factory_id` = ' . $row['department_factory_id'])[0]['factory_name'] . '<div class="fixed-action-btn horizontal right" style="position: relative; bottom: 0;">' . ' <a class="btn-floating blue-grey lighten-1">' . ' <i class="material-icons">more_vert</i>' . ' </a>' . ' <ul style="top: 3px; right: 44px">' . ' <li><a href="deleteDepartment.php?department_id=' . $row['department_id'] . '" class="btn-floating tooltipped red" data-position="top" data-delay="50" data-tooltip="Delete"><i class="material-icons">remove</i></a></li>' . ' <li><a href="editDepartment.php?department_id=' . $row['department_id'] . '" class="btn-floating tooltipped blue" data-position="top" data-delay="50" data-tooltip="Edit"><i class="material-icons">mode_edit</i></a></li>' . ' </ul>' . '</div>' . '</td>'; $html .= '</tr>'; } echo $html; ?> </tbody> </table> </div>
<div class="card blue-grey darken-1"> <form action="deletePosition.php" method="POST"> <div class="card-content white-text"> <table class="bordered highlight"> <thead> <tr> <th class="center-align"><input type="checkbox" id="selectAllPositionCheckBox" name="position"><label for="selectAllPositionCheckBox"></label></th> <th>Name</th> <th>Code</th> <th>Status</th> </tr> </thead> <tbody> <?php $html = ''; foreach (fetchAllRecordsFromTable('position') as $row) { $html .= '<tr>'; $html .= '<td class="center-align"> <input type="checkbox" id="position_' . $row['position_id'] . '" name="position_' . $row['position_id'] . '"> <label for="position_' . $row['position_id'] . '"></label> </td>'; $html .= '<td>' . $row['position_name'] . '</td>'; $html .= '<td>' . $row['position_code'] . '</td>'; $html .= '<td>' . ($row['position_status'] == 1 ? 'Active' : 'Inactive') . '<div class="fixed-action-btn horizontal right" style="position: relative; bottom: 0;">' . ' <a class="btn-floating blue-grey lighten-1">' . ' <i class="material-icons">more_vert</i>' . ' </a>' . ' <ul style="top: 3px; right: 44px">' . ' <li><a href="deletePosition.php?position_id=' . $row['position_id'] . '" class="btn-floating tooltipped red" data-position="top" data-delay="50" data-tooltip="Delete"><i class="material-icons">remove</i></a></li>' . ' <li><a href="editPosition.php?position_id=' . $row['position_id'] . '" class="btn-floating tooltipped blue" data-position="top" data-delay="50" data-tooltip="Edit"><i class="material-icons">mode_edit</i></a></li>' . ' </ul>' . '</div>' . '</td>'; $html .= '</tr>'; } echo $html; ?> </tbody> </table> </div>
<div class="card blue-grey darken-1"> <form action="deleteFactory.php" method="POST"> <div class="card-content white-text"> <table class="bordered highlight"> <thead> <tr> <th class="center-align"><input type="checkbox" id="selectAllFactoryCheckBox" name="factory"><label for="selectAllFactoryCheckBox"></label></th> <th>Name</th> <th>Code</th> <th>Address</th> </tr> </thead> <tbody> <?php $html = ''; foreach (fetchAllRecordsFromTable('factory') as $row) { $html .= '<tr>'; $html .= '<td class="center-align"> <input type="checkbox" id="factory_' . $row['factory_id'] . '" name="factory_' . $row['factory_id'] . '"> <label for="factory_' . $row['factory_id'] . '"></label> </td>'; $html .= '<td>' . $row['factory_name'] . '</td>'; $html .= '<td>' . $row['factory_code'] . '</td>'; $html .= '<td>' . $row['factory_address'] . '<div class="fixed-action-btn horizontal right" style="position: relative; bottom: 0;">' . ' <a class="btn-floating blue-grey lighten-1">' . ' <i class="material-icons">more_vert</i>' . ' </a>' . ' <ul style="top: 3px; right: 44px">' . ' <li><a href="deleteFactory.php?factory_id=' . $row['factory_id'] . '" class="btn-floating tooltipped red" data-position="top" data-delay="50" data-tooltip="Delete"><i class="material-icons">remove</i></a></li>' . ' <li><a href="editFactory.php?factory_id=' . $row['factory_id'] . '" class="btn-floating tooltipped blue" data-position="top" data-delay="50" data-tooltip="Edit"><i class="material-icons">mode_edit</i></a></li>' . ' </ul>' . '</div>' . '</td>'; $html .= '</tr>'; } echo $html; ?> </tbody> </table> </div>
<?php /** * @Author: Alexander Awitin * @Date: 2016-03-08 18:53:37 * @Last Modified by: Alexander * @Last Modified time: 2016-03-24 19:51:52 */ $root = '../'; require_once '../logincheck.php'; $title = 'Transaction'; $subTitle = 'Everything that deals with "Transactions" goes here.'; $employees = fetchAllRecordsFromTable('employee'); $customStyles = "\n#employees tbody tr {\n\tcursor: pointer;\n}\n#employees tbody tr.active {\n\tbackground-color: rgba(0, 0, 0, 0.05);\n}\n#employeesActions a {\n\tpadding: 0 5px 0 5px;\n}\nh6.header {\n\tfont-weight: 400;\n\tmargin-left: 5px;\n\tmargin-right: 5px;\n}\n#addEmployee .picker--opened .picker__holder {\n\toverflow: visible;\n}\n"; $documentReadyScript = "\n\$('.modal-trigger').leanModal();\n\n\$('#addEmployee .datepicker').pickadate({selectMonths: true, selectYears: 15});\n\n\$('#employees tr td').click(function(){\n\t\$(this).parent().parent().children().removeClass('active');\n\t\$(this).parent().addClass('active');\n\tfetchEmployeeDetails(\$(this).attr('data-employee-id'));\n\tfetchEmployeeSectionHistory(\$(this).attr('data-employee-id'));\n\tfetchEmployeePositionHistory(\$(this).attr('data-employee-id'));\n});\n\n\$('#employeesActions .delete').click(function(){\n\tvar selected = \$('#employees tr.active');\n\tif (selected.length) {\n\t\t\$('#promtDelete').openModal();\n\t} else {\n\t\t\$('#deleteEmployee').openModal();\n\t}\n});\n"; ?> <?php require_once '../header.php'; ?> <div class="container"> <div class="row"> <div class="col m12"> <h4 class="header">Choose an employee</h4> <div class="divider"></div> <div class="section"> <div class="col s12 m12 l12"> <div class="row"> <div class="card"> <div class="card-content">
?> <div class="container"> <div class="row"> <div class="col m12"> <h4 class="header">All employees per factory per department per section</h4> <div class="divider"></div> <div class="section"> <div class="col s12 m12 l12"> <div class="row"> <div class="card"> <div class="card-content white-text"> <div class="row"> <?php // Store all factories to an array. $factories = fetchAllRecordsFromTable('factory'); // Create a nested array ( Factory > Department > Section > Employees ). foreach ($factories as $factoryKey => $factory) { $departmentsForFactory = queryDatabase('SELECT * FROM `department` WHERE `department_factory_id` = ' . $factory['factory_id']); $factories[$factoryKey]['departments'] = $departmentsForFactory; foreach ($departmentsForFactory as $departmentKey => $department) { $sectionsForDepartment = queryDatabase('SELECT * FROM `section` WHERE `section_department_id` = ' . $department['department_id']); $factories[$factoryKey]['departments'][$departmentKey]['sections'] = $sectionsForDepartment; foreach ($sectionsForDepartment as $sectionKey => $section) { $employeesForSection = queryDatabase('SELECT * FROM `emp_section` INNER JOIN `employee` ON `emp_section`.`emp_section_employee_id` = `employee`.`employee_id` WHERE `emp_section_section_id` = ' . $section['section_id']); $factories[$factoryKey]['departments'][$departmentKey]['sections'][$sectionKey]['employees'] = $employeesForSection; } } } ?>
<div class="card blue-grey darken-1"> <form action="deleteWorkStatus.php" method="POST"> <div class="card-content white-text"> <table class="bordered highlight"> <thead> <tr> <th class="center-align"><input type="checkbox" id="selectAllWorkStatusCheckBox" name="workStatus"><label for="selectAllWorkStatusCheckBox"></label></th> <th>Name</th> <th>Code</th> <th>Status</th> </tr> </thead> <tbody> <?php $html = ''; foreach (fetchAllRecordsFromTable('work_status') as $row) { $html .= '<tr>'; $html .= '<td class="center-align"> <input type="checkbox" id="work_status_' . $row['work_status_id'] . '" name="work_status_' . $row['work_status_id'] . '"> <label for="work_status_' . $row['work_status_id'] . '"></label> </td>'; $html .= '<td>' . $row['work_status_name'] . '</td>'; $html .= '<td>' . $row['work_status_code'] . '</td>'; $html .= '<td>' . ($row['work_status_flag'] == 1 ? 'Active' : 'Inactive') . '<div class="fixed-action-btn horizontal right" style="position: relative; bottom: 0;">' . ' <a class="btn-floating blue-grey lighten-1">' . ' <i class="material-icons">more_vert</i>' . ' </a>' . ' <ul style="top: 3px; right: 44px">' . ' <li><a href="deleteWorkStatus.php?work_status_id=' . $row['work_status_id'] . '" class="btn-floating tooltipped red" data-position="top" data-delay="50" data-tooltip="Delete"><i class="material-icons">remove</i></a></li>' . ' <li><a href="editWorkStatus.php?work_status_id=' . $row['work_status_id'] . '" class="btn-floating tooltipped blue" data-position="top" data-delay="50" data-tooltip="Edit"><i class="material-icons">mode_edit</i></a></li>' . ' </ul>' . '</div>' . '</td>'; $html .= '</tr>'; } echo $html; ?> </tbody> </table> </div>