Example #1
0
        return array('captcha' => array('class' => 'CCaptchaAction', 'backColor' => 0xffffff), 'page' => array('class' => 'CViewAction'));
    }
    /*
	 * @author Lam Huynh
	 */
    public function actionIndex()
    {
        if (empty($_GET)) {
            $this->redirect(Yii::app()->createAbsoluteUrl('site/home'));
        }
        // build breadscrumb
        $searchParams = array('index');
        $breadcrumbs = array();
        // property type (child)
        if (isset($_GET['property_type_code'])) {
            $typeIds = $_GET['property_type_code'];
            if ($typeIds && ($type = ProPropertyType::model()->findByPk(current($typeIds)))) {
                $searchParams['property_type_code[]'] = $type->id;
                $breadcrumbs[$type->name] = $searchParams;
            }
        }
        // district
        if (isset($_GET['location'])) {
            $locationIds = $_GET['location'];
            if ($locationIds && ($location = ProLocation::model()->findByPk(current($locationIds)))) {
                $searchParams['location[]'] = $location->id;
                $breadcrumbs[$location->name] = $searchParams;
            }
        }
        // buidling name
        if (isset($_GET['building']) && ($building = $_GET['building'])) {
            $searchParams['building'] = $building;
            $breadcrumbs[$building] = $searchParams;
        }
        // listing type: sale/rent
        if (isset($_GET['listing_for']) && ($listingFor = $_GET['listing_for'])) {
            $typeText = $listingFor == 'for_rent' ? "For Rent" : "For Sale";
            $searchParams['listing_for'] = $listingFor;
            $breadcrumbs[$typeText] = $searchParams;
        }
        $this->breadcrumbs = $breadcrumbs;
        Yii::app()->theme = 'onehome';
        Yii::app()->clientScript->coreScriptPosition = CClientScript::POS_BEGIN;
Example #2
0
$aData['checkbox_id'] = 'EngageUsRentCheckboxId';
$aData['model'] = $model;
$this->widget('ext.ProPropertyTypeExt.ProPropertyTypeExt', array('data' => $aData));
?>
            </div>
        
            <div class="anhdung_Tenant anhdung_Landlord">
                <?php 
echo $form->labelEx($model, 'location_id', array('label' => 'Location', 'class' => 'lb'));
?>
                <?php 
// echo $form->dropDownList($model,'location_id', ProLocation::getListDataLocation(), array('empty'=>'All locations in Singapore'));
?>
                <div class="wrap_multiselect_location display_none">
                    <?php 
echo CHtml::dropDownList('location_list_id', '', ProLocation::getListDataLocation(), array('class' => 'multiselect_location_rent', 'multiple' => 'multiple', 'id' => 'location_list_id_rent'));
?>
                </div>
                <?php 
echo $form->error($model, 'location_id');
?>
            </div>        
        
            <div class="anhdung_Landlord">
                <div class="floor_area_rent_hide" >
                  <?php 
echo $form->labelEx($model, 'floor_area', array('class' => 'lb'));
?>
                  <?php 
echo $form->textField($model, 'floor_area', array('class' => 'text floor_area_rent'));
?>
Example #3
0
            </div>

            <div class="form-group sidebar-tab">
                <label class="control-label">Type</label>
                <div class="select-wrap">
                    <?php 
include 'property_search_type.php';
?>
                </div>
            </div>

            <div class="form-group sidebar-tab">
                <label class="control-label">Location</label>
                <div class="wrap_multiselect_location multi-select-wrap hide">
                    <?php 
echo CHtml::dropDownList('location', $aLocation, ProLocation::getListDataLocation(), array('class' => 'multiselect_location', 'multiple' => 'multiple'));
?>
                </div>
            </div>

           <div class="form-group sidebar-tab">
               <label class="control-label">Price</label>
               <div class="row">
                   <div class="col-xs-6">
                       <?php 
echo CHtml::dropDownList('minimum_price', $s_minimum_price, ProMasterPrice::getListOption($PriceType), array('empty' => 'Minimum', 'class' => 'minimum_price form-control'));
?>
                   </div>
                   <div class="col-xs-6">
                       <?php 
echo CHtml::dropDownList('maximum_price', $s_maximum_price, ProMasterPrice::getListOption($PriceType), array('empty' => 'Maximum', 'class' => 'maximum_price form-control'));
Example #4
0
	<li>The Associates shall not contact the clients from the Company listings and also be required to return all information relating to the Company listings in the event of termination of employment with the Company.</li>
</ul>

<p>I agree to abide the duties of the Non-disclosure clause. </p>

<p>PREFERED CHOICES  (DISTRICT NO.)</p>

<table>
	<tr>
		<th style="width: 80px">1 <sup>ST</sup></th>
		<td><?php 
echo $f->formatEnum($model->location_id_1, ProLocation::getListDataLocation());
?>
</td>
	</tr>
	<tr>
		<th>2 <sup>ND</sup></th>
		<td><?php 
echo $f->formatEnum($model->location_id_2, ProLocation::getListDataLocation());
?>
</td>
	</tr>
	<tr>
		<th>3 <sup>RD</sup></th>
		<td><?php 
echo $f->formatEnum($model->location_id_3, ProLocation::getListDataLocation());
?>
</td>
	</tr>
</table>
Example #5
0
 public static function GetInfoMapAd($model)
 {
     /* ---------------------------------------------------
      * DTOAN
      * ADD LOCATION
      * lay 2 so dau
      * --------------------------------------------------
      */
     if (!empty($model->postal_code)) {
         $postaCode = substr($model->postal_code, 0, 2);
         $checkLocation = ProLocation::model()->find("t.postal_code like '%{$postaCode}%'");
         if ($checkLocation && isset($checkLocation->id)) {
             $model->location_id = $checkLocation->id;
         }
     }
     //        if ($model->map_config_distance != Yii::app()->params['distance']) {
     $position = explode('-', $model->postal_code_xy);
     if (count($position) == 2) {
         $dist = Yii::app()->params['distance'];
         $limit = Yii::app()->params['limit_result'];
         $long = $position[0];
         $lat = $position[1];
         $mrt_distance = array();
         $mrt = ApiNearRmt::model()->findAll();
         foreach ($mrt as $item) {
             $tmp = Listing::findDistance($long, $item->long_street, $lat, $item->lat_street);
             if ($tmp <= $dist) {
                 $mrt_distance[$item->id]['v'] = $item->name . "({$tmp} Km)";
                 $mrt_distance[$item->id]['x'] = $item->long_street;
                 $mrt_distance[$item->id]['y'] = $item->lat_street;
             }
         }
         //near school
         $school_distance = array();
         $school = ApiNearSchool::model()->findAll();
         foreach ($school as $school_item) {
             $tmp = Listing::findDistance($long, $school_item->long_street, $lat, $school_item->lat_street);
             if ($tmp <= $dist) {
                 $school_distance[$school_item->id]['v'] = $school_item->name . "({$tmp} Km)";
                 $school_distance[$school_item->id]['x'] = $school_item->long_street;
                 $school_distance[$school_item->id]['y'] = $school_item->lat_street;
             }
         }
         //building nam
         $building_distance = array();
         $allBuilding = ApiBuilding::model()->findAll();
         foreach ($allBuilding as $building) {
             $tmp = Listing::findDistance($long, $building->long_street, $lat, $building->lat_street);
             if ($tmp <= $dist) {
                 $name = substr($building->building, 6, 45);
                 $building_distance[$building->id]['v'] = $name . "({$tmp} Km)";
                 $building_distance[$building->id]['x'] = $building->long_street;
                 $building_distance[$building->id]['y'] = $building->lat_street;
             }
         }
         /*  
             51 => 'Nearest MRT Stations',
             23 => 'Nearest Schools'
             1093 => 'Nearest Building',
             'car' => 'Nearest bus stop',
         */
         //$nearBy = @file_get_contents('http://www.streetdirectory.com/api/?mode=tips&act=nearby&output=json&x=' . trim($position[0]) . '&y=' . trim($position[1]) . '&dist=' . $dist . '&start=0&limit=' . $limit . '&country=sg');
         /*            $link = 'http://www.streetdirectory.com/api/?mode=tips&act=nearby&output=json&x=' . trim($position[0]) . '&y=' . trim($position[1]) . '&dist=' . $dist . '&start=0&limit=' . $limit . '&country=sg';
                     $ch = curl_init();
                     $domain = $_SERVER["HTTP_HOST"];
                     curl_setopt($ch, CURLOPT_URL, "$link");
                     curl_setopt($ch, CURLOPT_POST, 1);
                     curl_setopt($ch, CURLOPT_POSTFIELDS, "domain=$domain");
                     curl_setopt($ch, CURLOPT_HEADER, 0);
                     $nearBy = curl_exec($ch);
         
                     $arrCat = Listing::$nearBy;
                     $data   = json_decode($nearBy, true);
                     $dataCat = array();
                     if (is_array($data) && count($data) > 0) {
                         foreach ($data as $item) {
                             if (isset($item['cat']) && isset($arrCat[$item['cat']])) {
                                 $dataCat[$item['cat']][] = $item;
                             }
                         }
                     }*/
         $dataCat[51] = $mrt_distance;
         $dataCat[23] = $school_distance;
         $dataCat[1093] = $building_distance;
         $dataCat['car'] = array();
         // ANH DUNG Oct 27, 2014 tinh property_house_blk_no
         // 1. co postal code
         // 2.  House/blk no = building Number (trong table walkup ) +
         $model->property_house_blk_no = self::getHouseBlkNo($model->postal_code);
         $model->property_street_name = self::getStreetName($model->postal_code);
         $model->map_config_distance = $dist;
         $model->map_config_result = $limit;
         $model->json_map = json_encode($dataCat);
     }
 }
Example #6
0
 protected static function parseLocation($dom)
 {
     $a = $dom->find('.summarytitle a', 0);
     if (!$a) {
         return null;
     }
     $matches = null;
     preg_match('/\\(D(\\d+)\\)/', $a->plaintext, $matches);
     if (!isset($matches[1])) {
         return null;
     }
     $district = (int) $matches[1];
     $model = ProLocation::model()->findByAttributes(array('district' => $district));
     if (!$model) {
         return null;
     }
     return $model->id;
 }
Example #7
0
?>
            <?php 
echo $form->dropDownList($model, 'gst', CmsFormatter::$yesNoFormat, array());
?>
            <?php 
echo $form->error($model, 'gst');
?>
        </div>    
    
        <div class="clr"></div>
        <div class="row wrap_multiselect_location">
            <?php 
echo $form->labelEx($model, 'ProAgentDistrict');
?>
            <?php 
echo $form->dropDownList($model, 'ProAgentDistrict', ProLocation::getListDataLocation(), array('class' => 'multiselect_location', 'multiple' => 'multiple'));
?>
            <?php 
echo $form->error($model, 'ProAgentDistrict');
?>
        </div>    
        <div class="clr"></div>
        
        <div class="row">
            <?php 
echo $form->labelEx($model, 'TierManagerId');
?>
            <?php 
echo $form->hiddenField($model, 'TierManagerId');
?>
            <div class="f-left">
Example #8
0
     if ($mTransCommission->status == STATUS_GEN_RECEIPT) {
         $res = $cmsFormater->formatPrice($mTransCommission->received_commission);
     }
     return $res;
 }
