Пример #1
0
/* @var $model Pregunta */
/* @var $form CActiveForm */
?>


<div class="form">

<?php 
$form = $this->beginWidget('bootstrap.widgets.BsActiveForm', array('id' => 'pregunta-form', 'enableAjaxValidation' => true, 'htmlOptions' => array('enctype' => 'multipart/form-data')));
?>

	<p class="note">Campos con <span class="required">*</span> son obligatorios.</p>
<?php 
echo $form->errorSummary($model);
echo $form->dropDownListControlGroup($model, 'tpr_id', CHtml::listData(TipoPregunta::model()->findAll(), 'tpr_id', 'tpr_nombre'), array('empty' => 'Seleccione Tipo de Pregunta'));
echo $form->dropDownListControlGroup($model, 'tev_id', CHtml::listData(TipoEvaluacion::model()->findAll(), 'tev_id', 'tev_nombre'), array('empty' => 'Seleccione Tipo de Evaluacion'));
echo $form->textFieldControlGroup($model, 'pre_descripcion', array('size' => 60, 'maxlength' => 512));
echo $form->textAreaControlGroup($model, 'pre_comentario', array('rows' => 6, 'cols' => 50));
echo $form->labelEx($model, 'pre_imagen');
echo $form->fileField($model, 'pre_imagen', array('value' => $model->pre_imagen));
if (is_file('images/pregunta/' . str_replace("/upload/preguntas/default/", '', $model->pre_imagen))) {
    echo "<br>" . CHtml::image(Yii::app()->request->baseUrl . "/images/pregunta/" . str_replace("/upload/preguntas/default/", '', $model->pre_imagen), '', array("width" => 100, "height" => 100));
}
// echo $form->textFieldControlGroup($model,'pre_desabilitado');
?>
     	 <div class="row">
		 <?php 
echo "<br>" . BsHtml::submitButton('Aceptar', array('color' => BsHtml::BUTTON_COLOR_PRIMARY));
?>
     	 </div>
Пример #2
0
<?php

/* @var $this EvaluacionController */
/* @var $model Evaluacion */
/* @var $form CActiveForm */
?>

<div class="form">

<?php 
$form = $this->beginWidget('bootstrap.widgets.BsActiveForm', array('id' => 'evaluacion-form', 'enableAjaxValidation' => true));
?>

	<p class="note">Campos con <span class="required">*</span> son obligatorios.</p>

	<?php 
echo $form->errorSummary($model);
echo $form->dropDownListControlGroup($model, 'tev_id', CHtml::listData(TipoEvaluacion::model()->findAll('tev_desabilitado=0'), 'tev_id', 'tev_nombre'), array('empty' => 'Seleccione un tipo de evaluación'));
echo $form->textFieldControlGroup($model, 'emp_rut', array('size' => 13, 'maxlength' => 13, 'disabled' => true));
echo $form->numberFieldControlGroup($model, 'tel_numero');
echo $form->textFieldControlGroup($model, 'usu_rut', array('size' => 13, 'maxlength' => 13, 'disabled' => true));
echo $form->numberFieldControlGroup($model, 'eva_numero', array('size' => 10, 'maxlength' => 10));
echo BsHtml::submitButton('Aceptar', array('color' => BsHtml::BUTTON_COLOR_PRIMARY));
$this->endWidget();
?>

</div><!-- form -->
Пример #3
0
 public function gettev_nombre()
 {
     return ($model = TipoEvaluacion::model()->findByPk($this->tev_id)) ? $model->tev_nombre : "Sin Nombre";
 }
 /**
  * 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 TipoEvaluacion the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = TipoEvaluacion::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }