Ejemplo n.º 1
0
    $id = $_REQUEST["userId"];
    $result = UserController::GetUserByID($id);
    if ($result) {
        require_once "../utils/user_util.php";
        echo UserUtil::createFormInfo($result);
    }
}
if (isset($_REQUEST["action"]) && $_REQUEST["action"] == "delete") {
    require_once "../../../controller/UserController.php";
    require_once "../utils/user_util.php";
    $id = $_REQUEST["userId"];
    $result = UserController::Delete($id);
    if ($result) {
        echo UserUtil::createMessageBox("Delete completed!");
    } else {
        echo UserUtil::createMessageBox("Delete does not complete!");
    }
}
if (isset($_REQUEST["action"]) && $_REQUEST["action"] == "search") {
    require_once "../../../controller/UserController.php";
    require_once "../utils/user_util.php";
    $name = $_REQUEST["name"];
    $mail = $_REQUEST["email"];
    $strSQL = "select * from user where 1=1 ";
    if (strlen($name) > 0) {
        $strSQL .= " and Name LIKE '%{$name}%' ";
    }
    if (strlen($mail)) {
        $strSQL .= " and Email LIKE '%{$mail}%' ";
    }
    $result = UserController::getAllBySql($strSQL);