Example #9
0
$aData['radio_id'] = 'EngageUsBuyRadioId';
$aData['checkbox_id'] = 'EngageUsBuyCheckboxId';
$aData['model'] = $model;
$this->widget('ext.ProPropertyTypeExt.ProPropertyTypeExt', array('data' => $aData));
?>
    

    <?php 
echo $form->labelEx($model, 'location_id', array('label' => 'Location', 'class' => 'lb'));
?>
    <?php 
// echo $form->dropDownList($model, 'location_id', ProLocation::getListDataLocation(), array('empty' => 'All locations in Singapore'));
?>
    <div class="wrap_multiselect_location display_none">
        <?php 
echo CHtml::dropDownList('location_list_id[]', '', ProLocation::getListDataLocation(), array('class' => 'multiselect_location_buy', 'multiple' => 'multiple'));
?>
    </div>    
    <?php 
echo $form->error($model, 'location_id');
?>

    <?php 
echo $form->labelEx($model, 'price', array('label' => 'Price', 'class' => 'lb'));
?>
    <div class="clearfix">
        <div class="col-1">
            <?php 
echo $form->dropDownList($model, 'min_price', ProMasterPrice::getListOption(ProMasterPrice::PRICE_FOR_SALE), array('empty' => 'Minimum', 'id' => 'minimum_price_engage', 'class' => 'enquiry_minimum_price'));
?>
        </div>
