public function actioncreateTE() { $model = new TipoEmpresa(); if (isset($_POST['TipoEmpresa'])) { $model->attributes = $_POST['TipoEmpresa']; if ($model->save()) { $this->redirect(array('tipoempresa')); } } $this->render('createTE', array('model' => $model)); }
/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate() { $model = new TipoEmpresa(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['TipoEmpresa'])) { $model->attributes = $_POST['TipoEmpresa']; if ($model->save()) { $this->redirect(array('view', 'id' => $model->IdTipoEmpresa)); } } $this->render('create', array('model' => $model)); }
public function actionCrearTipoEmpresa() { date_default_timezone_set('America/Tegucigalpa'); $model = new TipoEmpresa(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['NombreTipoEmpresa'])) { $model->NombreTipoEmpresa = $_POST['NombreTipoEmpresa']; $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 empresa llamado <strong>" . $model->NombreTipoEmpresa . "</strong>"); $this->redirect(Yii::app()->request->urlReferrer . "#tipoEmpresa"); } } }