예제 #1
0
 /**
  * Manages all models.
  */
 public function actionProve()
 {
     $model = new Inventario('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Inventario'])) {
         $model->attributes = $_GET['Inventario'];
     }
     if ($this->isExportRequest()) {
         //<==== [[ADD THIS BLOCK BEFORE RENDER]]
         //set_time_limit(0); //Uncomment to export lage datasets
         //Add to the csv a single line of text
         //   $this->exportCSV(array('POSTS WITH FILTER:'), null, false);
         //Add to the csv a single model data with 3 empty rows after the data
         //  $this->exportCSV($model, array_keys($model->attributeLabels()), false, 3);
         //Add to the csv a lot of models from a CDataProvider
         $this->exportCSV($model->searchprove(), array('idinventario', 'codigo', 'descripcion', 'marca', 'modelo', 'serie', 'codestado', 'estado.estado', 'codigosap', 'codigoaf', 'fecha', 'codlugar', 'codigopadre', 'numerodocumento', 'rocoto', 'codep', 'codeporiginal', 'codepanterior', 'lugares.deslugar', 'barcoactual.nomep', 'barcoanterior.nomep', 'barcooriginal.nomep'));
     } else {
         $this->render('adminprove', array('model' => $model));
         /*echo "no pasa nada ";
         		Yii::app()->end();*/
     }
 }