private function insertahijo($codocu, $id, $modeloareportar, $columna) { /*var_dump($columna); yii::app()->end();*/ $nombrecampo = trim($columna->name); $registrohijito = new Coordreporte(); $valores = array('codocu' => $codocu, 'left_' => 0, 'top' => 0, 'font_size' => 8, 'font_family' => 'arial', 'font_weight' => 'bold', 'font_color' => '#000', 'nombre_campo' => $nombrecampo, 'lbl_left' => 0, 'lbl_top' => 0, 'lbl_font_size' => 8, 'lbl_font_family' => 'arial', 'visiblelabel' => '0', 'lbl_font_color' => '#000', 'visiblecampo' => '0', 'hidreporte' => $id, 'aliascampo' => trim($modeloareportar->getAttributeLabel($nombrecampo)), 'longitudcampo' => $columna->size, 'tipodato' => $columna->dbType); $registrohijito->setAttributes($valores); $registrohijito->save(); }
/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate() { $model = new Coordreporte(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['Coordreporte'])) { $model->attributes = $_POST['Coordreporte']; if ($model->save()) { $this->redirect(array('view', 'id' => $model->id)); } } $this->render('create', array('model' => $model)); }
public function buildReport($id) { $modelreport = new VwGuia(); foreach ($modelreport->Attributes as $clave => $valor) { $fila = Coordreporte::model()->find("codocu=:vcodocu and nombre_campo=:vcampo", array(":vcodocu" => $this->documento, ":vcampo" => $clave)); if (is_null($fila)) { $filareporte = new Coordreporte(); $filareporte->codocu = $this->documento; $filareporte->nombre_campo = $clave; $filareporte->save(); } } }