<?php /* * ********************************************************************************* * The contents of this file are subject to the Mozilla Public License Version 2.0 * ("License"); You may not use this file except in compliance with the Mozilla Public License Version 2.0 * The Original Code is: Linet 3.0 Open Source * The Initial Developer of the Original Code is Adam Ben Hur. * All portions are Copyright (C) Adam Ben Hur. * All Rights Reserved. * ********************************************************************************** */ $model = new Docs('search'); $model->unsetAttributes(); if (isset($_GET['Docs'])) { $model->attributes = $_GET['Docs']; } //$var=CHtml::link(CHtml::encode($data->docnum),"#", array("onclick"=>'refNum('.CJSON::encode($data).')')); $this->widget('EExcelView', array('id' => 'docs-grid', 'dataProvider' => $model->search(), 'template' => '{items}{pager}', 'filter' => $model, 'columns' => array(array('name' => 'doctype', 'filter' => CHtml::listData(Doctype::model()->findAll(), 'id', 'name'), 'value' => '$data->getTypeName()', 'htmlOptions' => array('style' => 'width:35%;')), array('name' => 'docnum', 'value' => 'CHtml::link(CHtml::encode($data->docnum),"#", array("onclick"=>\'refNum(\'.CJSON::encode($data).\')\'));', 'type' => 'raw', 'htmlOptions' => array('style' => 'width:5%;')), 'company', array('name' => 'status', 'value' => '$data->getStatus()', 'htmlOptions' => array('style' => 'width:8%;')), array('name' => 'total', 'htmlOptions' => array('style' => 'width:8%;'))))); ?>
/** * Manages all models. */ public function actionAdmin() { $model = new Docs('search'); $model->unsetAttributes(); // clear any default values $vl = 'docs-grid'; if (isset($_POST['Docs'])) { $model->attributes = $_POST['Docs']; } if (Yii::app()->request->isAjaxRequest && isset($_POST['ajax']) && $_POST['ajax'] === $vl) { // Render partial file created in Step 1 $this->renderPartial('_list', array('model' => $model)); Yii::app()->end(); } $this->render('admin', array('model' => $model)); }