/** * 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 Opcionescamposdocu the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Opcionescamposdocu::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
public static function OpcionesDefault($docu) { /*$docu='340'; //guia de remision /* $docuhijo='350'; //detalle guia de remisio*/ $registros = Opcionescamposdocu::model()->findAllBySql("select *from\r\r\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . Yii::app()->params['prefijo'] . "opcionescamposdocu\r\r\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t where\r\r\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t codocu='" . $docu . "'"); foreach ($registros as $row) { if ($row->cuantasopcioneshay == 0) { $registro = new Opcionesdocumentos(); $registro->idusuario = Yii::app()->user->id; $registro->idopdoc = $row->id; $registro->save(); unset($registro); } } unset($registros); return $proveedor = VwOpcionesdocumentos::model()->search_us($docu, Yii::app()->user->id); }
<?php $this->widget('zii.widgets.grid.CGridView', array('id' => 'documentosop-grid', 'dataProvider' => Opcionescamposdocu::model()->search_por_docu($model->coddocu), 'columns' => array('codocu', 'campo', 'nombrecampo', 'tipodato', 'longitud', 'nombredelmodelo', 'seleccionable', array('class' => 'CButtonColumn')))); ?> <div class="row"> <?php $botones = array('add' => array('type' => 'C', 'ruta' => array($this->id . '/creadetalle', array('id' => $model->coddocu, "asDialog" => 1, "gridId" => 'documentosop-grid')), 'dialog' => 'cru-dialog3', 'frame' => 'cru-frame3', 'visiblex' => array('10'))); $this->widget('ext.toolbar.Barra', array('botones' => $botones, 'size' => 24, 'extension' => 'png', 'status' => '10')); ?> </div> <?php //--------------------- begin new code -------------------------- // add the (closed) dialog for the iframe $this->beginWidget('zii.widgets.jui.CJuiDialog', array('id' => 'cru-dialog3', 'options' => array('title' => 'Explorador', 'autoOpen' => false, 'modal' => true, 'width' => 850, 'height' => 500))); ?> <iframe id="cru-frame3" width="100%" height="100%"></iframe> <?php $this->endWidget(); //--------------------- end new code --------------------------