/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate() { $model = new PeriodoAcademico(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['PeriodoAcademico'])) { $model->attributes = $_POST['PeriodoAcademico']; if ($model->save()) { $this->redirect(array('view', 'id' => $model->IdPeriodoAcademico)); } } $this->render('create', array('model' => $model)); }
public function actionCrearPeriodoAcademico() { date_default_timezone_set('America/Tegucigalpa'); $model = new PeriodoAcademico(); if (isset($_POST['Semestre'])) { $model->Anio = $_POST['Anio']; $model->Semestre = $_POST['Semestre']; $model->Trimestre = $_POST['Trimestre']; $model->Activo = 1; $model->CreadoPor = Yii::app()->user->name; if ($model->save()) { $this->redirect(Yii::app()->request->urlReferrer); } } }