Ejemplo n.º 1
0
if (isset($arrOrther['imageDefault']) && $arrOrther['imageDefault'] != '') {
    echo CHtml::image(Yii::app()->createAbsoluteUrl('upload/listing/' . $model->id . "/120x96/" . $arrOrther['imageDefault']), strip_tags($model->property_name_or_address));
}
?>
 
            </div>
            <!--<div style="float:right;margin-left:20px;">-->
            <div style="float:left;margin-left:10px;" class="listing-info">
                <h4 style="color:#34739B !important;font-weight: bold;font-size: 16px !important;"><?php 
echo strip_tags($model->property_name_or_address);
?>
</h4>
                            <div style="float:left; width: 400px;">
                                    <ul class="list-2">
                                        <li class="first"><?php 
echo Listing::getViewDetailPropertyType($model);
?>
</li>
                                        <li><?php 
echo $model->display_title != '' ? $model->display_title : $model->property_name_or_address;
?>
 </li>
                                        <li>Marketed by <?php 
if (isset($model->user->first_name)) {
    echo $model->user->first_name;
}
?>
                                            <?php 
if (isset($model->user->phone)) {
    echo "- Call : " . $model->user->phone;
}
Ejemplo n.º 2
0
<?php

$HeadTitle = 'Immediate Listing';
if (isset($_GET['company_listing_type'])) {
    $current_company_listing_type = $_GET['company_listing_type'];
    if ($current_company_listing_type == Listing::COMPANY_FOLLOW_UP) {
        $HeadTitle = 'Follow Up Listing';
    }
}
$this->breadcrumbs = array('Company Listing Management' => array('index'), $model->property_name_or_address);
$menus = array(array('label' => 'Company Listing Management', 'url' => array('index')), array('label' => 'Update ', 'url' => array('update', 'id' => $model->id)));
$this->menu = ControllerActionsName::createMenusRoles($menus, $actions);
?>

<h1>View <?php 
echo "{$HeadTitle}: " . $model->property_name_or_address;
?>
</h1>

<?php 
$this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array('property_name_or_address', 'display_title', 'display_address', 'postal_code', array('name' => 'location_id', 'label' => 'District – location', 'type' => 'ListingDistrict', 'value' => $model), array('name' => 'property_type_1', 'value' => Listing::getViewDetailPropertyType($model)), array('name' => 'unit_from', 'value' => $model->unit_from . " - {$model->unit_to}"), array('name' => 'house_blk_no'), array('name' => 'building_name'), array('name' => 'listing_type', 'type' => 'PropertyType'), array('name' => 'company_owner_name'), array('name' => 'contact_name_no'), array('name' => 'company_email'), array('name' => 'dnc_expiry_date', 'type' => 'CompanyDncExpiryDate', 'value' => $model), array('name' => 'remark', 'type' => 'html'), array('name' => 'floor_area', 'type' => 'Price'), array('name' => 'of_bedroom', 'type' => 'Price'), array('name' => 'company_storey'), array('name' => 'company_utility_room'), array('name' => 'price', 'type' => 'Price'), array('name' => 'company_built_up'), array('name' => 'tenure'), array('name' => 'company_availability'), array('name' => 'user_id', 'type' => 'NameForAll', 'value' => $model->rUser ? $model->rUser : ''), array('name' => 'last_update_time', 'type' => 'date'), array('name' => 'company_listing_status', 'type' => 'ListingCompanyStatus', 'value' => $model))));
Ejemplo n.º 3
0
 /**
  * @Author: ANH DUNG Jan 16, 2015
  * @Todo: replace some info of Listring
  * @Param: $mCms model page
  * @Param: $mListing model listing
  */
 public static function ReplaceContentCmsPage(&$mCms, $mListing)
 {
     $mCms->content = str_replace("{property_type}", Listing::getViewDetailPropertyType($mListing), $mCms->content);
     $mCms->content = str_replace("{property_name}", $mListing->property_name_or_address, $mCms->content);
     $mCms->content = str_replace("{property_full_address}", self::GetFullAddress($mListing), $mCms->content);
 }
