} } } } public function actionCheckPropertyType() { $response = array(); if ($_POST) { $property = ProPropertyType::findParentById($_POST['id']); if (isset($property)) { if ($property->id == SHOP_HOUSE || $property->id == LAND_SIZE || $property->id == BUILT_UP_SIZE || $property->id == RETAIL || $property->id == LANDED_HOUSE) { $response['msg'] = 'ok'; } else { $response['msg'] = 'not_ok'; } } else { $response['msg'] = 'ok'; }
/** * PHAM DUY TOAN * * Email : ghostkissboy12@gmail.com * Check company list */ public static function checkCompanyListingWithId($id, &$mListing) { $criteria = new CDbCriteria(); $criteria->compare('t.id', $id); $criteria->compare('t.listing_type_transaction', ProTransactionsPropertyDetail::VAR_COMPANY); $model = Listing::model()->find($criteria); if (is_null($model)) { Yii::app()->request->redirect(Yii::app()->createAbsoluteUrl('/member/site/dashboard')); } $mListing->listing_type = $model->listing_type; $mListing->property_name_or_address = $model->property_name_or_address; $mListing->postal_code = $model->postal_code; $mListing->postal_code_tmp = $model->postal_code_tmp; $mListing->postal_code_xy = $model->postal_code_xy; $mListing->property_type_1 = $model->property_type_1; $mParentPropertyType = ProPropertyType::findParentById($model->property_type_1); if ($mParentPropertyType) { $mListing->property_type_2 = $mParentPropertyType->id; } $mListing->price = $model->price; $mListing->unit_from = $model->unit_from; $mListing->unit_to = $model->unit_to; $mListing->floor_area = $model->floor_area; $mListing->company_listing_user_created = $model->user_id; $mListing->display_title = $model->display_title; $mListing->display_address = $model->display_address; }