示例#1
0
 public function actionCreadetalle($id)
 {
     $id = (int) MiFactoria::cleanInput($id);
     $modelopadre = $this->loadModel($id);
     // $descuento=(is_null($modelopadre->descuento))?1:(1-$modelopadre->descuento/100);
     $model = new Opcionescamposdocu();
     //$model->estadodetalle=ESTADO_PREVIO;
     // $model->idusertemp=Yii::app()->user->id;
     // $model->valorespordefecto($this->documentohijo);
     if (isset($_POST['Opcionescamposdocu'])) {
         $model->attributes = $_POST['Opcionescamposdocu'];
         $model->codocu = $modelopadre->coddocu;
         ///detalle guia
         if ($model->save()) {
             if (!empty($_GET['asDialog'])) {
                 //Close the dialog, reset the iframe and update the grid
                 echo CHtml::script("window.parent.\$('#cru-dialog3').dialog('close');\n\t\t\t\t\t\t\t\t\t\t\t\t\t                    window.parent.\$('#cru-frame3').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('detalle-grid');\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t");
             }
         } else {
             print_r($model->geterrors());
         }
         Yii::app()->end();
     }
     // if (!empty($_GET['asDialog']))
     $this->layout = '//layouts/iframe';
     $this->render('//opcionescamposdocu/_form', array('model' => $model));
 }