本文整理汇总了PHP中Admin_Controller::Check_User_Name_For_Edit方法的典型用法代码示例。如果您正苦于以下问题:PHP Admin_Controller::Check_User_Name_For_Edit方法的具体用法?PHP Admin_Controller::Check_User_Name_For_Edit怎么用?PHP Admin_Controller::Check_User_Name_For_Edit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Admin_Controller
的用法示例。
在下文中一共展示了Admin_Controller::Check_User_Name_For_Edit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: User
if (empty($_POST['User_Phone'])) {
$errors[] = "Phone Number is required";
} else {
$User_Phone = $_POST['User_Phone'];
}
if (!isset($_POST['User_Type'])) {
$errors[] = "User type is required";
} else {
$User_Type = $_POST['User_Type'];
}
if (!isset($_POST['User_ID'])) {
$errors[] = "Please go back and refresh the site!";
} else {
$User_ID = $_POST['User_ID'];
}
if ($admin_controller->Check_User_Name_For_Edit($User_Name, $User_ID)) {
admin_redirect_error(Error_Type::SAME_USER_NAME);
}
if (empty($errors)) {
$new_user = new User($User_Name, $User_Password, $User_Type, $User_Phone, $User_ID);
$edited = $admin_controller->Edit_User($new_user);
if ($edited) {
admin_redirect_success();
} else {
admin_redirect_error(Error_Type::DATA_BASE, $User_ID);
}
} else {
admin_redirect_error(Error_Type::FORM, $User_ID);
}
}
}