当前位置: 首页>>代码示例>>PHP>>正文


PHP Registration::save方法代码示例

本文整理汇总了PHP中Registration::save方法的典型用法代码示例。如果您正苦于以下问题:PHP Registration::save方法的具体用法?PHP Registration::save怎么用?PHP Registration::save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Registration的用法示例。


在下文中一共展示了Registration::save方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionCreate

 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Registration();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Registration'])) {
         $model->attributes = $_POST['Registration'];
         if ($model->save()) {
             $user = new User();
             $auth_assign = new AuthAssignment();
             $user->user_organization_email_id = $model->email;
             $my_string = $this->rand_string(7);
             $user->user_password = md5($my_string . $my_string);
             $user->user_type = 'admin';
             $user->user_created_by = 1;
             $user->user_creation_date = new CDbExpression('NOW()');
             $user->user_organization_id = 1;
             if ($user->save()) {
                 $auth_assign->itemname = 'SuperAdmin';
                 $auth_assign->userid = $user->user_id;
                 $auth_assign->save(false);
                 $request_url = 'http://www.rudrasoftech.com/register-script.php?first_name=' . $model->first_name . '&last_name=' . $model->last_name . '&email=' . $model->email . '&country_code=' . $model->country_code . '&mobile=' . $model->mobile . '&pass=' . $my_string;
                 $response = $this->get_url($request_url);
             }
             $this->redirect(array('site/createOrg'));
         }
     }
     $this->render('create', array('model' => $model));
 }
开发者ID:sharmarakesh,项目名称:edusec-college-management-system,代码行数:33,代码来源:RegistrationController.php

示例2: saveRegistration

 /**
  * Save Registration
  * @param <type> $array
  */
 public static function saveRegistration($array, $lang = null)
 {
     $r = new Registration();
     foreach ($array as $key => $value) {
         $field = (string) $key;
         $r->{$field} = $value;
     }
     ZFCore_Utils::log('Add registration: ' . var_export($array, true));
     $r->save();
     if (is_null($lang)) {
         $subject = "Retreat with Chögyal Namkhai Norbu";
         $body = "You are registered for the retreat in Merigar East. Thank you for the collaboration. See you in the Gar! \n";
     } elseif ($lang == 'ro') {
         $subject = "Retragerea de Invataturi Dzogchen cu Chögyal Namkhai Norbu";
         $body = "Cererea Dvs. de participare la retragerea din Merigar Est a fost inregistrata.\n  Va multumim pentru colaborare.\n                     Va asteptam cu drag la Gar.\n";
     } elseif ($lang == 'ru') {
         $subject = "Ретрит с Чгъялом Намкай Норбу";
         $body = "Вы зарешгистрированны на ретрит в Восточном Меригаре.\n    Спасибо за сотрудничество.\n    До встречи в Гаре\n";
     }
     // to user
     $options['from'] = "webmaster@dzogchen.cz";
     $options['to'] = $array['email'];
     $options['subject'] = $subject;
     $options['body'] = $body;
     ZFCore_Utils::sendEmail($options);
     // to admin
     $options['from'] = "webmaster@dzogchen.cz";
     $options['to'] = 'martin.kourim@gmail.com';
     $options['subject'] = "[RETREAT] new registration";
     $options['body'] = 'Add registration: ' . var_export($array, true);
     ZFCore_Utils::sendEmail($options);
 }
开发者ID:abtris,项目名称:retreatin,代码行数:36,代码来源:Registration.php

