Exemple #1
0
?>
	
			</p>
			<br />
			
			<p>Nombre de Major <span class="required">*</span></p>
			<p>
			<?php 
$form->widget('yiiwheels.widgets.select2.WhSelect2', array('model' => $model, 'attribute' => 'colleges_has_majors_majors_id', 'name' => 'selectMajor', 'asDropDownList' => true, 'data' => array(''), 'pluginOptions' => array('allowClear' => true, 'width' => '40%'), 'htmlOptions' => array('prompt' => 'Seleccione un Major...', 'disabled' => false)));
?>
	
			</p>
			<br />

            <?php 
echo $form->dropDownListControlGroup($model, 'type_essay_id', CHtml::listData(EssayType::model()->findAll(array('order' => 'name ASC')), 'id', 'name', 'short_name'));
?>

            <?php 
echo $form->textAreaControlGroup($model, 'title', array('span' => 8, 'rows' => 10, 'maxlength' => 2048));
?>
	
			
			<?php 
//echo $form->fileFieldControlGroup($model, 'file_name', array('type' => 'pdf'));
?>
			

            <?php 
echo Chtml::activeHiddenField($model, 'regdate', array('value' => time()));
?>
Exemple #2
0
 /**
  * Retorna el nombre para el archivo del essay 
  */
 public function getNameFileEssay($idColleges, $idTypeEssay)
 {
     return Colleges::model()->getNameCollege($idColleges) . "-" . EssayType::model()->findByPk($idTypeEssay)->short_name;
 }
 /**
  * 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 EssayType the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = EssayType::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }