public function actionIndexUnPost($acc = null)
 {
     $model = new uJournal('search');
     $model->unsetAttributes();
     // clear any default values
     $criteria = new CDbCriteria();
     $criteria1 = new CDbCriteria();
     $criteria->condition = 'state_id =4 or state_id = 3';
     $criteria->order = 't.updated_date DESC';
     //last updated
     //$criteria->compare('journal_type_id',4);
     if (isset($_GET['uJournal'])) {
         $model->attributes = $_GET['uJournal'];
         $criteria1->compare('system_ref', $_GET['uJournal']['system_ref'], true, 'OR');
         $criteria1->compare('remark', $_GET['uJournal']['system_ref'], true, 'OR');
     }
     if (isset($_GET['acc'])) {
         $criteria->with = array('journalDetail');
         $criteria->group = 't.id, module_id, input_date, yearmonth_periode, system_ref, state_id';
         $criteria->join = 'INNER JOIN u_journal_detail tt ON t.id = tt.parent_id';
         $criteria->compare('tt.account_no_id', $_GET['acc']);
     }
     $criteria->limit = 20;
     $criteria->mergeWith($criteria1);
     $dataProvider = new CActiveDataProvider('uJournal', array('criteria' => $criteria, 'pagination' => array('pageSize' => 20)));
     $this->render('indexUnpost', array('dataProvider' => $dataProvider, 'model' => $model));
 }
 public function actionIndex($pid = 0)
 {
     $model = new uJournal();
     $model->unsetAttributes();
     $criteria = new CDbCriteria();
     $criteria1 = new CDbCriteria();
     $criteria->compare('module_id', 2);
     $criteria->order = 't.yearmonth_periode DESC, t.created_date DESC';
     //$criteria->compare('yearmonth_periode',Yii::app()->settings->get("System", "cCurrentPeriod"));
     if ($pid != 0) {
         $criteria->compare('journalDetail.account_no_id', $pid);
     }
     if (isset($_GET['uJournal'])) {
         $model->attributes = $_GET['uJournal'];
         $criteria1->compare('system_ref', $_GET['uJournal']['system_ref'], true, 'OR');
         $criteria1->compare('remark', $_GET['uJournal']['system_ref'], true, 'OR');
     }
     if (Yii::app()->user->name != "admin") {
         $criteria->AddInCondition('entity_id', sUser::model()->getGroupArray());
     }
     $criteria->mergeWith($criteria1);
     $rawData = uJournal::model()->with('journalDetail')->findAll($criteria);
     $dataProvider = new CArrayDataProvider($rawData, array('pagination' => array('pageSize' => 20)));
     $this->render('index', array('dataProvider' => $dataProvider, 'model' => $model));
 }
 public function actionIndex()
 {
     $model = new uJournal('search');
     $model->unsetAttributes();
     $criteria = new CDbCriteria();
     $criteria1 = new CDbCriteria();
     $criteria->compare('module_id', 1);
     //Journal Umum
     $criteria->order = 't.yearmonth_periode DESC, t.created_date DESC';
     $criteria->compare('yearmonth_periode', Yii::app()->settings->get("System", "cCurrentPeriod"));
     if (isset($_GET['uJournal'])) {
         $model->attributes = $_GET['uJournal'];
         $criteria1->compare('system_ref', $_GET['uJournal']['system_ref'], true, 'OR');
         $criteria1->compare('remark', $_GET['uJournal']['system_ref'], true, 'OR');
     }
     $criteria->mergeWith($criteria1);
     $total = uJournal::model()->count($criteria);
     $pages = new CPagination($total);
     $pages->pageSize = 20;
     $pages->applyLimit($criteria);
     $dataProvider = uJournal::model()->findAll($criteria);
     if (isset($_POST['uJournal'])) {
         $this->renderPartial('_z', array('dataProvider' => $dataProvider, 'model' => $model, 'pages' => $pages));
     } else {
         $this->render('index', array('dataProvider' => $dataProvider, 'model' => $model, 'pages' => $pages));
     }
 }
 public function actionIndex()
 {
     $model = new uJournal('search');
     $model->unsetAttributes();
     $criteria = new CDbCriteria();
     $criteria1 = new CDbCriteria();
     $criteria->compare('module_id', 1);
     //Journal Umum
     $criteria->order = 't.yearmonth_periode DESC, t.created_date DESC';
     $criteria->compare('yearmonth_periode', Yii::app()->settings->get("System", "cCurrentPeriod"));
     if (isset($_GET['uJournal'])) {
         $model->attributes = $_GET['uJournal'];
         $criteria1->compare('system_ref', $_GET['uJournal']['system_ref'], true, 'OR');
         $criteria1->compare('remark', $_GET['uJournal']['system_ref'], true, 'OR');
     }
     $criteria->mergeWith($criteria1);
     $dataProvider = new CActiveDataProvider('uJournal', array('criteria' => $criteria));
     $this->render('index', array('dataProvider' => $dataProvider, 'model' => $model));
 }