/**
  * Lists all models.
  */
 public function actionIndex()
 {
     $model = new AdminGUserModel();
     $userInfo = null;
     if (isset($_GET['AdminGUserModel'])) {
         $model->attributes = $_GET['AdminGUserModel'];
         $user_phone = Formatter::formatPhone($_GET['AdminGUserModel']['user_phone']);
         $userInfo = GUserModel::model()->findByAttributes(array('user_phone' => $user_phone));
     }
     $this->render('index', array('model' => $model, 'userInfo' => $userInfo));
 }
 public function actionIndex()
 {
     $return = array('error' => 0, 'msg' => '');
     if (Yii::app()->request->isPostRequest) {
         $phone = Formatter::formatPhone($_POST['phone']);
         if (Formatter::isVinaphoneNumber($phone)) {
             if (!isset($_COOKIE["verifyWifiEvent"])) {
                 if (isset($_SESSION['countverifyWifiEvent'])) {
                     unset($_SESSION['countverifyWifiEvent']);
                 }
                 $_SESSION['countverifyWifiEvent'] = 1;
                 $_SESSION['phoneverifyWifiEvent'] = $phone;
                 setcookie("verifyWifiEvent", 1, time() + 600);
             } else {
                 $_SESSION['countverifyWifiEvent']++;
                 if ($_SESSION['countverifyWifiEvent'] > 3) {
                     $return['error'] = 1;
                     $return['msg'] = "Quí khách đã vượt quá số lần xác thực. Vui lòng thử lại sau ít phút.";
                 }
             }
             if ($return['error'] == 0) {
                 try {
                     $userVerify = UserVerifyModel::model()->findByAttributes(array('msisdn' => $phone, 'action' => 'register_event83'));
                     if (!empty($userVerify)) {
                         $verifyCode = $userVerify->verify_code;
                     } else {
                         $verifyCode = rand(1000, 9999);
                         $verifyModel = new UserVerifyModel();
                         $verifyModel->setAttribute('created_time', date("Y-m-d H:i:s"));
                         $verifyModel->setAttribute('msisdn', $phone);
                         $verifyModel->setAttribute('verify_code', $verifyCode);
                         $verifyModel->setAttribute('action', 'register_event83');
                         $verifyModel->save();
                     }
                     $sms = new SmsClient();
                     $content = "Ma xac thuc dang ky tren chacha la: " . $verifyCode;
                     $sms->sentMT("9234", $phone, 0, $content, 0, "", time(), 9234);
                     $this->redirect('/event/register/verifyWifi');
                 } catch (Exception $exc) {
                     echo $exc->getTraceAsString();
                 }
             }
         } else {
             $return['error'] = 2;
             $return['msg'] = "Số điện thoại của bạn không phải là thuê bao Vinaphone!";
         }
     }
     $this->render('index', array('return' => $return));
 }