示例3: run

 public function run()
 {
     $form = new RegistrationForm();
     if (Yii::app()->request->isPostRequest && !empty($_POST['RegistrationForm'])) {
         $module = Yii::app()->getModule('user');
         $form->setAttributes($_POST['RegistrationForm']);
         // проверка по "черным спискам"
         // проверить на email
         if (!$module->isAllowedEmail($form->email)) {
             // перенаправить на экшн для фиксации невалидных email-адресов
             $this->controller->redirect(array(Yii::app()->getModule('user')->invalidEmailAction));
         }
         if (!$module->isAllowedIp(Yii::app()->request->userHostAddress)) {
             // перенаправить на экшн для фиксации невалидных ip-адресов
             $this->controller->redirect(array(Yii::app()->getModule('user')->invalidIpAction));
         }
         if ($form->validate()) {
             // если требуется активация по email
             if ($module->emailAccountVerification) {
                 $registration = new Registration();
                 // скопируем данные формы
                 $registration->setAttributes($form->getAttributes());
                 if ($registration->save()) {
                     // отправка email с просьбой активировать аккаунт
                     $mailBody = $this->controller->renderPartial('application.modules.user.views.email.needAccountActivationEmail', array('model' => $registration), true);
                     Yii::app()->mail->send($module->notifyEmailFrom, $registration->email, Yii::t('user', 'Регистрация на сайте {site} !', array('{site}' => Yii::app()->name)), $mailBody);
                     // запись в лог о создании учетной записи
                     Yii::log(Yii::t('user', "Создана учетная запись {nick_name}!", array('{nick_name}' => $registration->nick_name)), CLogger::LEVEL_INFO, UserModule::$logCategory);
                     Yii::app()->user->setFlash(YFlashMessages::NOTICE_MESSAGE, Yii::t('user', 'Учетная запись создана! Инструкции по активации аккаунта отправлены Вам на email!'));
                     $this->controller->refresh();
                 } else {
                     $form->addErrors($registration->getErrors());
                     Yii::log(Yii::t('user', "Ошибка при создании  учетной записи!"), CLogger::LEVEL_ERROR, UserModule::$logCategory);
                 }
             } else {
                 // если активации не требуется - сразу создаем аккаунт
                 $user = new User();
                 $user->createAccount($form->nick_name, $form->email, $form->password);
                 if ($user && !$user->hasErrors()) {
                     Yii::log(Yii::t('user', "Создана учетная запись {nick_name} без активации!", array('{nick_name}' => $user->nick_name)), CLogger::LEVEL_INFO, UserModule::$logCategory);
                     // отправить email с сообщением о успешной регистрации
                     $emailBody = $this->controller->renderPartial('application.modules.user.views.email.accountCreatedEmail', array('model' => $user), true);
                     Yii::app()->mail->send($module->notifyEmailFrom, $user->email, Yii::t('user', 'Регистрация на сайте {site} !', array('{site}' => Yii::app()->name)), $emailBody);
                     Yii::app()->user->setFlash(YFlashMessages::NOTICE_MESSAGE, Yii::t('user', 'Учетная запись создана! Пожалуйста, авторизуйтесь!'));
                     $this->controller->redirect(array('/user/account/login/'));
                 } else {
                     $form->addErrors($user->getErrors());
                     Yii::log(Yii::t('user', "Ошибка при создании  учетной записи без активации!"), CLogger::LEVEL_ERROR, UserModule::$logCategory);
                 }
             }
         }
     }
     $this->controller->render('registration', array('model' => $form));
 }
开发者ID:RSol,项目名称:yupe,代码行数:54,代码来源:RegistrationAction.php

示例4: actionSelect_create

 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionSelect_create()
 {
     $model = new Registration();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Registration'])) {
         $model->attributes = $_POST['Registration'];
         if ($model->save()) {
             $this->redirect('select_create');
         }
     }
     $this->render('select_create', array('model' => $model));
 }
开发者ID:TheTypoMaster,项目名称:myapps,代码行数:17,代码来源:RegistrationController.php

示例5: postRankedform

 public function postRankedform()
 {
     $form = new Registration();
     $form->name = Input::get('name');
     $form->email = Input::get('email');
     $form->ign = Input::get('ign');
     $form->rank = Input::get('rank');
     $form->fav_champ = Input::get('favchamp');
     $form->position = Input::get('position');
     $form->opgg_link = "na.op.gg/summoner/userName=" . Input::get('ign');
     $form->save();
     Session::flash('success', 'Successfully submitted your application for the ranked team!');
     return Redirect::to('/');
 }
开发者ID:WolfUser,项目名称:UCLoL,代码行数:14,代码来源:RestController.php

示例6: actionRegister

    public function actionRegister() {
        $this->layout = '//layouts/login_main';
        if (!isFrontUserLoggedIn()) {
            $model = new Registration;

            if (isset($_POST['Registration'])) {
                $model->attributes = $_POST['Registration'];
                $model->country = "USA";
                if ($model->validate()) {
                    $model->password = md5($model->password);
                    $model->confirm_password = $model->password;
                    $model->save();
                    $this->redirect(base_url() . '/user/default/login');
                }
            }
            $this->render('register', array('model' => $model));
        } else {
            $this->redirect(array("myaccount"));
        }
    }