Example #10
0
						<?php 
echo $form->label($model, 'listing_type', array('class' => 'lb', 'label' => 'Type'));
?>
						<div class="group-5">
							<?php 
echo $form->dropdownList($model, 'listing_type', Listing::$aTextSaleRentNormal, array('class' => 'text', 'empty' => '--All--'));
?>
						</div>
					</div>
					<div class="in-row clearfix">
						<?php 
echo $form->label($model, 'location_id', array('class' => 'lb', 'label' => 'Location'));
?>
						<div class="group-5">
							<?php 
echo $form->dropdownList($model, 'location_id', ProLocation::getListDataLocation(), array('empty' => '--All--'));
?>
						</div>
					</div>
					<div class="in-row clearfix">
						<?php 
echo $form->label($model, 'user_id', array('class' => 'lb', 'label' => 'Telemarketer'));
?>
						<div class="group-5">
							<?php 
echo $form->dropdownList($model, 'user_id', CHtml::listData(Users::getTelemarketers(), 'id', 'name_for_slug'), array('empty' => '--All--'));
?>
						</div>
					</div>
					<div class="in-row clearfix">
						<?php 
Example #11
0
 public function getDistrictText()
 {
     return Yii::app()->format->formatEnum($this->location_id, ProLocation::getListDataLocation());
 }
