示例#1
0
 static function is_periode_anggaran_exist($bulan, $tahun)
 {
     $criteria = new CDbCriteria();
     $criteria->addCondition("periode_bulan =" . $bulan);
     $criteria->addCondition("periode_tahun =" . $tahun);
     $result = PahAnggaran::model()->count($criteria);
     return $result > 0;
 }
示例#2
0
?>

    <div class="span-8 last">
        <?php 
echo $form->label($model, 'id');
?>
        <?php 
echo $form->textField($model, 'id');
?>
    </div>
    <div class="span-8 last">
        <?php 
echo $form->label($model, 'pah_anggaran_id');
?>
        <?php 
echo $form->dropDownList($model, 'pah_anggaran_id', GxHtml::listDataEx(PahAnggaran::model()->findAllAttributes(null, true)), array('prompt' => Yii::t('app', 'All')));
?>
    </div>
    <div class="span-8 last">
        <?php 
echo $form->label($model, 'amount');
?>
        <?php 
echo $form->textField($model, 'amount');
?>
    </div>
    <div class="span-8 last">
        <?php 
echo $form->label($model, 'pah_chart_master_account_code');
?>
        <?php 
 public function actionIndex()
 {
     if (isset($_POST['limit'])) {
         $limit = $_POST['limit'];
     } else {
         $limit = 20;
     }
     if (isset($_POST['start'])) {
         $start = $_POST['start'];
     } else {
         $start = 0;
     }
     $param = array();
     $criteria = new CDbCriteria();
     if (isset($_POST['doc_ref'])) {
         $criteria->addCondition("doc_ref like :doc_ref");
         $param[':doc_ref'] = "%" . $_POST['doc_ref'] . "%";
     }
     if (isset($_POST['periode_bulan'])) {
         $criteria->addCondition("periode_bulan = :periode_bulan");
         $param[':periode_bulan'] = $_POST['periode_bulan'];
     }
     if (isset($_POST['periode_tahun'])) {
         $criteria->addCondition("periode_tahun = :periode_tahun");
         $param[':periode_tahun'] = $_POST['periode_tahun'];
     }
     if (isset($_POST['trans_date'])) {
         $criteria->addCondition("trans_date = :trans_date");
         $param[':trans_date'] = substr($_POST['trans_date'], 0, 10);
     }
     $criteria->params = $param;
     $criteria->limit = $limit;
     $criteria->offset = $start;
     $model = PahAnggaran::model()->findAll($criteria);
     $total = PahAnggaran::model()->count($criteria);
     $this->renderJson($model, $total);
 }
示例#4
0
<?php

$this->breadcrumbs = array('Pah Anggaran Detils' => array('index'), Yii::t('app', 'Manage'));
$this->menu = array(array('label' => Yii::t('app', 'List') . ' PahAnggaranDetil', 'url' => array('index')), array('label' => Yii::t('app', 'Create') . ' PahAnggaranDetil', '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-anggaran-detil-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>

<h1><?php 
echo Yii::t('app', 'Manage');
?>
 Pah Anggaran Detils</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-anggaran-detil-grid', 'dataProvider' => $model->search(), 'itemsCssClass' => 'table', 'filter' => $model, 'columns' => array('id', array('name' => 'pah_anggaran_id', 'value' => 'GxHtml::valueEx($data->pahAnggaran)', 'filter' => GxHtml::listDataEx(PahAnggaran::model()->findAllAttributes(null, true))), 'amount', array('name' => 'pah_chart_master_account_code', 'value' => 'GxHtml::valueEx($data->pahChartMasterAccountCode)', 'filter' => GxHtml::listDataEx(PahChartMaster::model()->findAllAttributes(null, true))), array('class' => 'CButtonColumn'))));