public function __construct() { parent::__construct($id = 'peticion', Null); $this->modelopadre = 'Peticion'; $this->modeloshijos = array('Dpeticion' => 'Tempdpeticion'); $this->documentohijo = '430'; $this->documento = Documentos::model()->findByPk($this->documentohijo)->coddocupadre; $this->campoestado = 'codestado'; $this->estados = array('save' => array(), 'print' => array(), 'out' => array(), 'ok' => array(), 'mail' => array(), 'print' => array()); $this->ConfigArreglos(); }
<?php echo $form->textField($model, 'numdocref', array('size' => 15, 'maxlength' => 15, 'disabled' => $model->isNewRecord ? '' : 'disabled')); ?> <?php echo $form->error($model, 'numdocref'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'codocuref'); ?> <?php $datos1 = CHtml::listData(Documentos::model()->findAll(array('order' => 'desdocu')), 'coddocu', 'desdocu'); echo $form->DropDownList($model, 'codocuref', $datos1, array('empty' => '--Seleccione un documento--', 'disabled' => $model->isNewRecord ? '' : 'disabled')); ?> <?php echo $form->error($model, 'codocuref'); ?> </div> </div> <?php if (!$model->isNewRecord) {
echo $form->labelEx($model, 'ceco'); ?> <?php $this->widget('ext.matchcode.MatchCode', array('nombrecampo' => 'ceco', 'ordencampo' => 3, 'controlador' => 'Dcajachica', 'relaciones' => $model->relations(), 'tamano' => 6, 'model' => $model, 'form' => $form, 'nombredialogo' => 'cru-dialog3', 'nombreframe' => 'cru-frame3', 'nombrearea' => 'fhdfjfgery')); ?> <?php echo $form->error($model, 'ceco'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'codocu'); ?> <?php $datos1 = CHtml::listData(Documentos::model()->findAll("comprobante='1'"), 'coddocu', 'desdocu'); echo $form->DropDownList($model, 'codocu', $datos1, array('empty' => '--Seleccione comprobante--')); ?> <?php echo $form->error($model, 'codocu'); ?> </div> <div class="row buttons"> <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?> </div>
public function actionConfiguraop($codocupadre) { $docu = MiFactoria::CleanInput($codocupadre); $registrox = $this->loadModel($docu); $documentopadre = $registrox->desdocu; $matrizpadre = Opcionescamposdocu::Model()->findAll(" codocu=:cod", array(":cod" => $docu)); foreach ($matrizpadre as $fila) { $cantidadregistros = Yii::app()->db->createCommand()->select("id")->from("{{opcionesdocumentos}}")->where("idopdoc=:vidop", array(":vidop" => $fila->id))->queryScalar(); if (!$cantidadregistros) { $modex = new Opcionesdocumentos(); $modex->setAttributes(array("idusuario" => Yii::app()->user->id, "idopdoc" => $fila->id), false); $modex->save(); } } $proveedor = VwOpcionesdocumentos::model()->search_us($docu, Yii::app()->user->id); //buacnado el codochijo $registro = Documentos::model()->findAll("coddocupadre=:vpadre", array(":vpadre" => $docu)); if (!is_null($registro)) { $codocuhijo = $registro[0]->coddocu; $documentohijo = $registro[0]->desdocu; } else { $codocuhijo = null; } if (!is_null($codocuhijo)) { $codocuhijo = MiFactoria::CleanInput($codocuhijo); $matrizpadre1 = Opcionescamposdocu::Model()->findAll(" codocu=:cod", array(":cod" => $codocuhijo)); foreach ($matrizpadre1 as $fila) { $cantidadregistros = Yii::app()->db->createCommand()->select("id")->from("{{opcionesdocumentos}}")->where("idopdoc=:vidop", array(":vidop" => $fila->id))->queryScalar(); if (!$cantidadregistros) { $modex = new Opcionesdocumentos(); $modex->setAttributes(array("idusuario" => Yii::app()->user->id, "idopdoc" => $fila->id), false); $modex->save(); } } $proveedor1 = VwOpcionesdocumentos::model()->search_us($codocuhijo, Yii::app()->user->id); $this->render('vw_admin_opciones', array('proveedor' => $proveedor, 'proveedor1' => $proveedor1, 'documentopadre' => $documentopadre, 'documentohijo' => $documentohijo)); } else { $this->render('vw_admin_opciones', array('proveedor' => $proveedor, 'documentopadre' => $documentopadre, 'proveedor1' => null)); } }
<div class="row"> <?php //echo $form->label($model,'lugares_lugar'); ?> <?php //echo $form->textField($model,'lugares_lugar',array('size'=>25,'maxlength'=>40)); ?> </div> <div class="row"> <?php echo $form->label($model, 'tipodoc'); ?> <?php $datos = CHtml::listData(Documentos::model()->findAll(array("condition" => "clase='D' ", 'order' => 'desDOCU')), 'coddocu', 'desdocu'); echo $form->DropDownList($model, 'tipodoc', $datos, array('empty' => '--Seleccione un documento --')); //ECHO CHtml::image(Yii::app()->getTheme()->baseUrl.Yii::app()->params["rutatemaimagenes"]."nuevo.gif","",array("width"=>30,"height"=>15)); ?> </div> <div class="row"> </div> <div class="row buttons"> <?php
?> <div class="division"> <div class="wide form"> <?php $form = $this->beginWidget('CActiveForm', array('action' => Yii::app()->createUrl($this->route), 'method' => 'get')); ?> <div class="row"> <?php echo $form->labelEx($model, 'codocu'); ?> <?php $datos = CHtml::listData(Documentos::model()->findAll(" coddocupadre in ('999','000') "), 'coddocu', 'desdocu'); echo $form->DropDownList($model, 'codocu', $datos, array('empty' => '--Seleccione un clase --')); ?> </div> <div class="row"> <?php echo $form->label($model, 'desarchivo'); ?> <?php echo $form->textField($model, 'desarchivo', array('size' => 40, 'maxlength' => 40)); ?> </div> <div class="row"> <?php
echo $form->label($model, 'nombrereporte'); ?> <?php echo $form->textField($model, 'nombrereporte'); ?> </div> <div class="row"> <?php echo $form->label($model, 'codocu'); ?> <?php $datos = CHTml::listData(Documentos::model()->findAll(), 'coddocu', 'desdocu'); ?> <?php echo $form->dropDownList($model, 'codocu', $datos, array('prompt' => 'Seleccione un Documento')); ?> </div> <div class="row buttons"> <?php echo CHtml::submitButton('Buscar', array('onClick' => 'Loading.show();Loading.hide();')); ?> </div> <?php $this->endWidget();
<div class="row"> <?php echo $form->labelEx($model, 'coddocupadre'); ?> <?php //$documento='032'; $criterial = new CDbCriteria(); $criterial->condition = 'coddocu <>:docu'; $criterial->params = $model->isNewRecord ? array(':docu' => 'x') : array(':docu' => "'" . $model->coddocu . "'"); //$post = Post::model()->find($criteria); //$datos = CHtml::listData(Estado::model()->find('codocu=:c_hcod', array(':c_hcod'=>$documento)),'codestado','estado'); //datos = CHtml::listData(Estado::model()->find($criteria),'codestado','estado'); $datos = CHtml::listData(Documentos::model()->findall($criterial), 'coddocu', 'desdocu'); echo $form->DropDownList($model, 'coddocupadre', $datos, array('empty' => '--Indique un documento padre--')); ?> <?php echo $form->error($model, 'coddocupadre'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'idreportedefault'); $datos = CHtml::listData(Coordocs::model()->findall(), 'id', 'nombrereporte'); echo $form->DropDownList($model, 'idreportedefault', $datos, array('empty' => '--Indique el reporte--')); ?>
public static function estadosnocalculablesdetalle($codocu) { ///$CODOCU es el codigo del docuenmtno padre /*esta funcion devuel los estado del detalle de un domcuento * que no son calculables x ejemplo una item anualado o cualquier otro estado que no s etome necuenta * */ $codocu = MiFactoria::cleanInput($codocu); $documentohijo = Documentos::model()->find("coddocupadre='" . $codocu . "'"); //var_dump($documentohijo); if (!is_null($documentohijo)) { return Yii::app()->db->createCommand()->select('codestado')->from('{{estado}}')->where("codocu=:vcodocu AND nocalculable='1' ", array(":vcodocu" => $documentohijo->coddocu))->queryColumn(); } else { return array(); } }
<h1>Tenores de Documentos</h1> <?php $this->menu = array(array('label' => 'Crear Tenor', 'url' => array('create'))); ?> <?php $this->widget('zii.widgets.grid.CGridView', array('id' => 'tenores-grid', 'dataProvider' => $model->search(), 'cssFile' => Yii::app()->getTheme()->baseUrl . '/css/grilla_celeste.css', 'filter' => $model, 'columns' => array(array('name' => 'activo', 'type' => 'raw', 'value' => 'CHtml::checkBox("hu",($data->activo=="1"),array("disabled"=>"disabled"))'), array('name' => 'coddocu', 'type' => 'raw', 'value' => '$data->coddocu', 'filter' => CHtml::listData(Documentos::model()->findAll(), 'coddocu', 'desdocu'), 'htmlOptions' => array('width' => 300)), 'mensaje', 'sociedad', 'posicion', array('class' => 'CButtonColumn', 'template' => '{update}'))));
</div> </fieldset> </div> <div style="float: left; width:320px; padding:10px;"> <fieldset> <LEGEND><b>Referencia</b></LEGEND> <div class="row"> <?php echo $form->labelEx($model, 'documento'); ?> <?php $datos = CHtml::listData(Documentos::model()->findAll(" clase='D'", array('order' => 'desdocu')), 'coddocu', 'desdocu'); echo $form->DropDownList($model, 'documento', $datos, array('empty' => '--Seleccione un documento--')); ?> <?php echo $form->error($model, 'documento'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'numeroref'); ?> <?php echo $form->textField($model, 'numeroref', array('size' => 25, 'maxlength' => 25)); ?> <?php