Exemple #3
0
 public function sentSmsText($phone, $content, $smsId = 0)
 {
     $phone = Formatter::formatPhone($phone);
     $localMode = isset(Yii::app()->params['local_mode']) ? Yii::app()->params['local_mode'] : 0;
     if ($localMode) {
         //$ret = $this->sentBy7x62($phone,$content);
         $this->sentLogging("0|success", 7062, $phone, 0, $content, 0, "", $smsId);
         return true;
     }
     $return = false;
     $ret = $this->sentMT(Yii::app()->params['smsClient']['serviceNumber'], $phone, 0, $content, 0, "", time(), Yii::app()->params['smsClient']['serviceNumber']);
     if ("0|success" == strtolower($ret)) {
         $return = true;
     }
     return $return;
 }
 public function authnopass()
 {
     $phone = Formatter::formatPhone($this->username);
     $user = WebUserModel::model()->findByPhone($phone);
     $this->_id = $user->id;
     $this->setState('lastLoginTime', $user->login_time);
     $this->setState('fullname', $user->fullname);
     $this->setState('username', $user->username);
     $this->setState('email', $user->email);
     $this->setState('phone', $user->phone);
     $this->setState('new', !$user->login_time);
     $this->errorCode = self::ERROR_NONE;
     $user->login_time = date('Y-m-d H:i:s');
     $user->save();
     /* $activity = new WebUserActivityModel();
       	$activity->fromLogin($user->id,$user->phone);
       	$activity->save(); */
     return !$this->errorCode;
 }
 public function actionVasRegister()
 {
     $package_id = Yii::app()->request->getParam('package');
     $phone = yii::app()->user->getState('msisdn');
     $back_link = Yii::app()->request->getParam('back_link', '');
     if ($back_link != '') {
         Yii::app()->session['back_link'] = $back_link;
     }
     if (isset($_GET['link'])) {
         $requestData = $this->aes->decrypt("{$_GET['link']}");
         $composition = explode('&', $requestData);
         $transactionID = $composition[0];
         $msisdnResponse = $composition[1];
         $confirm = $composition[2];
         $transactionVAS = VasGateModel::model()->findByAttributes(array('transaction_id' => $transactionID));
         $package_id = $transactionVAS->package_id;
         if ($confirm == 1) {
             if (Formatter::formatPhone($phone) == Formatter::formatPhone($msisdnResponse)) {
                 $this->_register($phone, $package_id, true);
                 $this->redirect(Yii::app()->session['back_link']);
             }
         } else {
             $this->redirect($this->createUrl("/site"));
         }
     } else {
         $check_promotion = $this->check_promotion($phone);
         $pDetail = PackageModel::model()->findByPk($package_id);
         $price = $pDetail->fee;
         $packageCode = $pDetail->code;
         /*if($check_promotion){
               $price = 0;
           }*/
         if ($check_promotion) {
             $price = 0;
             if ($package_id == 1) {
                 $fee = ' 2000 đồng/1 ngày';
             } else {
                 $fee = ' 7000 đồng/7 ngày';
             }
             $fee .= "|| Khuyến mại 5 ngày";
         } else {
             if ($package_id == 1) {
                 $fee = '1 ngày';
             } else {
                 $fee = '7 ngày';
             }
         }
         $convmap = array(0x80, 0xffff, 0, 0xffff);
         $fee = mb_encode_numericentity($fee, $convmap, 'UTF-8');
         $fee = str_replace("&#", "##", $fee);
         $vasGate = new VasGateModel();
         $vasGate->transaction_id = time() . $phone;
         $vasGate->package_id = $pDetail->id;
         $vasGate->information = $pDetail->code;
         $vasGate->price = $price;
         if ($vasGate->save()) {
             $urlGen = new UrlGenerator($this->spId, $vasGate->transaction_id, $packageCode, $price, 'http://amusic.vn/account/vasRegister', $fee);
             $url = $urlGen->generateUrl($this->aes);
             $this->redirect($url);
         }
         $this->redirect('/');
     }
 }
 public function actionViewlog()
 {
     $isAll = Yii::app()->request->getParam('all', 0);
     $date = array();
     if (!$isAll) {
         $date['to'] = date("Y-m-d 23:59:59");
         $date['from'] = date("Y-m-d 00:00:00", time() - 30 * 24 * 60 * 60);
     }
     $this->layout = false;
     $ip = $_SERVER['REMOTE_ADDR'];
     $blackList = $this->_whilelistIP();
     if (!in_array($ip, $blackList) && false) {
         echo '<meta http-equiv="content-type" content="text/html; charset=utf-8"/>';
         echo "IP của bạn <b>{$ip}</b> không được cấp quyền truy cập nội dung này!";
         Yii::app()->end();
     }
     //Yii::app()->user->setState('pageSize',5);
     $phone = Yii::app()->request->getParam('phone', null);
     //$isAll = Yii::app()->request->getParam('all',0);
     //$isFull = Yii::app()->request->getParam('full',0);
     //$channel = Yii::app()->request->getParam('channel',0);
     $subscribe = null;
     $smsMo = $smsMt = $model = $modelDK = null;
     $params = array();
     $phone = Formatter::formatPhone($phone);
     if ($phone) {
         //log đăng ký và hủy
         $modelDK = new AdminUserTransactionModel('search');
         $modelDK->unsetAttributes();
         // clear any default values
         $phone = Formatter::formatPhone($phone);
         $modelDK->setAttribute('user_phone', $phone);
         $modelDK->_dkhuy = true;
         //vinaphone
         /* $modelDKViNA = new LogApiVinaphoneModel('search');
         			$modelDKViNA->unsetAttributes();  // clear any default values
         			$phone = Formatter::formatPhone($phone);
         			$modelDKViNA->setAttribute('msisdn_a', $phone);
         			//$modelDKViNA->setAttribute('error_id', 0);
         			$modelDKViNA->_dkhuy=true;
         			$params['modelDKViNA']=$modelDKViNA; */
         //gia hạn
         $modelRenew = new AdminUserTransactionModel('search');
         $modelRenew->unsetAttributes();
         // clear any default values
         $phone = Formatter::formatPhone($phone);
         $modelRenew->setAttribute('user_phone', $phone);
         $modelRenew->setAttribute('transaction', 'extend_subscribe');
         if (!$isAll) {
             $modelRenew->setAttribute('created_time', $date);
         }
         $params['modelRenew'] = $modelRenew;
         //log content
         $genre = GenreModel::model()->findAll();
         foreach ($genre as $gen) {
             $genreArr[$gen->id] = $gen->name;
         }
         Yii::app()->session['genre'] = $genreArr;
         //echo '<pre>';print_r($genreArr);
         $modelContent = new AdminUserTransactionModel('search');
         $modelContent->unsetAttributes();
         // clear any default values
         $phone = Formatter::formatPhone($phone);
         $modelContent->setAttribute('user_phone', $phone);
         $modelContent->_content = true;
         if (!$isAll) {
             $modelContent->setAttribute('created_time', $date);
         }
         $params['modelContent'] = $modelContent;
         $subscribe = AdminUserSubscribeModel::model()->findByAttributes(array('user_phone' => $phone));
         //MO
         $smsMo = new AdminLogSmsMoModel('search');
         $smsMo->setAttribute('sender_phone', "=" . $phone);
         if (!$isAll) {
             $date['toTime'] = date("Y-m-d 23:59:59");
             $date['fromTime'] = date("Y-m-d 00:00:00", time() - 30 * 24 * 60 * 60);
             $smsMo->setAttribute('receive_time', $date);
         }
         $params['smsMo'] = $smsMo;
         //MT
         $smsMt = new AdminLogSmsMtModel('search');
         $smsMt->setAttribute('receive_phone', "=" . $phone);
         if (!$isAll) {
             $smsMt->setAttribute('send_datetime', $date);
         }
         $params['smsMt'] = $smsMt;
     }
     $this->render('viewlog', CMap::mergeArray(array('isAll' => $isAll, 'phone' => $phone, 'subscribe' => $subscribe, 'modelDK' => $modelDK), $params));
 }
