コード例 #1
0
 public function actionIndex($status = null, $listing_type = null, $pro_type = NULL)
 {
     //        Listing::SqlUpdateInfo();
     $model = new Listing();
     $agent = '';
     if (isset($_GET['user_id']) && is_numeric($_GET['user_id'])) {
         $model->user_id = (int) $_GET['user_id'];
         $agent = Users::model()->findByPk($model->user_id);
     }
     //status
     if (empty($status)) {
         $model->status_listing = STATUS_LISTING_ACTIVE;
     } else {
         $model->status_listing = $status;
     }
     //listing type
     if (!empty($listing_type) && is_numeric($listing_type) && ($listing_type >= 1 && $listing_type <= 2)) {
         $model->listing_type = $listing_type;
     }
     //property type
     if (!empty($pro_type) && is_numeric($pro_type)) {
         $model->property_type_1 = $pro_type;
     }
     $view = Listing::getViewStatus($status, STATUS_LISTING_ACTIVE);
     if (isset($_GET['Listing'])) {
         $model->attributes = $_GET['Listing'];
     }
     $this->render("index_{$view}", array('model' => $model, 'agent' => $agent, 'actions' => $this->listActionsCanAccess));
 }
コード例 #2
0
 public function actionIndex($status = null, $listing_type = null, $pro_type = NULL)
 {
     $this->pageTitle = 'Listing Management' . ' - ' . Yii::app()->params['title'];
     $model = new Listing();
     $model->user_id = $this->userID;
     //status
     if (empty($status)) {
         $model->status_listing = STATUS_LISTING_ACTIVE;
     } else {
         $model->status_listing = $status;
     }
     //listing type
     if (!empty($listing_type) && is_numeric($listing_type) && ($listing_type >= 1 && $listing_type <= 2)) {
         $model->listing_type = $listing_type;
     }
     // ANH DUNG CLOSE JUL 23, 2014 property type
     //        if (!empty($pro_type) && is_numeric($pro_type))  $model->property_type_1 = $pro_type;
     if (isset($_GET['Listing'])) {
         $model->attributes = $_GET['Listing'];
     }
     $view = Listing::getViewStatus($status, STATUS_LISTING_ACTIVE);
     $this->render("index_{$view}", array('model' => $model));
 }