本文整理汇总了PHP中ControllerActionsName类的典型用法代码示例。如果您正苦于以下问题:PHP ControllerActionsName类的具体用法?PHP ControllerActionsName怎么用?PHP ControllerActionsName使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ControllerActionsName类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionCreate
/**
* Creates a new model.
* If creation is successful, the browser will be redirected to the 'view' page.
*/
public function actionCreate()
{
$model = new UsersActions('create');
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if (isset($_POST['UsersActions']) && isset($_POST['Username'])) {
$name = Helper::toRegularString($_POST['Username']);
$user = Users::model()->find("username like '{$name}'");
if ($user) {
//Check controller name, action name - PDQuang
if ($_POST['UsersActions']['module'] == null) {
$checkController = ControllerActionsName::checkControllerActionsExist($_POST['UsersActions']['controller'], $_POST['UsersActions']['actions']);
} else {
$checkController = ControllerActionsName::checkControllerActionsExist($_POST['UsersActions']['controller'], $_POST['UsersActions']['actions'], $_POST['UsersActions']['module']);
}
if (!$checkController) {
Yii::log('Controller, Module or Actions is wrong!');
throw new CHttpException('Controller, Module or Actions is wrong!');
}
$model->user_id = $user->id;
$model->attributes = $_POST['UsersActions'];
if ($model->save()) {
}
//$this->redirect(array('view','id'=>$model->id));
}
//
//
MyDebug::output($_POST);
MyDebug::output($name);
//
//
//
}
$this->render('create', array('model' => $model, 'actions' => $this->listActionsCanAccess));
}
示例2: actionGetactioncheckbox
public function actionGetactioncheckbox()
{
if (isset($_POST['controller']) && isset($_POST['module'])) {
$actions = ControllerActionsName::getActions($_POST['controller'], $_POST['module']);
if ($actions != null) {
$array_action = array_map('trim', explode(",", trim($actions)));
MyDebug::output($array_action);
}
}
}
示例3: actionGetactionsname
public function actionGetactionsname()
{
if (isset($_POST['controller'])) {
if (isset($_POST['module'])) {
if (ControllerActionsName::getActions($_POST['controller'], $_POST['module']) != null) {
echo ControllerActionsName::getActions($_POST['controller'], $_POST['module']);
} else {
return false;
}
} else {
if (ControllerActionsName::getActions($_POST['controller']) != null) {
echo ControllerActionsName::getActions($_POST['controller']);
} else {
return false;
}
}
}
}
示例4: array
<h1><?php
echo 'Voucher List of Transaction: ' . $mTrans->transactions_no;
?>
</h1>
<?php
// echo CHtml::link(Yii::t('translation','Advanced Search'),'#',array('class'=>'search-button'));
?>
<div class="search-form" style="display:none">
<?php
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->
<?php
$this->widget('zii.widgets.grid.CGridView', array('id' => 'pro-transactions-invoice-grid', 'dataProvider' => $model->search(), 'enableSorting' => false, 'afterAjaxUpdate' => 'function(id, data){ fixTargetBlank(); fnUpdateColorbox(); }', 'columns' => array(array('header' => 'S/N', 'type' => 'raw', 'value' => '$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)', 'headerHtmlOptions' => array('width' => '30px', 'style' => 'text-align:center;'), 'htmlOptions' => array('style' => 'text-align:center;')), array('name' => 'voucher_no', 'htmlOptions' => array('class' => '', 'style' => 'text-align:center;')), array('name' => 'voucher_pay_to', 'type' => 'FullNameRegisteredUsers', 'value' => '$data->rPayToUser', 'htmlOptions' => array('class' => '', 'style' => 'text-align:center;')), array('header' => 'Total Net Comm', 'name' => 'voucher_no', 'value' => 'ProTransactionsInvoice::calcTotalNetComm($data, $data->rTransaction)', 'type' => 'price', 'htmlOptions' => array('class' => '', 'style' => 'text-align:right;')), array('name' => 'receipt_date_paid', 'type' => 'date', 'htmlOptions' => array('class' => '', 'style' => 'text-align:center;')), array('name' => 'created_date', 'type' => 'date', 'htmlOptions' => array('class' => '', 'style' => 'text-align:center;')), array('header' => 'Actions', 'class' => 'CButtonColumn', 'template' => ControllerActionsName::createIndexButtonRoles($actions, array('view', 'delete')), 'buttons' => array('view' => array('label' => 'View ', 'url' => 'Yii::app()->createAbsoluteUrl("admin/transactions/viewInvoice",
array("id"=>$data->id, "transactionsVoucher"=>1))'))))));
?>
<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>
$(document).ready(function() {
示例5: array
$this->breadcrumbs = array('Account Payable Management');
/*
$menus=array(
array('label'=> Yii::t('translation','Create Vouchers'), 'url'=>array('createvoucher')),
);
$this->menu= ControllerActionsName::createMenusRoles($menus, $actions);*/
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('fi-invoice-grid', {\n url : \$(this).attr('action'),\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
Yii::app()->clientScript->registerScript('ajaxupdate', "\n\$('#fi-invoice-grid a.ajaxupdate').live('click', function() {\n \$.fn.yiiGridView.update('fi-invoice-grid', {\n type: 'POST',\n url: \$(this).attr('href'),\n success: function() {\n \$.fn.yiiGridView.update('fi-invoice-grid');\n }\n });\n return false;\n});\n");
?>
<?php
include '_tab_index.php';
?>
<h1 ><?php
echo Yii::t('translation', 'Account Payable Management');
?>
</h1>
<?php
echo CHtml::link(Yii::t('translation', 'Advanced Search'), '#', array('class' => 'search-button'));
?>
<div class="search-form" style="display:none">
<?php
$this->renderPartial('_search_voucher', array('model' => $model));
?>
</div><!-- search-form -->
<?php
$this->widget('zii.widgets.grid.CGridView', array('id' => 'fi-invoice-grid', 'dataProvider' => $model->search(), 'enableSorting' => false, 'columns' => array(array('header' => 'S/N', 'type' => 'raw', 'value' => '$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)', 'headerHtmlOptions' => array('width' => '30px', 'style' => 'text-align:center;'), 'htmlOptions' => array('style' => 'text-align:center;')), 'voucher_no', array('name' => 'pay_to', 'value' => 'FiPaymentVoucher::getStatus($data->pay_to)'), 'user_name', 'user_billing_address', 'user_postal_code', array('name' => 'total_amount', 'type' => 'Price', 'htmlOptions' => array('style' => 'text-align:right;')), array('header' => 'Print Voucher', 'type' => 'PrintPaymentVoucher', 'value' => '$data', 'htmlOptions' => array('style' => 'text-align:center;')), array('name' => 'created_date', 'header' => 'Created Date', 'type' => 'date'), array('name' => 'status', 'htmlOptions' => array('style' => 'text-align:center;'), 'value' => '($data->status==1) ? "Paid" : "Unpaid" '), array('header' => 'Actions', 'class' => 'CButtonColumn', 'template' => ControllerActionsName::createIndexButtonRoles($actions), 'buttons' => array('update' => array('url' => 'Yii::app()->createAbsoluteUrl("admin/fiInvoice/updatevoucher", array("id"=>$data->id))', 'visible' => 'FiPaymentVoucher::CanUpdate($data)'), 'view' => array('url' => 'Yii::app()->createAbsoluteUrl("admin/fiInvoice/viewvoucher", array("id"=>$data->id))'), 'delete' => array('url' => 'Yii::app()->createAbsoluteUrl("admin/fiInvoice/deletevoucher", array("id"=>$data->id))'))))));
示例6: array
<?php
$dataProvider = $model->SearchCompanyBE();
$this->widget('zii.widgets.grid.CGridView', array('id' => 'listing-company-grid', 'dataProvider' => $dataProvider, 'enableSorting' => true, 'afterAjaxUpdate' => 'function(id, data){ fnBindMoveTo();}', 'summaryText' => 'Show:' . MyFormat::GetDropDownPageSize('pageSize', $dataProvider->pagination->pageSize) . ' rows per page', 'columns' => array(array('class' => 'CCheckBoxColumn', 'selectableRows' => 2, 'id' => 'chk'), array('header' => 'S/N', 'type' => 'raw', 'value' => '$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)', 'headerHtmlOptions' => array('width' => '30px', 'style' => 'text-align:center;'), 'htmlOptions' => array('style' => 'text-align:center;')), array('name' => 'listing_type', 'header' => 'Type', 'type' => 'PropertyType', 'headerHtmlOptions' => array('class' => 'first', 'style' => 'width:70px;')), array('name' => 'location_id', 'header' => 'District', 'value' => '"D".($data->location_id>9?$data->location_id:"0$data->location_id")'), array('name' => 'property_name_or_address', 'header' => 'Property Address'), array('name' => 'unit_from', 'value' => '$data->unit_from." - $data->unit_to"', 'htmlOptions' => array('style' => 'width: 50px;')), array('name' => 'floor_area', 'type' => 'Price', 'htmlOptions' => array('style' => 'text-align:right;')), array('name' => 'of_bedroom', 'htmlOptions' => array('style' => 'text-align:center;')), array('name' => 'price', 'type' => 'Price', 'htmlOptions' => array('style' => 'width: 80px;text-align:right;')), array('name' => 'company_owner_name'), array('name' => 'contact_name_no'), array('name' => 'company_email'), array('name' => 'company_availability'), array('name' => 'dnc_expiry_date', 'type' => 'CompanyDncExpiryDate', 'value' => '$data'), array('name' => 'user_id', 'type' => 'FullNameRegisteredUsers', 'value' => '$data->rUser?$data->rUser:null', 'htmlOptions' => array('style' => 'width: 100px;')), array('name' => 'owner_contact_click', 'type' => 'raw', 'value' => '$this->grid->widget("application.components.ListingClickWidget", array("listing"=>$data), true)', 'htmlOptions' => array('style' => 'width: 100px;')), array('name' => 'last_update_time', 'type' => 'date'), array('name' => 'company_listing_status', 'type' => 'ListingCompanyStatus', 'value' => '$data', 'htmlOptions' => array('style' => 'text-align:center;')), array('header' => 'Move To', 'class' => 'CButtonColumn', 'template' => '{move_to_that}', 'buttons' => array('move_to_that' => array('label' => "Move To {$MoveTo}", 'options' => array('class' => 'move_to_that ajaxupdate remove_target_blank'), 'url' => 'Yii::app()->createAbsoluteUrl("admin/ajax/companyListingMoveto",
array("id"=>$data->id, "company_listing_type"=>Listing::$COMPANY_TYPE_MOVE_REVERT[$data->company_listing_type] ))'))), array('header' => 'Actions', 'class' => 'CButtonColumn', 'template' => ControllerActionsName::createIndexButtonRoles($actions), 'buttons' => array('update' => array('visible' => 'Listing::CanUpdateCompanyListing($data)'), 'delete' => array('visible' => 'Listing::CanDeleteCompanyListing($data)'))))));
?>
<style>
.summary { float:right !important;}
.change-pageSize { padding:0; height:23px;}
</style>
<script>
$(function(){
fnBindMoveTo();
});
function fnBindMoveTo(){
$('.move_to_that').click(function(){
if(confirm('Are you sure to move this item?')){
return true;
}
return false;
});
$('.remove_target_blank').attr('target','');
$('.change-pageSize').change(function(){
var pageSize = $(this).val();
$('.change-pageSize').val(pageSize);
$('.submit_form_pri').find('button:submit').trigger('click');
});
示例7: array
<?php
$this->breadcrumbs = array('Layouts');
$menus = array(array('label' => 'Create Layouts', 'url' => array('create')));
$this->menu = ControllerActionsName::createMenusRoles($menus, $actions);
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('layouts-grid', {\n url : \$(this).attr('action'),\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
Yii::app()->clientScript->registerScript('ajaxupdate', "\n\$('#layouts-grid a.ajaxupdate').live('click', function() {\n \$.fn.yiiGridView.update('layouts-grid', {\n type: 'POST',\n url: \$(this).attr('href'),\n success: function() {\n \$.fn.yiiGridView.update('layouts-grid');\n }\n });\n return false;\n});\n");
?>
<h1>List Layouts</h1>
<?php
echo CHtml::link('Advanced Search', '#', array('class' => 'search-button'));
?>
<div class="search-form" style="display:none">
<?php
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->
<?php
$visible = ControllerActionsName::checkVisibleButton($actions);
$this->widget('zii.widgets.grid.CGridView', array('id' => 'layouts-grid', 'dataProvider' => $model->search(), 'columns' => array(array('header' => 'S/N', 'type' => 'raw', 'value' => '$row+1', 'headerHtmlOptions' => array('width' => '30px', 'style' => 'text-align:center;'), 'htmlOptions' => array('style' => 'text-align:center;')), array('name' => 'title', 'htmlOptions' => array('style' => 'text-align:center;')), array('name' => 'content', 'htmlOptions' => array('style' => 'text-align:center;')), array('header' => 'Display Order', 'name' => 'order', 'htmlOptions' => array('style' => 'text-align:center;')), array('header' => 'Status', 'name' => 'status', 'type' => 'status', 'htmlOptions' => array('style' => 'text-align:center;'), 'value' => 'array("status"=>$data->status,"id"=>$data->id)', 'visible' => $visible), array('class' => 'CButtonColumn', 'template' => ControllerActionsName::createIndexButtonRoles($actions)))));
示例8: array
</br>
<div class="form" style="padding-left: 0px;">
<div class="row">
<label class="required" for="UsersActions_user_id">Role: <span class="required">*</span></label>
<?php
echo CHtml::dropDownList('roles', 1, CHtml::listData(Roles::model()->findAll(), 'id', 'role_name'));
?>
<?php
//echo $form->error($model,'user_id');
?>
</div>
</div>
<?php
$this->widget('zii.widgets.grid.CGridView', array('id' => 'controllers-grid', 'dataProvider' => $model->search(), 'columns' => array(array('header' => 'S/N', 'type' => 'raw', 'value' => '$row+1', 'headerHtmlOptions' => array('width' => '30px', 'style' => 'text-align:center;'), 'htmlOptions' => array('style' => 'text-align:center;')), array('class' => 'CButtonColumn', 'template' => ControllerActionsName::createIndexButtonRoles($actions, array('update'))), 'controller_name', 'module_name', 'actions')));
?>
<div id="re"></div>
<script type="text/javascript">
$("select[name='roles']").change(rolesSession);
function rolesSession(){
var url = "<?php
echo Yii::app()->createAbsoluteUrl('admin/getactions/rolessession');
?>
";
var request = $.ajax({
type: "post",
示例9: array
<h1><?php
echo Yii::t('translation', 'Account Receivables Management');
?>
</h1>
<?php
echo CHtml::link(Yii::t('translation', 'Advanced Search'), '#', array('class' => 'search-button'));
?>
<div class="search-form" style="display:none">
<?php
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->
<?php
$this->widget('zii.widgets.grid.CGridView', array('id' => 'fi-invoice-grid', 'dataProvider' => $model->search(), 'enableSorting' => false, 'afterAjaxUpdate' => 'function(id, data){ fixTargetBlank(); fnUpdateLink(); }', 'columns' => array(array('header' => 'S/N', 'type' => 'raw', 'value' => '$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)', 'headerHtmlOptions' => array('width' => '30px', 'style' => 'text-align:center;'), 'htmlOptions' => array('style' => 'text-align:center;')), Yii::t('translation', 'invoice_no'), Yii::t('translation', 'transactions_no'), array('name' => 'total_amount_due', 'type' => 'Price', 'htmlOptions' => array('style' => 'text-align:right;')), array('name' => 'status', 'value' => 'FiInvoice::$STA_STATUS[$data->status]', 'htmlOptions' => array('style' => 'text-align:center;')), array('header' => 'Receipt', 'type' => 'InvoiceGenReceipt', 'value' => '$data', 'htmlOptions' => array('style' => 'text-align:center;')), array('header' => 'Actions', 'class' => 'CButtonColumn', 'template' => ControllerActionsName::createIndexButtonRoles($actions), 'buttons' => array('update' => array('visible' => 'FiInvoice::CanUpdate($data)'))))));
?>
<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();
});
示例10: CmsFormatter
$cmsFormater = new CmsFormatter();
$arrVal = array("name" => $mTrans->listing->property_name_or_address, "transaction_id" => $mTrans->id);
$sPropertyName = $cmsFormater->formatpropertyname($arrVal);
$tenancy_agreement_date = $cmsFormater->formatLongDate($mTrans->tenancy_agreement_date);
$expiring_date = $cmsFormater->formatLongDate($mTrans->expiring_date);
$titleH1 = $sPropertyName . " [ {$tenancy_agreement_date} - {$expiring_date} ] ";
?>
<h1>Calls Log: <?php
echo $titleH1;
?>
</h1>
<?php
$this->widget('zii.widgets.grid.CGridView', array('id' => 'pro-transactions-grid', 'dataProvider' => $model->search(), 'afterAjaxUpdate' => 'function(id, data){ fixTargetBlank(); fnUpdateColorbox(); }', 'columns' => array(array('header' => 'S/N', 'type' => 'raw', 'value' => '$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)', 'headerHtmlOptions' => array('width' => '30px', 'style' => 'text-align:center;'), 'htmlOptions' => array('style' => 'text-align:center;')), array('name' => 'date', 'type' => 'DateTimeTran', 'htmlOptions' => array('style' => 'text-align:center;'), 'headerHtmlOptions' => array('class' => 'first', 'style' => 'text-align:center;')), array('name' => 'received_by'), array('name' => 'description', 'type' => 'html', 'value' => 'MyFormat::replaceNewLineTextArea($data->description)'), array('name' => 'person_call_type', 'value' => 'isset(ProCallLog::$ARR_PERSON_CALL_TYPE[$data->person_call_type])?ProCallLog::$ARR_PERSON_CALL_TYPE[$data->person_call_type]:""', 'htmlOptions' => array('style' => 'text-align:center;', 'class' => 'w-100')), array('name' => 'person_called'), array('name' => 'phone'), array('header' => 'Actions', 'class' => 'CButtonColumn', 'template' => ControllerActionsName::createIndexButtonRoles($actions, array('update', 'delete')), 'buttons' => array('updateCallsLog' => array('label' => 'Update Call Log', 'imageUrl' => Yii::app()->theme->baseUrl . '/img/gridview/update.png', 'options' => array('class' => 'update update_item'), 'url' => 'Yii::app()->createAbsoluteUrl("admin/transactions/updateCallsLog",
array("id"=>$data->id))'), 'deleteCallsLog' => array('label' => 'Update Call Log', 'imageUrl' => Yii::app()->theme->baseUrl . '/img/gridview/delete.png', 'options' => array('class' => 'delete'), 'url' => 'Yii::app()->createAbsoluteUrl("admin/transactions/deleteCallsLog",
array("id"=>$data->id))'))))));
?>
<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>
示例11: actionEdit
public function actionEdit($id)
{
$model = $this->loadModel($id);
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if (isset($_POST['Controllers'])) {
//Check controller name, action name - PDQuang
if ($_POST['Controllers']['module_name'] == null) {
$checkController = ControllerActionsName::checkControllerActionsExist($_POST['Controllers']['controller_name'], $_POST['Controllers']['actions']);
} else {
$checkController = ControllerActionsName::checkControllerActionsExist($_POST['Controllers']['controller_name'], $_POST['Controllers']['actions'], $_POST['Controllers']['module_name']);
}
if (!$checkController) {
Yii::log('Controller, Module or Actions is wrong!');
throw new CHttpException('Controller, Module or Actions is wrong!');
}
$model->attributes = $_POST['Controllers'];
if ($model->save()) {
$this->redirect(array('view', 'id' => $model->id));
}
}
$this->render('edit', array('model' => $model, 'actions' => $this->listActionsCanAccess));
}
示例12: array
<?php
$this->breadcrumbs = array('Invoice Management' => array('index'), $model->invoice_no);
$menus = array(array('label' => 'Invoice Management', 'url' => array('index')), array('label' => 'Create Invoice', 'url' => array('create')), array('label' => 'Update Invoice', 'url' => array('update', 'id' => $model->id)), array('label' => 'Delete Invoice', '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);
$model->aModelDetail = $model->rDetail;
$cmsFormater = new CmsFormatter();
?>
<h1>View Invoice: <?php
echo $model->invoice_no;
?>
</h1>
<?php
$this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array('invoice_no', 'transactions_no', array('name' => 'bill_to', 'value' => FiInvoice::$STA_BILL_TO[$model->bill_to]), 'user_name', 'user_billing_address', 'user_postal_code', 'total_amount_due:Price', array('name' => 'status', 'value' => FiInvoice::$STA_STATUS[$model->status]), 'created_date:date')));
?>
<div class="row grid-view l_padding_100">
<label> </label>
<table class="materials_table items ">
<thead>
<tr>
<td colspan="3" class="item_c item_b">Details</td>
</tr>
<tr>
<th class="w-20 item_c">#</th>
<th class="w-500 item_c">Description</th>
<th class="w-200 item_c">Amount SG $</th>
</tr>
</thead>
示例13: array
$this->breadcrumbs = array('Tenancies New');
$menus = array(array('label' => Yii::t('translation', 'Create Tenancy'), 'url' => array('CreateTenancy', 'add_property' => 1)));
$this->menu = ControllerActionsName::createMenusRoles($menus, $actions);
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");
//if(MyFormat::isAllowAccess('transactions', 'viewInvoice'))
// echo 'sssssssss';
?>
<h1><?php
echo Yii::t('translation', 'Tenancies New');
?>
</h1>
<?php
$this->widget('zii.widgets.grid.CGridView', array('id' => 'pro-transactions-grid', 'dataProvider' => $model->getBEListTenanciesNew(), '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,"title_full"=>$data,"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' => 'Actions', 'class' => 'CButtonColumn', 'template' => ControllerActionsName::createIndexButtonRoles($actions, array('view', 'ApproveTenancy', 'delete')), 'buttons' => array('ApproveTenancy' => array('label' => 'Update status tenancy', 'imageUrl' => Yii::app()->theme->baseUrl . '/admin/images/icon-view.png', 'options' => array('class' => 'ApproveTenancy'), 'url' => 'Yii::app()->createAbsoluteUrl("admin/tenancy/approveTenancy",
array("id"=>$data->id))'), 'view' => array('url' => 'Yii::app()->createAbsoluteUrl("admin/tenancy/view",
array("id"=>$data->id, "next"=>"new"))'))))));
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>
示例14: array
<?php
$this->breadcrumbs = array('Manage Menu');
$menus = array(array('label' => 'Create Menu', 'url' => array('create')));
$this->menu = ControllerActionsName::createMenusRoles($menus, $actions);
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('menus-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>
<h1>Manage Menu</h1>
<?php
echo CHtml::link('Advanced Search', '#', array('class' => 'search-button'));
?>
<div class="search-form" style="display:none">
<?php
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->
<?php
$this->widget('zii.widgets.grid.CGridView', array('id' => 'menus-grid', 'dataProvider' => $model->search(), 'columns' => array(array('header' => 'S/N', 'type' => 'raw', 'value' => '$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)', 'headerHtmlOptions' => array('width' => '30px', 'style' => 'text-align:center;'), 'htmlOptions' => array('style' => 'text-align:center;')), array('class' => 'CButtonColumn', 'template' => ControllerActionsName::createIndexButtonRoles($actions)), array('name' => 'menu_name', 'filter' => ''), 'controller_name', array('name' => 'roles', 'type' => 'raw', 'value' => 'RolesMenus::getActionName($data->id)'), 'menu_link', array('name' => 'parent_id', 'header' => 'Parent menu', 'value' => '(!is_null(Menus::model()->findByPk($data->parent_id))?Menus::model()->findByPk($data->parent_id)->menu_name:"")', 'filter' => Menus::getDropDownList("Menus[parent_id]", "Menus_parent_id", 0, true), 'htmlOptions' => array('style' => 'text-align:center;')), array('name' => 'display_order', 'htmlOptions' => array('style' => 'text-align:center;')), array('name' => 'show_in_menu', 'value' => '(!empty($data->show_in_menu) && $data->show_in_menu==1) ? "Yes" : "No"', 'filter' => array('1' => 'Yes', '0' => 'No'), 'htmlOptions' => array('style' => 'text-align:center;')))));