Example #12
0
    <?php 
echo $form->labelEx($model, 'postal_code', array('label' => 'Postal code', 'class' => 'lb'));
?>
    <?php 
echo $form->textField($model, 'postal_code', array('class' => 'text'));
?>
    <?php 
echo $form->error($model, 'postal_code');
?>

 
    <?php 
echo $form->labelEx($model, 'location_id', array('label' => 'Location', 'class' => 'lb'));
?>
    <?php 
echo $form->dropDownList($model, 'location_id', ProLocation::getListDataLocation(), array('empty' => 'All locations in Singapore', 'style' => 'width:'));
?>
    <?php 
echo $form->error($model, 'location_id');
?>
   
     
    <?php 
echo $form->labelEx($model, 'property_type_id', array('label' => 'Property Type', 'class' => 'lb'));
?>
    <?php 
// echo ProPropertyType::getDropDownSelectGroup('ProGlobalEnquiry[property_type_id]', 'ProGlobalEnquiry_property_type_id', $model->property_type_id, 'All property types','Propety_type_sell');
?>
    <?php 
$aData = array();
$aData['zonechoosetype'] = 'type_engage_us_sell';
 public function getLocation3()
 {
     return Yii::app()->format->formatEnum($this->location_id_3, ProLocation::getListDataLocation());
 }
