<section  class="col col-6">
                                                <label class="input">
                                                    <i class="icon-append fa fa-tag"></i>
                                                    <?php 
echo $form->textField($Carrera, 'NombreCarrera', array('type' => "text", 'name' => "NombreCarrera", 'placeholder' => "Nombre de la Carrera", 'size' => 60, 'maxlength' => 500));
?>
                                                    <b class="tooltip tooltip-bottom-right">Creando nueva Carrera </b>
                                                </label>
                                            </section>


                                              <section  class="col col-6">
                                                <label class="select">
                                                    
                                                    <?php 
echo $form->dropDownList($Carrera, 'TipoCarrera_idTipoCarrera', CHtml::listData(TipoCarrera::model()->findAll("Activo=?", array(1)), "idTipoCarrera", "Nombre"), array('prompt' => 'Seleccione tipo de Carrera', 'name' => 'TipoCarreraId'));
?>
                                                      <i></i>
                                                   
                                                </label>

                                               

                                            
                                            </section>

                                    </div>
                                    </fieldset>

                                       
                                    </div>
 public function actionCrearTipoCarrera()
 {
     date_default_timezone_set('America/Tegucigalpa');
     $model = new TipoCarrera();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Nombre'])) {
         $model->Nombre = $_POST['Nombre'];
         $model->Activo = 1;
         $model->CreadoPor = Yii::app()->user->name;
         $model->FechaCreacion = date('Y-m-d H:i:s');
         if ($model->save()) {
             Yii::app()->user->setFlash("success", "<strong>Excelente! </strong> Se ha creado una nuevo tipo de carrera llamado <strong>" . $model->Nombre . "</strong>");
             $this->redirect(Yii::app()->request->urlReferrer . "#tipoCarrera");
         }
     }
 }
Пример #3
0
 public function getMenuTipoCarrera()
 {
     $criteria = new CDbCriteria();
     $criteria->order = 'Nombre';
     return CHtml::listData(TipoCarrera::model()->findAll($criteria), "idTipoCarrera", "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 TipoCarrera the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = TipoCarrera::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }