Example #1
0
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'upje-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'CED'); ?>
		<?php echo $form->dropDownList($model,'CED', CHtml::listData(Pers::model()->findAll(), 'CED', 'NOM'),array('empty' => ' Seleccione la persona')); ?>
		<?php echo $form->error($model,'CED'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'COD'); ?>
		<?php echo $form->dropDownList($model,'COD', CHtml::listData(Up::model()->findAll(array('condition'=>'REGION="CHOROTEGA"')), 'COD', 'DES'),array('empty' => ' Seleccione la U.P.')); ?>
		<?php echo $form->error($model,'COD'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'CODT'); ?>
		<?php echo $form->dropDownList($model,"CODT", CHtml::listData(Tipos::model()->findAll(array('condition'=>'tipo="Perfil Plaza"')), 'CODT', 'DES'), array('empty'=>' Seleccione programa de atenciĆ³n')); ?>
		<?php echo $form->error($model,'CODT'); ?>
	</div>
Example #2
0
 /**
  * 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 Pers the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Pers::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'Ha ocurrido una ecepcion , Clic en Home para salir de aqui.');
     }
     return $model;
 }