开发者ID:priyranjansingh,项目名称:donation,代码行数:20,代码来源:DefaultController.php

示例7: store

 public function store()
 {
     // Get StudentID
     // From student_id or Create New
     // Create Registration
     // Create Issue
     // Create Education
     // Create Placement
     // Create Receivables
     // Reductions
     // Create Installment
     try {
         //DB::beginTransaction();
         if (Input::get('student_id') == 0) {
             // Create New Student
             $student = new Student();
             $student->name = Input::get('name');
             $student->sex = Input::get('sex');
             $student->birthplace = Input::get('birthplace');
             $student->birthdate = date('Y-m-d', strtotime(Input::get('birthdate')));
             $student->religion = Input::get('religion');
             $student->address = Input::get('address');
             $student->contact = Input::get('contact');
             $student->email = Input::get('email');
             if (Input::get('sex') == 'L') {
                 $student->photo = 'boy.png';
             } else {
                 $student->photo = 'girl.png';
             }
             $student->father_name = Input::get('father_name');
             $student->father_occupation = Input::get('father_occupation');
             $student->father_address = Input::get('father_address');
             $student->father_contact = Input::get('father_contact');
             $student->father_email = Input::get('father_email');
             $student->mother_name = Input::get('mother_name');
             $student->mother_occupation = Input::get('mother_occupation');
             $student->mother_address = Input::get('mother_address');
             $student->mother_contact = Input::get('mother_contact');
             $student->mother_email = Input::get('mother_email');
             $student->save();
             $id = $student->id;
         } else {
             $student = Student::find(Input::get('student_id'));
             $student->name = Input::get('name');
             $student->sex = Input::get('sex');
             $student->birthplace = Input::get('birthplace');
             $student->birthdate = date('Y-m-d', strtotime(Input::get('birthdate')));
             $student->religion = Input::get('religion');
             $student->address = Input::get('address');
             $student->contact = Input::get('contact');
             $student->email = Input::get('email');
             if (Input::get('sex') == 'L') {
                 $student->photo = 'boy.png';
             } else {
                 $student->photo = 'girl.png';
             }
             $student->father_name = Input::get('father_name');
             $student->father_occupation = Input::get('father_occupation');
             $student->father_address = Input::get('father_address');
             $student->father_contact = Input::get('father_contact');
             $student->father_email = Input::get('father_email');
             $student->mother_name = Input::get('mother_name');
             $student->mother_occupation = Input::get('mother_occupation');
             $student->mother_address = Input::get('mother_address');
             $student->mother_contact = Input::get('mother_contact');
             $student->mother_email = Input::get('mother_email');
             $student->save();
             $id = $student->id;
         }
         // Create Registration Data
         $registration = new Registration();
         $registration->project_id = Auth::user()->curr_project_id;
         $registration->location_id = Auth::user()->location_id;
         $registration->student_id = $id;
         $registration->classification_id = Input::get('classification');
         $registration->base_id = Input::get('location');
         $registration->registration_date = date('Y-m-d', strtotime(Input::get('registration_date')));
         $registration->registration_cost = Input::get('fee');
         $registration->recommender_type = Input::get('recommender_type');
         $registration->recommender_id = Input::get('recommender_id');
         $registration->employee_id = Input::get('employee');
         $registration->save();
         // Create Issue
         $issue = new Issue();
         $issue->project_id = Auth::user()->curr_project_id;
         $issue->location_id = Auth::user()->location_id;
         $issue->registration_id = $registration->id;
         $issue->generation_id = Input::get('generation');
         $issue->student_id = $id;
         $issue->issue = Input::get('issue');
         $issue->save();
         //Create Education Data
         if (Input::get('school') != '0') {
             $education = new Education();
             $education->project_id = Auth::user()->curr_project_id;
             $education->issue_id = $issue->id;
             $education->school_id = Input::get('school');
             $education->generation_id = Input::get('generation');
             $education->save();
         }
//.........这里部分代码省略.........
开发者ID:emanmks,项目名称:oneschool,代码行数:101,代码来源:RegistrationsController.php

示例8: executeStudentRegradeDetail

 public function executeStudentRegradeDetail(sfWebRequest $request)
 {
     ## <SectionDetail>, <StudentDetail>, <GradedCourses> <CreateForm> <activatedRegrades> ## THESE ARE NEEDED STEP BY STEP
     $this->showCourseGrades = FALSE;
     $this->showFormResult = FALSE;
     $this->showActivatedRegrade = FALSE;
     $this->registrationIdsArray = array();
     $this->coursesIdsArray = array();
     $this->regradeRegistrationIdsArray = array();
     $this->activatedCourseIdsArray = array();
     $this->departmentName = $this->getUser()->getAttribute('departmentName');
     $this->programSectionId = $request->getParameter('sectionId');
     $this->studentId = $request->getParameter('studentId');
     $this->enrollmentId = $request->getParameter('enrollmentId');
     $this->sectionDetail = Doctrine_Core::getTable('ProgramSection')->getOneProgramSectionById($this->programSectionId);
     $this->studentDetail = Doctrine_Core::getTable('Student')->getStudentDetailById($this->studentId);
     $this->programName = Doctrine_Core::getTable('ProgramSection')->getOneProgramSectionById($this->programSectionId)->getProgram();
     ## RETRIEVE STUDENT REGISTERED COURSES UNDER ONE SEMESTER ENROLLMENT,
     #1. Find enrollment
     $this->enrollment = Doctrine_Core::getTable('EnrollmentInfo')->findOneStudentEnrollmentInforById($this->enrollmentId);
     $this->forward404Unless($this->enrollment);
     #2. Find all Registrations per enrollment above
     $this->registrations = Doctrine_Core::getTable('Registration')->getEnrollmentRegistrations($this->enrollment->getId());
     $this->forward404Unless($this->registrations);
     foreach ($this->registrations as $registration) {
         $this->registrationIdsArray[$registration->getId()] = $registration->getId();
         if ($registration->getIsGradeComplain() == TRUE || $registration->getIsMakeup() == TRUE || $registration->getIsReexam() == TRUE) {
             $this->regradeRegistrationIdsArray[$registration->getId()] = $registration->getId();
         }
     }
     #3. Find all courses [StudentCourseGrade] under each Registration, a)Calculatables, b)Have Grade
     $this->activeGradedStudentCourses = Doctrine_Core::getTable('StudentCourseGrade')->getActiveRegistrationCourses($this->registrationIdsArray, $this->studentId);
     $this->forward404Unless($this->activeGradedStudentCourses);
     #3.1 Check if there graded courses
     if ($this->activeGradedStudentCourses->count() != 0) {
         $this->showCourseGrades = TRUE;
     }
     #3.2 Find all courses [StudentCourseGrade] under each Registration, a)Calculatables, b)Have Grade c)not under regrade process (not activated)
     $this->activeNotReGradedStudentCourses = Doctrine_Core::getTable('StudentCourseGrade')->getActiveRegistrationNotRegradedCourses($this->registrationIdsArray, $this->studentId);
     $this->forward404Unless($this->activeNotReGradedStudentCourses);
     #4. PREPARE REGRADE REQUEST FORM
     ##COURSE
     $this->coursesIdsArray[''] = 'Select Course to Regrade';
     foreach ($this->activeNotReGradedStudentCourses as $course) {
         $this->coursesIdsArray[$course->getCourseId()] = $course->getCourse();
     }
     ##REGRADE - FROM FormChoices
     ##AC MINUTE, REMARK
     ## THE FORM
     $this->frontendRegradeRequestForm = new FrontendRegradeRequestForm($this->enrollmentId, $this->studentId, $this->coursesIdsArray);
     #5. ACTIVATED REGRADES
     #5.1 - Get all special / regrade registrations
     $this->activatedCoursesForRegrade = Doctrine_Core::getTable('StudentCourseGrade')->getActivatedCoursesForRegrade($this->regradeRegistrationIdsArray, $this->studentId);
     $this->forward404Unless($this->activatedCoursesForRegrade);
     #5.2 - Arrange activated regradable courses for form
     if ($this->activatedCoursesForRegrade->count() != 0) {
         $this->showActivatedRegrade = TRUE;
         $this->activatedCourseIdsArray[''] = '-- Select Course To Regrade --';
         foreach ($this->activatedCoursesForRegrade as $activatedCFR) {
             $this->activatedCourseIdsArray[$activatedCFR->getId()] = $activatedCFR->getCourse();
         }
         #KEEP COURSE ID ARRAY ON SESSION, TO BE USED WHEN REGRADE VALUE IS ENTERED
         $this->getUser()->setAttribute('activatedCourseIdsArray', $this->activatedCourseIdsArray);
     }
     #6. DATAWORKER FOR VIEW
     $gradeChoices = Doctrine_Core::getTable('Grade')->getAllLetterGradeChoices();
     $this->getUser()->setAttribute('gradeChoices', $gradeChoices);
     ## created for use when new regrade value is entered,
     $this->frontendRegradeSubmissionForm = new FrontendRegradeSubmissionForm($this->enrollmentId, $this->studentId, $this->activatedCourseIdsArray, $gradeChoices);
     ### PROCESS THE FORM IF SUBMITTED ###
     if ($request->isMethod('post')) {
         $this->frontendRegradeRequestForm->bind($request->getParameter('regraderequestform'));
         if ($this->frontendRegradeRequestForm->isValid()) {
             $formData = $this->frontendRegradeRequestForm->getValues();
             $this->courseId = $formData['course_id'];
             $this->regradeReason = $formData['regrade_reason'];
             $this->studentId = $formData['student_id'];
             $this->enrollmentInfoId = $formData['enrollment_info_id'];
             $this->remark = $formData['remark'];
             $this->ac = $formData['ac'];
             if ($this->courseId == '' || $this->regradeReason == '' || $this->studentId == '' || $this->enrollmentInfoId == '') {
                 $this->getUser()->setFlash('error', 'Error occured: nothing performed, please redo actions ');
                 $this->redirect('regrade/studentRegradeDetail?sectionId=' . $this->programSectionId . '&studentId=' . $this->studentId . '&enrollmentId=' . $this->enrollmentId);
             }
             ## REGISTER STUDENT BASED ON ENROLLMENTINFO FOR SPECIFIED REGRADE REASON
             $registration = new Registration();
             $registration->setEnrollmentInfoId($this->enrollmentInfoId);
             $registration->setAc($this->ac);
             $registration->setDate(date('m-d-Y'));
             $registration->setRemark($this->remark);
             if ($this->regradeReason == 'gradecomplain') {
                 $registration->setIsGradeComplain(TRUE);
             }
             if ($this->regradeReason == 'reexam') {
                 $registration->setIsReexam(TRUE);
             }
             if ($this->regradeReason == 'makeup') {
                 $registration->setIsMakeup(TRUE);
             }
             $registration->save();
//.........这里部分代码省略.........
开发者ID:eyumay,项目名称:srms.psco,代码行数:101,代码来源:actions.class.php

示例9: ps_store

 public function ps_store()
 {
     $rules = ['team_name' => 'required|unique:registration', 'university' => 'required', 'member1_name' => 'required', 'member1_email' => 'required', 'member1_mobile' => 'required', 'member1_photo' => 'required|mimes:jpg,png,jpeg', 'member1_id_photo' => 'required|mimes:jpg,png,jpeg', 'member2_name' => 'required', 'member2_email' => 'required', 'member2_mobile' => 'required', 'member2_photo' => 'required|mimes:jpg,png,jpeg', 'member2_id_photo' => 'required|mimes:jpg,png,jpeg', 'member3_name' => 'required', 'member3_email' => 'required', 'member3_mobile' => 'required', 'member3_photo' => 'required|mimes:jpg,png,jpeg', 'member3_id_photo' => 'required|mimes:jpg,png,jpeg'];
     $data = Input::all();
     $validation = Validator::make($data, $rules);
     if ($validation->fails()) {
         return Redirect::back()->withErrors($validation)->withInput();
     } else {
         if (Input::hasFile('member1_photo') && Input::hasFile('member1_id_photo') && Input::hasFile('member2_photo') && Input::hasFile('member2_id_photo') && Input::hasFile('member3_photo') && Input::hasFile('member3_id_photo')) {
             //path
             $destinationPath = public_path('uploads/registration');
             $member1_photo = Input::file('member1_photo');
             $member1_photo_fileName = strtotime(date('Y-m-d H:i:s')) . md5($member1_photo->getClientOriginalName()) . "." . $member1_photo->getClientOriginalExtension();
             $member1_photo->move($destinationPath, $member1_photo_fileName);
             $member1_id_photo = Input::file('member1_id_photo');
             $member1_id_photo_fileName = strtotime(date('Y-m-d H:i:s')) . md5($member1_id_photo->getClientOriginalName()) . "." . $member1_id_photo->getClientOriginalExtension();
             $member1_id_photo->move($destinationPath, $member1_id_photo_fileName);
             $member2_photo = Input::file('member2_photo');
             $member2_photo_fileName = strtotime(date('Y-m-d H:i:s')) . md5($member2_photo->getClientOriginalName()) . "." . $member2_photo->getClientOriginalExtension();
             $member2_photo->move($destinationPath, $member2_photo_fileName);
             $member2_id_photo = Input::file('member2_id_photo');
             $member2_id_photo_fileName = strtotime(date('Y-m-d H:i:s')) . md5($member2_id_photo->getClientOriginalName()) . "." . $member2_id_photo->getClientOriginalExtension();
             $member2_id_photo->move($destinationPath, $member2_id_photo_fileName);
             $member3_photo = Input::file('member3_photo');
             $member3_photo_fileName = strtotime(date('Y-m-d H:i:s')) . md5($member3_photo->getClientOriginalName()) . "." . $member3_photo->getClientOriginalExtension();
             $member3_photo->move($destinationPath, $member3_photo_fileName);
             $member3_id_photo = Input::file('member3_id_photo');
             $member3_id_photo_fileName = strtotime(date('Y-m-d H:i:s')) . md5($member3_id_photo->getClientOriginalName()) . "." . $member3_id_photo->getClientOriginalExtension();
             $member3_id_photo->move($destinationPath, $member3_id_photo_fileName);
             $reg = new Registration();
             $reg->team_name = $data['team_name'];
             $reg->university = $data['university'];
             $reg->member1_name = $data['member1_name'];
             $reg->member1_email = $data['member1_email'];
             $reg->member1_mobile = $data['member1_mobile'];
             $reg->member1_photo = $member1_photo_fileName;
             $reg->member1_id_photo = $member1_id_photo_fileName;
             $reg->member2_name = $data['member2_name'];
             $reg->member2_email = $data['member2_email'];
             $reg->member2_mobile = $data['member2_mobile'];
             $reg->member2_photo = $member2_photo_fileName;
             $reg->member2_id_photo = $member2_id_photo_fileName;
             $reg->member3_name = $data['member3_name'];
             $reg->member3_email = $data['member3_email'];
             $reg->member3_mobile = $data['member3_mobile'];
             $reg->member3_photo = $member3_photo_fileName;
             $reg->member3_id_photo = $member3_id_photo_fileName;
             $reg->contest = 'ps';
             $reg->status = 0;
             if ($reg->save()) {
                 return Redirect::route('team.ps')->with('success', "Registration Successful");
             } else {
                 return Redirect::route('reg.ps')->with('error', "Photos error, Please Try Again");
             }
         } else {
             return Redirect::route('reg.ps')->with('error', "Photos error, Please Try Again");
         }
     }
 }
开发者ID:scdnlab,项目名称:cse_carnival_2015,代码行数:59,代码来源:ContestController.php

示例10: actionSave

 public function actionSave()
 {
     $model = new Registration();
     /*$model->student_id=$_REQUEST['student_id']; 
     	   	$model->food_preference = $_REQUEST['registration']['food_preference'];
     	    $model->desc = $_REQUEST['registration']['desc'];
     		$model->status='C';*/
     $model->attributes = $_REQUEST['registration'];
     $model->student_id = $_REQUEST['student_id'];
     $model->status = 'C';
     //print_r($model->attributes);
     /*if($model->validate()){echo 'vvv';}
     		var_dump($model->getErrors());*/
     if ($model->save()) {
         $bed_info = Allotment::model()->findAll('status=:x AND student_id IS NULL', array(':x' => 'C'));
         if ($bed_info == NULL) {
             $this->redirect(array('/hostel/allotment/roominfo/'));
         } else {
             $this->redirect(array('/hostel/room/roomlist', 'id' => $model->student_id, 'floor_id' => $_REQUEST['floor_id']));
         }
     }
 }
开发者ID:akilraj1255,项目名称:rajeshwari,代码行数:22,代码来源:RegistrationController.php

示例11: processRegistration

 public function processRegistration(sfWebRequest $request, sfForm $registrationForm)
 {
     $registrationForm->bind($request->getParameter('courseregistrationform'));
     if ($registrationForm->isValid()) {
         ## get form values
         $formData = $this->registrationForm->getValues();
         $courseIds = $formData['course_id'];
         $enrollmentInfoIds = $formData['student_id'];
         if ($courseIds == '' || $enrollmentInfoIds == '') {
             $this->getUser()->setFlash('error', 'Error occured, please redo actions ');
             $this->redirect('registration/index');
         }
         foreach ($enrollmentInfoIds as $enrollmentId) {
             $enrollmentDetail = Doctrine_Core::getTable('EnrollmentInfo')->findOneStudentEnrollmentInforById($enrollmentId);
             $sectionId = $enrollmentDetail->getSectionId();
             $enrollmentDetail->updateEnrollmentSemesterAction(sfConfig::get('app_registered_semester_action'));
             $registration = new Registration();
             $registration->setEnrollmentInfoId($enrollmentId);
             $registration->setDate(date('m-d-Y'));
             $registration->save();
             foreach ($courseIds as $courseId) {
                 $studentCourse = new StudentCourseGrade();
                 $studentCourse->setCourseId($courseId);
                 $studentCourse->setRegistrationId($registration->getId());
                 $studentCourse->setStudentId(Doctrine_Core::getTable('EnrollmentInfo')->getEnrollmentDetailById($enrollmentId)->getStudentId());
                 $studentCourse->save();
             }
         }
         $newLog = new AuditLog();
         $action = 'User has Registered Students Student Record Management System';
         $newLog->addNewLogInfo($this->getUser()->getAttribute('userId'), $action);
         $this->getUser()->setFlash('notice', 'Student Registration was successfull ');
         $this->redirect('registration/sectiondetail?id=' . $sectionId);
         ## Check filter combination availability [program_id, academic_year, year, semester], then return section]
     }
 }
开发者ID:eyumay,项目名称:srms.psco,代码行数:36,代码来源:actions.class.php

示例12: processRegistration

 public function processRegistration(sfWebRequest $request, sfForm $registrationForm)
 {
     $registrationForm->bind($request->getParameter('courseregistrationform'));
     if ($registrationForm->isValid()) {
         ## get form values
         $formData = $this->registrationForm->getValues();
         $courseIds = $formData['course_id'];
         $enrollmentInfoIds = $formData['student_id'];
         foreach ($enrollmentInfoIds as $enrollmentId) {
             $enrollmentDetail = Doctrine_Core::getTable('EnrollmentInfo')->findOneStudentEnrollmentInforById($enrollmentId);
             $checkIfStudentCanRegister = Doctrine_Core::getTable('StudentCourseGrade')->checkIfStudentCanRegister($enrollmentDetail->getStudentId(), $courseIds);
             if ($checkIfStudentCanRegister) {
                 Doctrine_Core::getTable('EnrollmentInfo')->setSemesterActionToRegistered($enrollmentId);
                 $registration = new Registration();
                 $registration->setEnrollmentInfoId($enrollmentId);
                 $registration->setDate(date('m-d-Y'));
                 $registration->save();
                 foreach ($courseIds as $courseId) {
                     $studentCourse = new StudentCourseGrade();
                     $studentCourse->setCourseId($courseId);
                     $studentCourse->setRegistrationId($registration->getId());
                     $studentCourse->setStudentId(Doctrine_Core::getTable('EnrollmentInfo')->getEnrollmentDetailById($enrollmentId)->getStudentId());
                     $studentCourse->save();
                 }
             }
         }
         $this->getUser()->setFlash('notice', 'Registration was successfull ' . $enrollmentDetail->getStudentId());
         $this->redirect('programsection/index');
         ## Check filter combination availability [program_id, academic_year, year, semester], then return section]
     }
 }
开发者ID:eyumay,项目名称:srms.psco,代码行数:31,代码来源:actions.class.php

示例13: actionRegistration

 public function actionRegistration()
 {
     $competition = $this->getCompetition();
     $user = $this->getUser();
     $registration = Registration::getUserRegistration($competition->id, $user->id);
     if (!$competition->isPublic() || !$competition->isRegistrationStarted()) {
         Yii::app()->user->setFlash('info', Yii::t('Competition', 'The registration is not open yet.'));
         $this->redirect($competition->getUrl('competitors'));
     }
     $showRegistration = $registration !== null && $registration->isAccepted();
     if ($competition->isRegistrationEnded() && !$showRegistration) {
         Yii::app()->user->setFlash('info', Yii::t('Competition', 'The registration has been closed.'));
         $this->redirect($competition->getUrl('competitors'));
     }
     if ($competition->isRegistrationFull() && !$showRegistration) {
         Yii::app()->user->setFlash('info', Yii::t('Competition', 'The limited number of competitor has been reached.'));
         $this->redirect($competition->getUrl('competitors'));
     }
     if ($user->isUnchecked()) {
         $this->render('registration403', array('competition' => $competition));
         Yii::app()->end();
     }
     if ($registration !== null) {
         $registration->formatEvents();
         $this->setWeiboShareDefaultText($competition->getRegistrationDoneWeiboText(), false);
         $this->render('registrationDone', array('user' => $user, 'accepted' => $registration->isAccepted(), 'competition' => $competition, 'registration' => $registration));
         Yii::app()->end();
     }
     $model = new Registration();
     $model->competition = $competition;
     if ($competition->isMultiLocation()) {
         $model->location_id = null;
     }
     if (isset($_POST['Registration'])) {
         $model->attributes = $_POST['Registration'];
         $model->user_id = $this->user->id;
         $model->competition_id = $competition->id;
         $model->total_fee = $model->getTotalFee(true);
         $model->ip = Yii::app()->request->getUserHostAddress();
         $model->date = time();
         $model->status = Registration::STATUS_WAITING;
         if ($competition->check_person == Competition::NOT_CHECK_PERSON && $competition->online_pay != Competition::ONLINE_PAY) {
             $model->status = Registration::STATUS_ACCEPTED;
         }
         if ($model->save()) {
             Yii::app()->mailer->sendRegistrationNotice($model);
             $this->setWeiboShareDefaultText($competition->getRegistrationDoneWeiboText(), false);
             $model->formatEvents();
             $this->render('registrationDone', array('user' => $user, 'accepted' => $model->isAccepted(), 'competition' => $competition, 'registration' => $model));
             Yii::app()->end();
         }
     }
     $model->formatEvents();
     $this->render('registration', array('competition' => $competition, 'model' => $model));
 }
开发者ID:sunshy360,项目名称:cubingchina,代码行数:55,代码来源:CompetitionController.php

示例14: Registration

$html->setH1('PŘIHLÁŠKY');
$html->addTitle("Přihlášky");
$html->addCss('<link rel="stylesheet" href="views/css/registration.css" type="text/css" media="screen">');
$html->addScript('<script src="js/registration.js"></script>');
$registration = new Registration();
$saved = "";
if (isset($_GET['saved']) && $_GET['saved'] == 1) {
    $saved = "Přihláška byla odeslána.";
}
$category_men = $registration->getCategories('m');
$category_women = $registration->getCategories('f');
if (isset($_POST['name'])) {
    $registration->setName($_POST['name']);
    $registration->setPohlavi($_POST['pohlavi']);
    $registration->setYear($_POST['year']);
    $registration->setClub($_POST['club']);
    $registration->setEmail($_POST['email']);
    $registration->setPoznamka($_POST['poznamka']);
    if ($registration->getPohlavi() == "m") {
        $registration->setCategory($_POST['category_m']);
    } else {
        $registration->setCategory($_POST['category_w']);
    }
    if ($registration->gerErr() == "") {
        $registration->save();
        header('Location: index.php?page=registration&saved=1');
    }
}
$list = (include 'controllers/registration/list.php');
$html->addToContent(include 'views/registration/form.php');
开发者ID:ununik,项目名称:DCRUN,代码行数:30,代码来源:registration.php


注:本文中的Registration::save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。