Ejemplo n.º 4
0
 public static function ListingCompany()
 {
     Yii::import('application.extensions.vendors.PHPExcel', true);
     $objPHPExcel = new PHPExcel();
     // Set properties
     $objPHPExcel->getProperties()->setCreator("ANHDUNG")->setLastModifiedBy("ANHDUNG")->setTitle('Company Listing')->setSubject("Office 2007 XLSX Document")->setDescription("Company Listing")->setKeywords("office 2007 openxml php")->setCategory("Company Listing");
     $row = 1;
     $i = 1;
     $dataAll = $_SESSION['data-excel']->data;
     $company_listing_type = $_SESSION['data_excel_company_listing_type'];
     $HeadTitle = 'Immediate Listing';
     if ($company_listing_type == Listing::COMPANY_FOLLOW_UP) {
         $HeadTitle = 'Follow Up Listing';
     }
     $cmsFormatter = new CmsFormatter();
     // 1.sheet 1
     $objPHPExcel->setActiveSheetIndex(0);
     $objPHPExcel->getActiveSheet()->getDefaultStyle()->getFont()->setName('Times New Roman');
     $objPHPExcel->getActiveSheet()->getDefaultStyle()->getFont()->setSize(12);
     $objPHPExcel->getActiveSheet()->setTitle('Company ' . $HeadTitle);
     //            $objPHPExcel->getActiveSheet()->setCellValue("A$row", 'Client List');
     //            $objPHPExcel->getActiveSheet()->getStyle("A$row")->getFont()
     //                                ->setBold(true);
     //            $objPHPExcel->getActiveSheet()->mergeCells("A$row:H$row");
     //            $row++;
     $index = 1;
     $beginBorder = $row;
     $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", 'SN');
     $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", 'Property Name Or Address');
     $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", 'Postal Code');
     $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", 'District – location	');
     $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", 'Property Type');
     $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", 'Unit #');
     $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", 'House/Blk No');
     $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", 'Building Name');
     $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", 'Listing Type');
     $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", 'Owner Name');
     $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", 'Contact No');
     $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", 'Email');
     $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", 'Dnc Expiry Date');
     $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", 'Floor Area');
     $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", '# Of Bedrooms');
     $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", 'Storey');
     $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", 'Utility Room');
     $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", 'Price (S$)');
     $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", 'Built Up');
     $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", 'Tenure');
     $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", 'Availability');
     $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", 'Created By');
     $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", 'Last Modified Date');
     $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", 'Remark');
     $index--;
     $objPHPExcel->getActiveSheet()->getStyle("A{$row}:" . MyFormat::columnName($index) . $row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
     $objPHPExcel->getActiveSheet()->getStyle("A{$row}:" . MyFormat::columnName($index) . $row)->getFont()->setBold(true);
     $row++;
     foreach ($dataAll as $data) {
         $index = 1;
         $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", $i);
         $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", $data->property_name_or_address);
         $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", $data->postal_code);
         $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", $cmsFormatter->formatListingDistrict($data));
         $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", Listing::getViewDetailPropertyType($data));
         $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", $data->unit_from . " - {$data->unit_to}");
         $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", $data->house_blk_no);
         $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", $data->building_name);
         $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", $cmsFormatter->formatPropertyType($data->listing_type));
         $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", $data->company_owner_name);
         $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", $data->contact_name_no);
         $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", $data->company_email);
         $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", $cmsFormatter->formatDate($data->dnc_expiry_date));
         $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", $cmsFormatter->formatPrice($data->floor_area));
         $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", $cmsFormatter->formatPrice($data->of_bedroom));
         $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", $data->company_storey);
         $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", $data->company_utility_room);
         $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", $cmsFormatter->formatPrice($data->price));
         $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", $data->company_built_up);
         $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", $data->tenure);
         $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", $data->company_availability);
         $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", $cmsFormatter->formatNameForAll($data->rUser));
         $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", $cmsFormatter->formatDate($data->last_update_time));
         $objPHPExcel->getActiveSheet()->setCellValue(MyFormat::columnName($index++) . "{$row}", $data->remark);
         $row++;
         $i++;
     }
     // end body
     $objPHPExcel->getActiveSheet()->getStyle("B{$beginBorder}:" . MyFormat::columnName($index) . $row)->getAlignment()->setWrapText(true);
     $objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(25);
     $objPHPExcel->getActiveSheet()->getColumnDimension('C')->setWidth(10);
     $objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(30);
     $objPHPExcel->getActiveSheet()->getColumnDimension('E')->setWidth(20);
     $objPHPExcel->getActiveSheet()->getColumnDimension('F')->setWidth(10);
     $objPHPExcel->getActiveSheet()->getColumnDimension('G')->setWidth(15);
     $objPHPExcel->getActiveSheet()->getColumnDimension('H')->setWidth(20);
     $objPHPExcel->getActiveSheet()->getColumnDimension('I')->setWidth(10);
     $objPHPExcel->getActiveSheet()->getColumnDimension('J')->setWidth(20);
     $objPHPExcel->getActiveSheet()->getColumnDimension('K')->setWidth(20);
     $objPHPExcel->getActiveSheet()->getColumnDimension('L')->setWidth(20);
     $objPHPExcel->getActiveSheet()->getColumnDimension('M')->setWidth(20);
     $objPHPExcel->getActiveSheet()->getColumnDimension('N')->setWidth(20);
     $objPHPExcel->getActiveSheet()->getColumnDimension('O')->setWidth(15);
     $objPHPExcel->getActiveSheet()->getColumnDimension('P')->setWidth(20);
     $objPHPExcel->getActiveSheet()->getColumnDimension('Q')->setWidth(20);
     $objPHPExcel->getActiveSheet()->getColumnDimension('R')->setWidth(20);
     $objPHPExcel->getActiveSheet()->getColumnDimension('S')->setWidth(20);
     $objPHPExcel->getActiveSheet()->getColumnDimension('T')->setWidth(20);
     $objPHPExcel->getActiveSheet()->getColumnDimension('U')->setWidth(20);
     $objPHPExcel->getActiveSheet()->getColumnDimension('V')->setWidth(20);
     $objPHPExcel->getActiveSheet()->getColumnDimension('W')->setWidth(20);
     $objPHPExcel->getActiveSheet()->getColumnDimension('X')->setWidth(20);
     $row--;
     $index--;
     $objPHPExcel->getActiveSheet()->getStyle("A{$beginBorder}:A" . $row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
     $objPHPExcel->getActiveSheet()->getStyle("H{$beginBorder}:H" . $row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
     $objPHPExcel->getActiveSheet()->getStyle("J{$beginBorder}:J" . $row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
     $objPHPExcel->getActiveSheet()->getStyle("A{$beginBorder}" . ':' . MyFormat::columnName($index) . $row)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
     $objPHPExcel->getActiveSheet()->getStyle("A{$beginBorder}:" . MyFormat::columnName($index) . $row)->getBorders()->getAllBorders()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
     //save file
     $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
     for ($level = ob_get_level(); $level > 0; --$level) {
         @ob_end_clean();
     }
     header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
     header('Pragma: public');
     header('Content-type: ' . 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
     header('Content-Disposition: attachment; filename="' . 'Company ' . $HeadTitle . '.' . 'xlsx' . '"');
     header('Cache-Control: max-age=0');
     $objWriter->save('php://output');
     Yii::app()->end();
 }