$city = (int) $_POST['city']; $phone = $_POST['phone']; $handphone = $_POST['handphone']; if ($username != '' && $password != '' && $password == $password2 && $email != '' && $full_name != '' && $address != '' && $city > 0) { if ($model->checkUsernameExist($username) == "0") { echo "Tên đăng nhập đã được sử dụng."; exit; } if ($model->checkEmailUsed($email) == "0") { echo "Email đã được sử dụng."; exit; } $password = md5($password); $user_id = $model->insertUser($username, $password, $email, $full_name, $address, $city, $phone, $handphone); echo "Đăng ký thành viên thành công."; $_SESSION['user'] = $model->getDetailUser($user_id); exit; } } 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;