コード例 #1
0
ファイル: admin.php プロジェクト: saifulihsan/gkkd-jogja
<?php

$this->breadcrumbs = array('Pah Chart Masters' => array('index'), Yii::t('app', 'Manage'));
$this->menu = array(array('label' => Yii::t('app', 'List') . ' PahChartMaster', 'url' => array('index')), array('label' => Yii::t('app', 'Create') . ' PahChartMaster', 'url' => array('create')));
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('pah-chart-master-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>

<h1><?php 
echo Yii::t('app', 'Manage');
?>
 Pah Chart Masters</h1>

<p style="display:none">
    You may optionally enter a comparison operator (&lt;, &lt;=, &gt;, &gt;=, &lt;&gt; or =) at the beginning of each of
    your search values to specify how the comparison should be done.
</p>

<?php 
//echo GxHtml::link(Yii::t('app', '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' => 'pah-chart-master-grid', 'dataProvider' => $model->search(), 'itemsCssClass' => 'table', 'filter' => $model, 'columns' => array('account_code', 'account_code2', 'account_name', array('name' => 'account_type', 'value' => 'GxHtml::valueEx($data->accountType)', 'filter' => GxHtml::listDataEx(PahChartTypes::model()->findAllAttributes(null, true))), array('name' => 'inactive', 'value' => '($data->inactive === 0) ? Yii::t(\'app\', \'No\') : Yii::t(\'app\', \'Yes\')', 'filter' => array('0' => Yii::t('app', 'No'), '1' => Yii::t('app', 'Yes'))), 'description', array('class' => 'CButtonColumn'))));
コード例 #2
0
ファイル: _form.php プロジェクト: saifulihsan/gkkd-jogja
echo $form->labelEx($model, 'account_name');
?>
        <?php 
echo $form->textField($model, 'account_name', array('maxlength' => 60));
?>
        <?php 
echo $form->error($model, 'account_name');
?>
    </div>
    <!-- row -->
    <div class="span-8 last">
        <?php 
echo $form->labelEx($model, 'account_type');
?>
        <?php 
echo $form->dropDownList($model, 'account_type', GxHtml::listDataEx(PahChartTypes::model()->findAllAttributes(null, true)));
?>
        <?php 
echo $form->error($model, 'account_type');
?>
    </div>
    <!-- row -->
    <div class="span-8 last">
        <?php 
echo $form->labelEx($model, 'inactive');
?>
        <?php 
echo $form->checkBox($model, 'inactive');
?>
        <?php 
echo $form->error($model, 'inactive');
コード例 #3
0
ファイル: _search.php プロジェクト: saifulihsan/gkkd-jogja
?>
    </div>
    <div class="span-8 last">
        <?php 
echo $form->label($model, 'account_name');
?>
        <?php 
echo $form->textField($model, 'account_name', array('maxlength' => 60));
?>
    </div>
    <div class="span-8 last">
        <?php 
echo $form->label($model, 'account_type');
?>
        <?php 
echo $form->dropDownList($model, 'account_type', GxHtml::listDataEx(PahChartTypes::model()->findAllAttributes(null, true)), array('prompt' => Yii::t('app', 'All')));
?>
    </div>
    <div class="span-8 last">
        <?php 
echo $form->label($model, 'inactive');
?>
        <?php 
echo $form->dropDownList($model, 'inactive', array('0' => Yii::t('app', 'No'), '1' => Yii::t('app', 'Yes')), array('prompt' => Yii::t('app', 'All')));
?>
    </div>
    <div class="span-8 last">
        <?php 
echo $form->label($model, 'description');
?>
        <?php 
コード例 #4
0
 public function actionIndex()
 {
     if (isset($_POST['limit'])) {
         $limit = $_POST['limit'];
     } else {
         $limit = 20;
     }
     if (isset($_POST['start'])) {
         $start = $_POST['start'];
     } else {
         $start = 0;
     }
     //$model = new PahChartTypes('search');
     //$model->unsetAttributes();
     $criteria = new CDbCriteria();
     //        $criteria->limit = $limit;
     //        $criteria->offset = $start;
     $model = PahChartTypes::model()->findAll($criteria);
     $total = PahChartTypes::model()->count($criteria);
     if (isset($_GET['PahChartTypes'])) {
         $model->attributes = $_GET['PahChartTypes'];
     }
     if (isset($_GET['output']) && $_GET['output'] == 'json') {
         $this->renderJson($model, $total);
     } else {
         $model = new PahChartTypes('search');
         $model->unsetAttributes();
         $this->render('admin', array('model' => $model));
     }
 }