/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate() { $model = new Applicant(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['Applicant'])) { $model->attributes = $_POST['Applicant']; if ($model->save()) { $this->redirect(array('view', 'id' => $model->id)); } } $this->render('create', array('model' => $model)); }
/** * 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($this->id . '.' . $this->action->id)) { $model = new Applicant(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['Applicant'])) { $model->attributes = $_POST['Applicant']; if ($model->save()) { $this->redirect(array('view', 'id' => $model->id)); } } $this->render('create', array('model' => $model)); } else { $this->accessDenied(); } }
require_once 'db/SELECT.php'; require_once 'db/INSERT.php'; require_once 'email.php'; require_once 'pm.php'; require_once 'classes/Applicant.php'; require_once 'classes/Message.php'; require_once 'classes/Peak.php'; require_once 'classes/User.php'; $con = connect_db(); $ADK_APPLICANT = new Applicant(); $ADK_APPLICANT->populateFromSignUp(); if (!$ADK_APPLICANT->isValid()) { $con->close(); header('Location: ../signup?e=' . $this->err); exit; } if (!User::isUniqueUsername($con, $ADK_APPLICANT->username, '')) { $con->close(); header('Location: ../signup?e=q'); exit; } $ADK_APPLICANT->sanitize(); $ADK_APPLICANT->save($con); foreach ($ADK_APPLICANT->peaks as $ADK_PEAK) { $ADK_APPLICANT->addPeak($con, $ADK_PEAK); } $ADK_APPLICANT->get($con); sendNewApplicantEmail($ADK_APPLICANT); sendNewApplicantPM($con, $ADK_APPLICANT); $con->close(); header('Location: ../thankyou');