Ejemplo n.º 1
0
                return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($data), MCRYPT_MODE_ECB, $iv));
            }
        }
    }
    function get_Data()
    {
        return array("name" => $this->name, "email" => $this->email, "contact" => $this->contact, "username" => $this->username, "password" => $this->password, "account_type" => $this->account_type, "creation_date" => $this->creation_date, "modified_date" => $this->modified_date);
    }
}
if (isset($_POST)) {
    if ($_POST["sign_in_password"] != $_POST["sign_in_confirm_pass"]) {
        header("Location: " . VIEW_PATH . "admin/admin_dashboard.php?create_user_err=confirm_pass");
        exit;
    }
    $new_user = new User_Registration($_POST);
    $user_data = $new_user->get_Data();
    if (!isset($_SESSION["admin_create_user"])) {
        $_SESSION["admin_create_user"] = $user_data;
    }
    $create_user = new DB_Register_User();
    $validate_check = $create_user->validate_Data($user_data);
    if ($validate_check != "no_error") {
        header("Location: " . VIEW_PATH . "admin/admin_dashboard.php?create_user_err=" . $validate_check);
        exit;
    }
    if ($create_user->create_User($user_data)) {
        unset($_SESSION["admin_create_user"]);
        header("Location: " . VIEW_PATH . "admin/admin_dashboard.php?create_user_result=sucess");
        exit;
    } else {
        header("Location: " . VIEW_PATH . "admin/admin_dashboard.php?create_user_result=failed");