Esempio n. 1
0
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Alconversiones();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Alconversiones'])) {
         $model->attributes = $_POST['Alconversiones'];
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->id));
         }
     }
     $this->render('create', array('model' => $model));
 }
 public function actionCreaconversion($codigox)
 {
     $model = new Alconversiones();
     $modelomaestro = $this->loadModel($codigox);
     if (isset($_POST['Alconversiones'])) {
         $model->attributes = $_POST['Alconversiones'];
         if ($model->save()) {
             if (!empty($_GET['asDialog'])) {
                 //Close the dialog, reset the iframe and update the grid
                 echo CHtml::script("window.parent.\$('#cru-dialogdetalle').dialog('close');\n\t\t\t\t\t\t\t\t\t\t\t\t\t                    window.parent.\$('#cru-detalle').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('conversiones-grid');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t");
                 Yii::app()->end();
             }
         }
     }
     // if (!empty($_GET['asDialog']))
     $this->layout = '//layouts/iframe';
     $this->render('_form_detalle_conversiones', array('modelomaestro' => $modelomaestro, 'model' => $model, 'codigox' => $codigox));
 }