/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate() { //if (Yii::app()->user->checkAccess('AgendaCitasCedi_Conductor_Crear')) { $model = new Conductor(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); $fecha = strftime("%Y-%m-%d-%H-%M-%S", time()); $model->FechaGraba = $fecha; $model->FechaModifica = $fecha; $model->IdUsuarioGraba = Yii::app()->user->id; $model->IdUsuarioModifica = Yii::app()->user->id; if (isset($_POST['Conductor'])) { $model->attributes = $_POST['Conductor']; if ($model->save()) { $this->redirect(array('view', 'id' => $model->IdConductor)); } } $this->render('create', array('model' => $model)); /* } else { $this->render('//site/error', array( 'code' => '101', 'message' => Yii::app()->params ['accessError'] )); }*/ }