/**
  * Manages all models.
  */
 public function actionAdmin()
 {
     // page size drop down changed
     if (isset($_GET['pageSize'])) {
         Yii::app()->user->setState('pageSize', (int) $_GET['pageSize']);
         unset($_GET['pageSize']);
         // would interfere with pager and repetitive page size change
     }
     $model = new Allocate('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Allocate'])) {
         $model->attributes = $_GET['Allocate'];
     }
     if ($this->isExportRequest()) {
         $this->exportCSV($model->search(), array('consumable.name', 'date_in', 'date_out', 'return_on', 'user.name', 'stockname', 'purpose', 'comments'));
     }
     $this->render('admin', array('model' => $model));
 }