示例#1
0
文件: admin.php 项目: sanjibpu/demo
<?php

/* @var $this UsersController */
/* @var $model Users */
$this->breadcrumbs = array('Users' => array('index'), 'Manage');
$this->menu = array(array('label' => 'Add User', 'url' => array('create')));
?>

<h1>Manage Users</h1>
<div class="search-form" style="display:none">

</div><!-- search-form -->
<?php 
$pageSize = Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']);
$this->widget('zii.widgets.grid.CGridView', array('id' => 'users-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array(array('header' => 'SL.No', 'value' => '$row+1'), 'name', 'username', 'email', array('name' => 'status', 'value' => 'Lookup::getStatus($data->status)', 'filter' => CHtml::activeDropDownList($model, 'status', UsefullFunction::typeStatus('Lookup', 'status'), array('empty' => 'All'))), array('class' => 'CButtonColumn', 'deleteConfirmation' => "js:'Do you really want to delete record with ID '+\$(this).parent().parent().children(':nth-child(2)').text()+'?'", 'header' => CHtml::dropDownList('pageSize', $pageSize, array(5 => 5, 10 => 10, 20 => 20, 30 => 30), array('onchange' => "\$.fn.yiiGridView.update('users-grid',{ data:{pageSize: \$(this).val() }})"))))));
示例#2
0
文件: admin.php 项目: sanjibpu/demo
/* @var $this SaleslistController */
/* @var $model Saleslist */
$this->breadcrumbs = array('Saleslists' => array('admin'), 'Manage');
$this->menu = array(array('label' => 'Create Saleslist', 'url' => array('create')), array('label' => 'Manage Saleslist', 'url' => array('admin')), array('label' => 'Import CSV', 'url' => array('csvImport')));
?>

<h1>Manage Saleslists</h1>

<div class="search-form" style="display:none">

</div><!-- search-form -->

<?php 
Yii::app()->clientScript->registerScript('re-install-date-picker', "function reinstallDatePicker(id, data)\n     {\n       \$('#date').datepicker({'dateFormat':'yy-mm-dd'});\n       \$('#dateSecond').datepicker({'dateFormat':'yy-mm-dd'});\n     \n     }");
$pageSize = Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']);
$this->widget('zii.widgets.grid.CGridView', array('id' => 'saleslist-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'afterAjaxUpdate' => 'reinstallDatePicker', 'columns' => array(array('header' => 'Sl.', 'value' => '$row+1'), 'customerName', 'productName', array('name' => 'date', 'type' => 'raw', 'value' => '$data->date', 'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => 'date', 'htmlOptions' => array('id' => 'date'), 'options' => array('dateFormat' => 'yy-mm-dd')), true)), array('name' => 'date', 'type' => 'raw', 'value' => '$data->date', 'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => 'dateSecond', 'htmlOptions' => array('id' => 'dateSecond'), 'options' => array('dateFormat' => 'yy-mm-dd')), true)), array('name' => 'status', 'value' => 'Lookup::getStatus($data->status)', 'filter' => CHtml::activeDropDownList($model, 'status', UsefullFunction::typeStatus('Lookup', 'status'), array('empty' => 'All'))), array('class' => 'CButtonColumn', 'template' => '{view}{update}{delete}', 'buttons' => array(), 'deleteButtonLabel' => 'Delete', 'deleteButtonOptions' => array('style' => 'width:50px;', 'class' => 'delete_class', 'id' => 'delete_id'), 'deleteConfirmation' => 'Are you sure?', 'updateButtonLabel' => 'Update', 'updateButtonOptions' => array('style' => 'width:50px;', 'class' => 'update_class', 'id' => 'update_id'), 'viewButtonLabel' => 'View', 'viewButtonOptions' => array('style' => 'width:50px;', 'class' => 'view_class', 'id' => 'view_id'), 'visible' => true, 'header' => 'String Header', 'headerHtmlOptions' => array('style' => 'color:red;'), 'header' => CHtml::dropDownList('pageSize', $pageSize, array(5 => 5, 10 => 10, 20 => 20, 30 => 30), array('onchange' => "\$.fn.yiiGridView.update('saleslist-grid',{ data:{pageSize: \$(this).val() }})"))))));
/*
 array(
	'class'=>'CButtonColumn',
	//template details
	'template'=>'{view}{update}{delete}',
	//button details
	'buttons'=>array(),
	//delete details
	//'afterDelete'=>'function(link,success,data){alert("success");}',
	'deleteButtonImageUrl'=>Yii::app()->baseUrl.'/image/delete.png',
	'deleteButtonLabel'=>'Delete',
	'deleteButtonOptions'=>array('style'=>'width:50px;','class'=>'delete_class','id'=>'delete_id',),
	'deleteConfirmation'=>'Are you sure?',            
	//update details
	'updateButtonImageUrl'=>Yii::app()->baseUrl.'/image/update.png',
示例#3
0
文件: _form.php 项目: sanjibpu/demo
echo $form->labelEx($model, 'typeId');
?>
        <?php 
echo $form->dropDownList($model, 'typeId', UsefullFunction::typeStatus('Lookup', 'userType'), array('class' => 'form-control'));
?>
        <?php 
echo $form->error($model, 'typeId');
?>
    </div>
    
    <div class="row">
        <?php 
echo $form->labelEx($model, 'status');
?>
        <?php 
echo $form->dropDownList($model, 'status', UsefullFunction::typeStatus('Lookup', 'status'), array('class' => 'form-control'));
?>
        <?php 
echo $form->error($model, 'status');
?>
    </div>

	<div class="row buttons">
		<?php 
echo CHtml::submitButton($model->isNewRecord ? 'Save' : 'Update');
?>
	</div>

<?php 
$this->endWidget();
?>