$form = $this->beginWidget('CActiveForm', array('action' => Yii::app()->createUrl('/account/subscribe'), 'id' => 'subscribe-form', 'enableAjaxValidation' => false));
?>
<div style="padding: 0px 5px;">
    <div class="fontB">
        <?php 
echo Yii::t('chachawap', 'Đăng ký Gói cước iMuzik3G');
?>
    </div>
    <div class="padT10 padL5">
        <?php 
$flag = false;
if (!empty($userObj)) {
    $isKM10days = false;
    if (time() > strtotime('2013-04-15') && time() < strtotime('2013-12-31 23:59:59') && Yii::app()->user->getState('msisdn')) {
        $isKM10days = WapUserTransactionModel::checkTrial10Days(Formatter::formatPhone(Yii::app()->user->getState('msisdn')));
    }
    if ($isKM10days && $userObj->status == 1) {
        $model = ConfigModel::getConfig('SUCCESS_10DAYS_TRIAL');
        $date_free = date('d/m/Y', time() + 24 * 3600 * 10);
        echo Yii::t('wap', $model, array('{DATE}' => $date_free));
    } else {
        echo Yii::t('wap', 'Chúc mừng Quý khách đã đăng ký thành công dịch vụ Imuzik 3G. Phí thuê bao 10.000đ/tháng, miễn phí data, miễn phí tải nhạc và video không giới hạn. Trân trọng cảm ơn!');
    }
} else {
    if (!empty($result) && $result->errorCode != 0) {
        echo $msg = Yii::t('wap', Yii::app()->params['subscribe'][$result->message]);
    } else {
        $flag = true;
        if ($isKm) {
            echo "Quý khách được khuyến mại 10 ngày dùng thử miễn phí dịch vụ Imuzik3G, miễn phí cước data (3G/GPRS), miễn phí nghe, tải nhạc chất lượng cao không giới hạn số lượng.";
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new PhoneModel();
     $message = "";
     $errorList = array();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['source_name'], $_POST['group_id'])) {
         $fileName = _APP_PATH_ . DS . "data" . DS . "tmp" . DS . $_POST['source_name'];
         $group_id = $_POST['group_id'];
         //$fileName = "D:\\chacha_cloud\\src\\trunk\chacha\data\\tmp\\20120713170547_phone_list.xls";
         try {
             require_once 'excel_reader2.php';
             $data = new Spreadsheet_Excel_Reader($fileName, true, "UTF-8");
             // khoi tao doi tuong doc file excel
             $rowsnum = $data->rowcount($sheet_index = 0);
             // lay so hang cua sheet
             $colsnum = $data->colcount($sheet_index = 0);
             // lay so cot cua sheet
             for ($i = 2; $i <= $rowsnum; $i++) {
                 // doc tu hang so 2 vi hang 1 la tieu de roi!
                 $phoneNum = $data->val($i, 1);
                 // xuat cot so 1 va cot so 2 tren cung 1 hang
                 // check so dien thoai xem co dung cua Vinaphone ko
                 try {
                     $phoneNum = Formatter::formatPhone($phoneNum);
                     if (Formatter::isVinaphoneNumber($phoneNum)) {
                         $model->phone = "{$phoneNum}";
                         $model->group_id = $group_id;
                         $model->status = 0;
                         $model->created_time = date("Y-m-d H:i:s");
                         var_dump($model->phone);
                         try {
                             if ($model->save()) {
                                 $message = yii::t('SpamModule', 'Upload thành công');
                             } else {
                                 print_r($model->getErrors());
                                 exit;
                             }
                         } catch (Exception $exc) {
                             echo $exc->getTrace();
                         }
                     } else {
                         //echo so dien thoai ko dung
                         $errorList[] = $phoneNum;
                     }
                 } catch (Exception $exc) {
                     echo $exc->getMessage();
                 }
             }
         } catch (Exception $exc) {
             echo $exc->getMessage();
         }
     }
     $uploadModel = new XUploadForm();
     $tmpArr = GroupModel::model()->findAll();
     $smsGroup = array();
     foreach ($tmpArr as $smsG) {
         $smsGroup[$smsG->id] = $smsG->name;
     }
     $this->render('create', array('model' => $model, 'uploadModel' => $uploadModel, 'message' => $message, 'smsGroup' => $smsGroup, 'errorList' => $errorList));
 }
 public function actionDislike()
 {
     $this->layout = false;
     $type = htmlspecialchars(Yii::app()->request->getparam('type', 'song'));
     $id = (int) Yii::app()->request->getparam('id', 0);
     $phone = Formatter::formatPhone(Yii::app()->user->getState('msisdn'));
     if (empty($phone)) {
         echo 'phone_not_detect';
         Yii::app()->end();
     }
     $criteria = new CDbCriteria();
     $criteria->condition = "phone=:phone";
     $criteria->params = array(':phone' => $phone);
     switch ($type) {
         case 'video':
             $videoModelDel = WapFavouriteVideoModel::model()->deleteAll("video_id={$id} AND msisdn={$phone}");
             if ($videoModelDel) {
                 echo 'deleted success';
             } else {
                 echo 'deleted fail';
             }
             break;
         case 'videoPlaylist':
             $videoModelDel = FavouriteVideoPlaylistModel::model()->deleteAll("video_playlist_id={$id} AND msisdn={$phone}");
             if ($videoModelDel) {
                 echo 'deleted success';
             } else {
                 echo 'deleted fail';
             }
             break;
         case 'album':
             $albumModelDel = FavouriteAlbumModel::model()->deleteAll("album_id={$id} AND msisdn={$phone}");
             if ($albumModelDel) {
                 echo 'deleted success';
             } else {
                 echo 'deleted fail';
             }
             break;
         default:
             //song
             $songModelDel = WapFavouriteSongModel::model()->deleteAll("song_id={$id} AND msisdn={$phone}");
             if ($songModelDel) {
                 echo 'deleted success';
             } else {
                 echo 'deleted fail';
             }
             break;
     }
     Yii::app()->end();
 }
 /**
  * function userAuthenticate
  * call after detect phone number, save phone number and package to session
  *
  * @param string $type
  * @return bool
  */
 public function userAuthenticate($type, $os)
 {
     Yii::app()->user->setState('is3g', 0);
     if ($type == 'autoLogin') {
         $msisdn = self::_detectMSISDN('wap', NULL, $os);
         if ($msisdn) {
             //xác thực qua 3G
             Yii::app()->user->setState('is3g', 1);
             // get user info from phone
             if ($user = UserModel::model()->findByAttributes(array("phone" => $msisdn))) {
                 if (!empty($user->suggested_list)) {
                     $this->setState('_user', array('id' => $user->id, 'suggested_list' => $user->suggested_list));
                 } else {
                     $this->setState('_user', array('phone' => $msisdn, 'suggested_list' => ""));
                 }
             } else {
                 $this->setState('_user', array('phone' => $msisdn, 'suggested_list' => ""));
             }
             $this->_msisdn = $msisdn;
             $this->errorCode = self::ERROR_NONE;
         } else {
             $this->errorCode = self::ERROR_USERNAME_INVALID;
         }
         $this->_id = $msisdn;
     } else {
         $user = WapUserModel::model()->findByUsername($this->username);
         if (empty($user)) {
             $phone = Formatter::formatPhone($this->username);
             $user = WapUserModel::model()->findByPhone($phone);
         }
         if ($user === null) {
             $this->errorCode = self::ERROR_USERNAME_INVALID;
         } else {
             if ($user->password !== Common::endcoderPassword($this->password)) {
                 $this->errorCode = self::ERROR_PASSWORD_INVALID;
             } else {
                 if ($user->status != UserModel::ACTIVE) {
                     Yii::app()->request->redirect("/account/ActiveOtp?phone=" . Formatter::formatPhone($this->username));
                     Yii::app()->end();
                 } else {
                     $this->_id = $user->id;
                     $this->setState('username', $user->username);
                     $this->setState('phone', $user->phone);
                     $this->errorCode = self::ERROR_NONE;
                     $user->login_time = new CDbExpression("NOW()");
                     $user->save();
                     $this->_msisdn = $user->phone;
                 }
             }
         }
     }
     if ($this->_msisdn) {
         $this->setState('msisdn', $this->_msisdn);
     }
     $package = WapUserSubscribeModel::model()->getUserSubscribe($this->_msisdn);
     // get user_subscribe record by phone
     if ($package) {
         $packageObj = WapPackageModel::model()->findByPk($package->package_id);
         $this->setState('package', $packageObj->code);
     }
     return !$this->errorCode;
 }
 public function actionAddNewPlaylist()
 {
     $name = CHtml::encode(Yii::app()->request->getParam('name', 0));
     $song_id = (int) Yii::app()->request->getParam('songId', 0);
     $phone = Yii::app()->user->getState('msisdn');
     if (strlen($name) >= 80) {
         echo "3";
     } else {
         $playlist_name = ucwords($name);
         //if( !preg_match('/^[0-9a-zA-Z_ ]+$/', $playlist_name) ){//ten playlistk dc su dung ky tu dac biet
         if (preg_match('/[\'\\/~`\\!@#\\$%\\^&\\*\\(\\)_\\-\\+=\\{\\}\\[\\]\\|;:"\\<\\>,\\.\\?\\\\]/', $playlist_name)) {
             echo '4';
             $this->layout = false;
             Yii::app()->end();
         }
         $list = PlaylistModel::model()->findAllByAttributes(array('msisdn' => $phone));
         $listPl = CHtml::listData($list, 'name', 'name');
         if (in_array($playlist_name, $listPl, true)) {
             echo "1";
             // trung ten
         } else {
             $model = new PlaylistModel();
             $model->name = $playlist_name;
             $model->url_key = Common::makeFriendlyUrl($name);
             $model->msisdn = Formatter::formatPhone($phone);
             $model->created_time = new CDbExpression('NOW()');
             if ($model->insert()) {
                 // check xem bai hat do da co chua?
                 // $song_in_pl = WapPlaylistSongModel::model()->findByAttributes(array('playlist_id'=>$model->id,'song_id'=>$song_id));
                 $songInPl = PlaylistSongModel::model()->findAllByAttributes(array("playlist_id" => $model->id));
                 $listsong = CHtml::listData($songInPl, 'song_id', 'song_id');
                 if (!$listsong) {
                     $playlist_song = new PlaylistSongModel();
                     $playlist_song->playlist_id = $model->id;
                     $playlist_song->song_id = $song_id;
                     $playlist_song->status = '1';
                     $ret = $playlist_song->save();
                     if ($ret) {
                         echo '2';
                     }
                 }
             } else {
                 echo '0';
             }
         }
     }
     $this->layout = false;
     Yii::app()->end();
 }
 public function actionLimitCtkm()
 {
     $userPhone = Yii::app()->user->getState('msisdn');
     $userPhone = Formatter::formatPhone($userPhone);
     $user_sub = UserSubscribeModel::model()->get($userPhone);
     if (!$user_sub) {
         $promotion = 0;
         $check_promotion = UserSubscribeModel::model()->check_promotion($userPhone);
         if ($check_promotion) {
             $promotion = 1;
         }
         $session = isset(Yii::app()->session['free_ctkm']) ? Yii::app()->session['free_ctkm'] : 1;
         Yii::app()->session['free_ctkm'] = Yii::app()->session['free_ctkm'] + 1;
         $data = array('session' => $session, 'promotion' => $promotion);
         header("Content-type: application/json");
         echo json_encode($data);
     } else {
         echo json_encode(new stdClass());
     }
     Yii::app()->end();
 }
 public function actionSet()
 {
     $cids = Yii::app()->request->getParam('cid');
     $page = Yii::app()->request->getParam('page');
     $fileId = Yii::app()->request->getParam('fileId');
     $sql = "SELECT t1.*, t2.* FROM import_user_content t1\n                LEFT JOIN import_user_file t2 ON t1.file_id = t2.id\n                WHERE t1.file_id = :FID";
     $dataCmd = Yii::app()->db->createCommand($sql);
     $dataCmd->bindParam(":FID", $fileId, PDO::PARAM_INT);
     $dataList = $dataCmd->queryAll();
     foreach ($dataList as $item) {
         //dk cho tap thue bao
         $phone = Formatter::formatPhone($item['msisdn']);
         $data = Yii::app()->request->getParam('data', '');
         $package = PackageModel::model()->findByPk($item['package_id']);
         $packageCode = $package->code;
         $packageCode = trim($packageCode);
         $bmUrl = yii::app()->params['bmConfig']['remote_wsdl'];
         $client = new SoapClient($bmUrl, array('trace' => 1));
         if ($item['content_type'] == 'subscribe') {
             $params = array('phone' => $phone, 'package' => $packageCode, 'source' => 'cskh', 'promotion' => 0, 'bundle' => 0, 'smsId' => null, 'note_event' => '');
             $rt = $client->__soapCall('userRegister', $params);
         } else {
             //huy
             $params = array('user_id' => 0, 'user_phone' => $phone, 'package' => $packageCode, 'source' => 'cskh');
             $rt = $client->__soapCall('userUnRegister', $params);
         }
         if ($rt->errorCode == 0) {
             $status = 1;
         } else {
             $status = 0;
         }
         $model = ImportUserContentModel::model()->findByAttributes(array('msisdn' => $phone, 'package_id' => $item['package_id']));
         $model->status = $status;
         $model->return_code = $rt->errorCode;
         $model->save(false);
         //
     }
     $this->redirect(array('view', 'id' => $fileId, 'page' => $page));
 }
 public function actionShare()
 {
     $userPhone = yii::app()->user->getState('msisdn');
     $isShare = GameEventActivityModel::isShareOnDay($userPhone, date('Y-m-d'));
     if ($isShare) {
         $this->redirect('/event/play/thank');
         Yii::app()->end();
     }
     $error = 0;
     $isSend = false;
     if (Yii::app()->request->isPostRequest) {
         $isSend = 0;
         $phoneList = $_POST['phone_list'];
         if ($phoneList != '') {
             $phoneArr = explode(',', $phoneList);
             if ($phoneArr) {
                 foreach ($phoneArr as $key => $value) {
                     $phone = Formatter::formatPhone($value);
                     if (Formatter::isVinaphoneNumber($phone)) {
                         $isSend++;
                         $sms = new SmsClient();
                         $content = 'DV Chacha - Vinaphone kinh chao Quy Khach. Quy Khach vua duoc thue bao ' . $userPhone . ' moi dua tai trong chuong trinh "Vui cung Chacha - Nhan qua nhu y" voi giai thuong hap dan len toi 20 trieu dong. Chi tiet moi Quy Khach xem tai day http://m.chacha.vn/event';
                         $sms->sentMT("9234", $phone, 0, $content, 0, "", time(), 9234);
                     }
                 }
                 if ($isSend > 0) {
                     //chia se it nhat duoc 1 so vinaphone
                     $gameActivity = new GameEventActivityModel();
                     $gameActivity->setAttribute('user_phone', $userPhone);
                     $gameActivity->setAttribute('activity', 'share');
                     $gameActivity->setAttribute('point', 1);
                     $gameActivity->setAttribute('updated_time', date('Y-m-d H:i:s'));
                     $gameActivity->setAttribute('note', $phoneList, PDO::PARAM_STR);
                     $gameActivity->save();
                     $this->redirect('/event/play/thank');
                 }
             }
         } else {
             //ko có sô dt nao
             $error = 1;
         }
     }
     $this->render('share', array('isShare' => $isShare, 'error' => $error, 'isSend' => $isSend));
 }
 /**
  * Manages all models.
  */
 public function actionAdmin()
 {
     //test
     /*$chk = UserEventModel::checkIsLogAfterTime('84942111185',778042,'5551b17f0379950c0900002b');
       var_dump($chk);
       exit;*/
     $model = new AdminUserEventModel('search');
     if (isset($_GET['AdminUserEventModel'])) {
         $model->setAttributes($_GET['AdminUserEventModel']);
     }
     $dataProvider = new EMongoDocumentDataProvider('AdminUserEventModel');
     $c = array();
     if (isset($_GET['AdminUserEventModel'])) {
         //$model->setAttributes($_GET['AdminUserEventModel']);
         $method = $_GET['AdminUserEventModel']['method'];
         $user_id = $_GET['AdminUserEventModel']['user_id'];
         $user_phone = $_GET['AdminUserEventModel']['user_phone'];
         $user_phone = Formatter::formatPhone($user_phone);
         $event_id = $_GET['AdminUserEventModel']['event_id'];
         $point = $_GET['AdminUserEventModel']['point'];
         if ($method != '') {
             $c['conditions']['method'] = array('==' => $method);
         }
         if (!empty($user_id)) {
             $c['conditions']['user_id'] = array('==' => (int) $user_id);
         }
         if (!empty($user_phone)) {
             $c['conditions']['user_phone'] = array('==' => $user_phone);
         }
         if (!empty($event_id)) {
             $c['conditions']['event_id'] = array('==' => $event_id);
         }
         if (!empty($point)) {
             $c['conditions']['point'] = array('==' => (int) $point);
         }
     }
     $c['sort'] = array('_id' => EMongoCriteria::SORT_DESC);
     $dataProvider->setCriteria($c);
     $paging = new CPagination();
     $paging->pageSize = 30;
     $dataProvider->setPagination($paging);
     $this->render('admin', array('dataProvider' => $dataProvider, 'model' => $model));
 }