<?php

require_once '../dto/StaffDTO.php';
require_once 'staff_controller.php';
$id = isset($_REQUEST["txtMaNV"]) ? $_REQUEST["txtMaNV"] : null;
$name = isset($_REQUEST["txtHoTen"]) ? $_REQUEST["txtHoTen"] : null;
$birth = isset($_REQUEST["txtNgaySinh"]) ? $_REQUEST["txtNgaySinh"] : null;
$addr = isset($_REQUEST["txtDiaChi"]) ? $_REQUEST["txtDiaChi"] : null;
$sex = isset($_REQUEST["txtPhai"]) ? $_REQUEST["txtPhai"] : null;
$salary = isset($_REQUEST["txtLuong"]) ? $_REQUEST["txtLuong"] : null;
$dept = isset($_REQUEST["txtMaPhong"]) ? $_REQUEST["txtMaPhong"] : null;
$info = new StaffDTO($id, $name, $birth, $addr, $sex, $salary, $dept);
$ctrl = new StaffController();
try {
    $ctrl->modifyStaff($info);
    header('location:../gui/staff_manager.php');
} catch (Exception $e) {
    echo "<script>alert({$e->getMessage}())</script>";
}
                        </tr>
                        <tr>
                            <td>Phai</td>
                            <td><input type="text" id="txtPhai" name="txtPhai"/><br/></td>
                        
                            <td>Luong</td>
                            <td><input type="text" id="txtLuong" name="txtLuong"/><br/></td>
                        
                            <td>Ma Phong</td>
                            <td><input type="text" id="txtMaPhong" name="txtMaPhong"/><br/></td>
                            <td></td>
                            <td><input class="submit_button" type="submit" name="add" value="Add Staff"/></td>
                        </tr>
                    </table>
                    
                </div>            
            </div>
        </form>            
   <br/>
    
	<?php 
require_once '../controller/staff_controller.php';
require_once '../controller/Ultilities.php';
echo '<div id="data">';
$ctrl = new StaffController();
$array = $ctrl->getAllStaff();
Ultilites::html_show_staffs($array);
echo '</div>';
?>
</body>
</html>
<?php

require_once 'staff_controller.php';
require_once 'Ultilities.php';
$id = isset($_REQUEST["id"]) ? $_REQUEST["id"] : null;
$ctrl = new StaffController();
if ($id) {
    try {
        $ctrl->removeStaff($id);
    } catch (Exception $e) {
        echo "<script>alert('{$e->getMessage}()');</script>";
    }
}
$array = $ctrl->getAllStaff();
Ultilites::html_show_staffs($array);
コード例 #4
0
ファイル: ShowStaff.php プロジェクト: Asif047/ISD-Project
<?php

require 'Controller/StaffController.php';
$staffController = new StaffController();
if (isset($_POST['types'])) {
    $staffTables = $staffController->CreateStaffTables($_POST['types']);
} else {
    $staffTables = $staffController->CreatestaffTables('%');
}
$title = 'Staff overview';
$content = $staffController->CreatestaffDropdownList() . $staffTables;
include 'StaffInfo.php';