Exemple #1
0
$this->breadcrumbs = array('Tenancies Approved');
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$.fn.yiiGridView.update('pro-transactions-grid', {\n                url : \$(this).attr('action'),\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
Yii::app()->clientScript->registerScript('ajaxupdate', "\n\$('#pro-transactions-grid a.ajaxupdate').live('click', function() {\n    \$.fn.yiiGridView.update('pro-transactions-grid', {\n        type: 'POST',\n        url: \$(this).attr('href'),\n        success: function() {\n            \$.fn.yiiGridView.update('pro-transactions-grid');\n        }\n    });\n    return false;\n});\n");
//MyFormat::isAllowAccess("callsLog", "index")
//if(MyFormat::isAllowAccess('callsLog', 'index'))
//    echo 'sssssssss';
?>

<h1><?php 
echo Yii::t('translation', 'Tenancies Approved');
?>
</h1>

<?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'users-model-grid', 'dataProvider' => $model->getBEListTenancies(), 'filter' => $model, 'enableSorting' => false, 'afterAjaxUpdate' => 'function(id, data){ fixTargetBlank(); fnUpdateLink(); }', 'columns' => array(array('header' => 'Property name', 'name' => 'sPropertyName', 'type' => 'propertyname', 'value' => 'array("name"=>$data->listing?$data->listing->property_name_or_address:"", "transaction_id"=>$data->id,"orther"=>isset($data->listing) ? $data->listing->property_house_blk_no:"","title_full"=>$data )', 'htmlOptions' => array('class' => 'w-250 ', 'style' => '')), array('name' => 'tenancy_agreement_date', 'type' => 'longDate', 'value' => '$data->tenancy_agreement_date', 'htmlOptions' => array('class' => 'w-150 item_c', 'style' => ''), 'filterHtmlOptions' => array('class' => 'ad_w1 ad_datepicker', 'style' => '')), array('name' => 'commencement_date', 'type' => 'longDate', 'value' => '$data->commencement_date', 'htmlOptions' => array('class' => 'w-150 item_c', 'style' => ''), 'filterHtmlOptions' => array('class' => 'ad_w1 ad_datepicker', 'style' => '')), array('name' => 'expiring_date', 'type' => 'expiredDate', 'value' => '$data->expiring_date', 'htmlOptions' => array('class' => 'w-150 item_c', 'style' => ''), 'filterHtmlOptions' => array('class' => 'ad_w1 ad_datepicker', 'style' => '')), array('header' => 'Tenancy Amount', 'name' => 'tenancy_amount', 'type' => 'price', 'value' => '$data->tenancy_amount', 'htmlOptions' => array('class' => 'w-80 item_r', 'style' => ''), 'filterHtmlOptions' => array('class' => 'ad_w1', 'style' => '')), array('header' => 'Deposit Payable', 'name' => 'deposit_payable', 'type' => 'price', 'value' => '$data->deposit_payable', 'htmlOptions' => array('class' => 'w-80 item_r', 'style' => ''), 'filterHtmlOptions' => array('class' => 'ad_w1', 'style' => '')), array('header' => 'Tenancy Period', 'name' => 'months_rent', 'value' => '$data->months_rent != NULL ? $data->months_rent." months":""', 'htmlOptions' => array('class' => 'w-80 item_c', 'style' => ''), 'filterHtmlOptions' => array('class' => 'ad_w1', 'style' => '')), array('header' => 'Calls Log', 'type' => 'LinkCallsLog', 'value' => '$data', 'htmlOptions' => array('style' => 'text-align:center;'), 'visible' => MyFormat::isAllowAccess("callsLog", "index")), array('header' => 'Report Defect(s)', 'type' => 'LinkReportDefect', 'value' => '$data', 'htmlOptions' => array('style' => 'text-align:center;'), 'visible' => MyFormat::isAllowAccess("reportDefect", "index")), array('header' => 'Inventory Photo', 'type' => 'LinkInventoryPhoto', 'value' => '$data', 'htmlOptions' => array('style' => 'text-align:center;'), 'visible' => MyFormat::isAllowAccess("tenancy", "inventoryPhoto")), array('header' => 'Aircon Services', 'type' => 'LinkAirconServices', 'value' => '$data', 'htmlOptions' => array('style' => 'text-align:center;'), 'visible' => MyFormat::isAllowAccess("airconService", "index")), array('header' => 'Actions', 'class' => 'CButtonColumn', 'template' => ControllerActionsName::createIndexButtonRoles($actions), 'buttons' => array('update' => array('label' => 'Update tenancy', 'url' => 'ProTransactions::GetLinkUpdateTenancyBE($data, array("update_tenancy_approved"=>1))', 'visible' => 'ProTransactions::CanUpdateTenancyApproved($data)'))))));
Yii::app()->clientScript->registerCoreScript('jquery.ui');
?>


<script type="text/javascript" src="<?php 
echo Yii::app()->theme->baseUrl;
?>
/admin/colorbox/jquery.colorbox-min.js"></script>    
<link rel="stylesheet" href="<?php 
echo Yii::app()->theme->baseUrl;
?>
/admin/css/colorbox.css" />
<script>
    $(function(){
        fnUpdateLink();