コード例 #1
0
ファイル: empProcess.php プロジェクト: yuxujian/YuNote
<?php

require_once '../model/empService.class.php';
if (!empty($_GET['flag'])) {
    $del_id = $_GET['id'];
    $empService = new empService();
    $res = $empService->del_emp_by_id($del_id);
    if ($res != 1) {
        header("Location: /empManage/views/user/error.php");
        exit;
    } else {
        header("Location: /empManage/views/user/ok.php");
        exit;
    }
}
コード例 #2
0
ファイル: empProcess.php プロジェクト: yuxujian/YuNote
<?php

require_once '../model/empService.class.php';
if (!empty($_REQUEST['flag'])) {
    $flag = $_REQUEST['flag'];
    $empService = new empService();
    if ($flag == "del") {
        if ($empService->del_emp_by_id($_GET['id']) == 1) {
            header("Location: /empManage/views/user/ok.php?flag=del");
            exit;
        } else {
            header("Location: /empManage/views/user/error.php");
            exit;
        }
    } else {
        if ($flag == "add_emp") {
            $name = $_POST['name'];
            $grade = $_POST['grade'];
            $email = $_POST['email'];
            $salary = $_POST['salary'];
            $res = $empService->dql_add_emp($name, $grade, $email, $salary);
            if ($res == 1) {
                header("Location: /empManage/views/user/ok.php?flag=add");
                exit;
            } else {
                header("Location: /empManage/views/user/error.php");
                exit;
            }
        } else {
            if ($flag == "update_emp") {
                $id = $_POST['id'];