Example #14
0
         if ($model->user_id == Yii::app()->user->id) {
             $model->delete();
         }
     }
 }
 /**
  * @Author: ANH DUNG Jul 25, 2014
  * @Todo: build li photo for inventory photo
  * @Param: $model model 
  * @Return: string li
  */
 public function builLiPhoto($model)
 {
     $file_path = ImageProcessing::bindImageByModel($model, 160, 160);
     $pathPhotoBig = ImageProcessing::bindImageByModel($model, -1, -1);
     $link_remove = Yii::app()->createAbsoluteUrl('enquiry/ajaxRemoveFileAll', array('id' => $model->id));
     if (isset($_GET['admin'])) {
         $link_remove = Yii::app()->createAbsoluteUrl('admin/tenancy/inventoryPhoto', array('id' => $model->transaction_id, 'InventoryPhotoId' => $model->id));
     }
     $res = "";
     $res .= "<li>";
     $res .= "<a href='{$pathPhotoBig}' class='FancyPhoto' rel='group'>";
echo $form->error($model, 'choosetype');
?>
		</div>
	</div>
	<div class="form-group">
		<?php 
echo $form->labelEx($model, 'unit_from', array('class' => 'control-label'));
?>
		<div class="row">
			<div class="col-xs-6">
				<?php 
echo $form->textField($model, 'unit_from', array('class' => 'form-control', 'placeholder' => ''));
?>
				<?php 
echo $form->error($model, 'unit_from');
?>
 
			</div>
			<div class="col-xs-6">
				<?php 
echo $form->textField($model, 'unit_to', array('class' => 'form-control', 'placeholder' => ''));
?>
				<?php 
echo $form->error($model, 'unit_to');
?>
 
			</div>
		</div>
	</div>
	<div class="form-group">
		<?php 
Example #16
0
<?php

$this->breadcrumbs = array('Bank  Evaluation Report' => array('index'), $model->property_name_or_address);
$menus = array(array('label' => 'Bank Evaluation Report', 'url' => array('index')), array('label' => 'Delete', 'url' => array('delete'), 'linkOptions' => array('submit' => array('delete', 'id' => $model->id), 'confirm' => 'Are you sure you want to delete this item?')));
$this->menu = ControllerActionsName::createMenusRoles($menus, $actions);
$PropertyTypeList = ProPropertyType::FormatViewProperyType($model);
?>

<h1>View Bank Evaluation Report: <?php 
echo $model->property_name_or_address;
?>
</h1>

<?php 
$this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array('property_name_or_address', 'postal_code', array('name' => 'unit_from', 'value' => $model->unit_from . " - {$model->unit_to}"), array('name' => 'location_id', 'value' => ProLocation::getNameWithDistrict($model->location_id)), array('name' => 'property_type_id', 'type' => 'html', 'value' => $PropertyTypeList), 'tenure', array('name' => 'furnished', 'value' => $model->furnished ? $model->furnished->name : ""), 'of_bedroom_from', 'of_bathrooms_from', 'type_selling', 'floor_area', array('name' => 'tenancy_expiry_date', 'type' => 'TenancyExpiryDate', 'value' => $model), 'monthly_rental_amount', array('name' => 'target_price', 'type' => 'NumberOnly'), 'remark', 'nric', 'fullname', 'contact_no', 'email', 'target_price:Price')));
Example #17
0
echo $form->fileField($model, 'uploadCertification', array('class' => ''));
?>
					<?php 
echo $form->error($model, 'uploadCertification');
?>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-md-6">
				<div class="form-group">
					<?php 
echo $form->labelEx($model, 'location_id', array('class' => 'control-label'));
?>
					<?php 
echo $form->dropDownList($model, 'location_id', ProLocation::getListDataLocation(), array('class' => 'form-control', 'empty' => 'Select'));
?>
					<?php 
echo $form->error($model, 'location_id');
?>
				</div>
			</div>
			<div class="col-md-6">
				<div class="checkbox">
					<label><?php 
echo $form->checkbox($model, 'updatedCea');
?>
 Updated in CEA Website</label>
					<?php 
echo $form->error($model, 'updatedCea');
?>
Example #18
0
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     try {
         $model = ProLocation::model()->findByPk($id);
         if ($model === null) {
             Yii::log("The requested page does not exist.");
             throw new CHttpException(404, 'The requested page does not exist.');
         }
         return $model;
     } catch (Exception $e) {
         Yii::log("Exception " . print_r($e, true), 'error');
         throw new CHttpException("Exception " . print_r($e, true));
     }
 }