Example #1
0
    }
}
if ($action == 'info') {
    $arrReturn = array();
    $email = $_POST['email'];
    $full_name = $_POST['full_name'];
    $address = $_POST['address'];
    $city = (int) $_POST['city'];
    $phone = $_POST['phone'];
    $handphone = $_POST['handphone'];
    if ($email != '' && $full_name != '' && $address != '' && $city > 0 && $handphone != '') {
        if ($model->checkEmailUsed($email, 'info') == "0") {
            echo "Email đã được sử dụng.";
            exit;
        }
        $model->updateUser($email, $full_name, $address, $city, $phone, $handphone);
        echo "ok";
        $user_id = $_SESSION['user']['id'];
        $_SESSION['user'] = $model->getDetailUser($user_id);
        exit;
    }
}
if ($action == "login") {
    $username = $_POST['username_login'];
    $password = $_POST['password_login'];
    $model->login($username, $password);
}
if ($action == "changepass") {
    $old_pass = $model->processData($_POST['old_pass']);
    $password = $model->processData($_POST['password']);
    $password2 = $model->processData($_POST['password2']);