public function checkobjeto($attribute, $params) { $modeloprueba = ObjetosCliente::model()->find(" id=:identidad and codpro= :prove ", array(":identidad" => $this->idobjeto, ":prove" => $this->codpro)); if ($modeloprueba === NULL) { $this->adderror('idobjeto', 'Este objeto no pertenece al cliente'); } }
public function actionAgregarequipo($idcabeza) { $idcabeza = (int) $idcabeza; $modelocabeza = ObjetosCliente::model()->findbypk($idcabeza); if (is_null($modelocabeza)) { throw new CHttpException(500, 'No existe este objeto con este ID'); } $model = new Objetosmaster(); $model->hidobjeto = $modelocabeza->id; if (isset($_POST['Objetosmaster'])) { $model->attributes = $_POST['Objetosmaster']; if ($model->save()) { //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-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('detalle-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('_formmaster', array('model' => $model, 'idcabeza' => $idcabeza)); }
public function actionActualizaobjeto($id) { $model = ObjetosCliente::model()->findByPk($id); // Uncomment the following line if AJAX validation is needed $this->performAjaxValidation($model); if (isset($_POST['ObjetosCliente'])) { $model->attributes = $_POST['ObjetosCliente']; if ($model->save()) { if (!empty($_GET['asDialog'])) { //Close the dialog, reset the iframe and update the grid echo CHtml::script("window.parent.\$('#cru-dialog5').dialog('close');window.parent.\$('#cru-frame5').attr('src','');window.parent.\$.fn.yiiGridView.update('{$_GET['gridId']}');"); Yii::app()->end(); } } } if (!empty($_GET['asDialog'])) { $this->layout = '//layouts/iframe'; } $this->render('_form_objetos', array('model' => $model, 'codpro' => $_GET['codpro'])); }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return ObjetosCliente the loaded model * @throws CHttpException */ public function loadModel($id) { $model = ObjetosCliente::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
echo CHtml::link($model->peticion_solpe->numero, array('solpe/update', 'id' => $model->peticion_solpe->id)); ?> </div> <div class="row"> <?php if (!$model->isnewRecord) { ?> <?php echo $form->labelEx($model, 'codobjeto'); ?> <?php $criterio = new CDbCriteria(); $criterio->addcondition("codpro='" . $model->codpro . "'"); $datos1 = CHtml::listData(ObjetosCliente::model()->findAll($criterio), 'codobjeto', 'nombreobjeto'); echo $form->DropDownList($model, 'codobjeto', $datos1, array('empty' => '--Seleccione objeto--')); ?> <?php echo $form->error($model, 'codobjeto'); ?> <?php } ?> </div> <div class="row"> <?php //if(!$model->isnewRecord) { ?> <?php