function buscar($b) { $laRetencion = ProductoRetenciones::model()->find("id={$b}"); $ar = array("a_retener" => $laRetencion->a_retener, "base" => $laRetencion->base, "porcentaje" => $laRetencion->porcentaje); $arr = json_encode($ar); echo $arr; }
<?php echo $form->textField($model, 'retencion_retener', array('size' => 10, 'maxlength' => 10, 'readonly' => 'readonly')); ?> <?php echo $form->error($model, 'retencion_retener'); ?> </div> </div> <div class="row"> <div class="span6"> <?php echo $form->labelEx($model, 'retencion_id'); ?> <?php echo $form->dropDownList($model, 'retencion_id', CHtml::listData(ProductoRetenciones::model()->findAll("id > 0 order by 'retencion'"), 'id', 'retencion'), array('class' => 'input-xxlarge', 'disabled' => 'disabled', 'empty' => '(Seleccionar)')); ?> <?php echo $form->error($model, 'retencion_id'); ?> </div> <div class="span3"> <?php echo $form->labelEx($model, 'retencion_base'); ?> <?php echo $form->textField($model, 'retencion_base', array('size' => 10, 'maxlength' => 10, 'class' => 'input-small', 'readonly' => 'readonly')); ?> <?php echo $form->error($model, 'retencion_base');
/** * 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 ProductoRetenciones the loaded model * @throws CHttpException */ public function loadModel($id) { $model = ProductoRetenciones::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }