예제 #1
0
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Pescaterceros();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Pescaterceros'])) {
         $model->attributes = $_POST['Pescaterceros'];
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->id));
         }
     }
     $this->render('create', array('model' => $model));
 }
예제 #2
0
 public function actionPlantascrea($fecha, $codplanta, $desplanta)
 {
     //$model=new Pescaterceros('search');
     $model = new Pescaterceros();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Pescaterceros'])) {
         $model->attributes = $_POST['Pescaterceros'];
         if ($model->save()) {
             if (!empty($_GET['asDialog'])) {
                 //Close the dialog, reset the iframe and update the grid
                 echo CHtml::script("window.parent.\$('#cru-dialog').dialog('close');\n\t\t\t\t\t\t\t\t\t\t\t\t\t                    window.parent.\$('#cru-frame').attr('src','');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twindow.parent.\$.fn.yiiGridView.update('{$_GET['gridId']}');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t");
                 Yii::app()->end();
             }
         } else {
             throw new CHttpException(404, 'No se pudo Grabar');
         }
     }
     //----- begin new code --------------------
     if (!empty($_GET['asDialog'])) {
         $this->layout = '//layouts/iframe';
     }
     $this->render("vw_pescaterceros", array('model' => $model, 'fecha' => $fecha, 'desplanta' => $desplanta, 'codplanta' => $codplanta));
 }