/**
  * 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='******'site/createOrg'));
         }
     }
     $this->render('create', array('model' => $model));
 }
コード例 #2
0
ファイル: Registration.php プロジェクト: abtris/retreatin
 /**
  * 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'] = "*****@*****.**";
     $options['to'] = $array['email'];
     $options['subject'] = $subject;
     $options['body'] = $body;
     ZFCore_Utils::sendEmail($options);
     // to admin
     $options['from'] = "*****@*****.**";
     $options['to'] = '*****@*****.**';
     $options['subject'] = "[RETREAT] new registration";
     $options['body'] = 'Add registration: ' . var_export($array, true);
     ZFCore_Utils::sendEmail($options);
 }
コード例 #3
0
ファイル: RegistrationAction.php プロジェクト: RSol/yupe
 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));
 }
コード例 #4
0
 /**
  * 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));
 }
コード例 #5
0
ファイル: RestController.php プロジェクト: WolfUser/UCLoL
 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('/');
 }
コード例 #6
0
    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"));
        }
    }
コード例 #7
0
 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();
         }
         // Receivables - Registration Costs
         $receivable = new Receivable();
         $receivable->project_id = Auth::user()->curr_project_id;
         $receivable->location_id = Auth::user()->location_id;
         $receivable->issue_id = $issue->id;
         $receivable->registration_id = $registration->id;
         $receivable->total = Input::get('total');
         $receivable->billable = Input::get('billable');
         $receivable->receivable = Input::get('receivables');
         $receivable->balance = Input::get('billable');
         if (Input::get('payment') == 0) {
             $receivable->payment = 'Cash';
         } else {
             $receivable->payment = 'Installment';
         }
         $receivable->save();
         $billable = Input::get('billable');
         $payment = Input::get('payment');
         if ((int) $payment > 0) {
             // First Installment
             $installment = new Installment();
             $installment->project_id = Auth::user()->curr_project_id;
             $installment->location_id = Auth::user()->location_id;
             $installment->receivable_id = $receivable->id;
             $installment->schedule = Input::get('registration_date');
             $installment->total = $billable / $payment;
             $installment->balance = $billable / $payment;
             $installment->paid = 0;
             $installment->save();
             // Extracting Date
             $dd = (int) substr(Input::get('registration_date'), 8, 2);
             $mm = (int) substr(Input::get('registration_date'), 5, 2);
             $yy = (int) substr(Input::get('registration_date'), 0, 4);
             if ($dd > 25) {
                 $mm += 2;
                 if ($mm > 12) {
                     $new_mm = $mm - 12;
                     $yy += 1;
                 } else {
                     $new_mm = $mm;
                 }
             } else {
                 $mm += 1;
                 if ($mm > 12) {
                     $new_mm = $mm - 12;
                     $yy += 1;
                 } else {
                     $new_mm = $mm;
                 }
             }
             for ($i = 2; $i <= $payment; $i++) {
                 $installment_date = $yy . '-' . str_pad($new_mm, 2, "0", STR_PAD_LEFT) . '-' . '05';
                 $installment = new Installment();
                 $installment->project_id = Auth::user()->curr_project_id;
                 $installment->location_id = Auth::user()->location_id;
                 $installment->receivable_id = $receivable->id;
                 $installment->schedule = date('Y-m-d', strtotime($installment_date));
                 $installment->total = $billable / $payment;
                 $installment->balance = $billable / $payment;
                 $installment->paid = 0;
                 $installment->save();
                 $new_mm += 1;
                 if ($new_mm > 12) {
                     $new_mm = $new_mm - 12;
                     $yy += 1;
                 }
             }
         }
         // Placements
         $courses = Input::get('course');
         foreach ($courses as $key => $value) {
             $course = explode("#", $value);
             $placement = new Placement();
             $placement->project_id = Auth::user()->curr_project_id;
             $placement->location_id = Auth::user()->location_id;
             $placement->registration_id = $registration->id;
             $placement->issue_id = $issue->id;
             $placement->course_id = $course[0];
             $placement->save();
         }
         // Reductions - Discounts
         $discounts = Input::get('discounts');
         if ($discounts) {
             foreach ($discounts as $key => $value) {
                 $discount = explode("#", $value);
                 $reduction = new Reduction();
                 $reduction->project_id = Auth::user()->curr_project_id;
                 $reduction->location_id = Auth::user()->location_id;
                 $reduction->registration_id = $registration->id;
                 $reduction->receivable_id = $receivable->id;
                 $reduction->reductable_type = 'Discount';
                 $reduction->reductable_id = $discount[0];
                 $reduction->save();
             }
         }
         // Reductions - Promotions
         $promotions = Input::get('promotions');
         if ($promotions) {
             foreach ($promotions as $key => $value) {
                 $promotion = explode("#", $value);
                 $reduction = new Reduction();
                 $reduction->project_id = Auth::user()->curr_project_id;
                 $reduction->location_id = Auth::user()->location_id;
                 $reduction->registration_id = $registration->id;
                 $reduction->receivable_id = $receivable->id;
                 $reduction->reductable_type = 'Promotion';
                 $reduction->reductable_id = $promotion[0];
                 $reduction->save();
             }
         }
         // Reductions - Vouchers
         $vouchers = Input::get('vouchers');
         if ($vouchers) {
             foreach ($vouchers as $key => $value) {
                 $voucher = explode("#", $value);
                 $reduction = new Reduction();
                 $reduction->project_id = Auth::user()->curr_project_id;
                 $reduction->location_id = Auth::user()->location_id;
                 $reduction->registration_id = $registration->id;
                 $reduction->receivable_id = $receivable->id;
                 $reduction->reductable_type = 'Voucher';
                 $reduction->reductable_id = $voucher[0];
                 $reduction->save();
             }
         }
         // Reductions - Charges
         $charges = Input::get('charges');
         if ($charges) {
             foreach ($charges as $key => $value) {
                 $charger = explode("#", $value);
                 $reduction = new Reduction();
                 $reduction->project_id = Auth::user()->curr_project_id;
                 $reduction->location_id = Auth::user()->location_id;
                 $reduction->registration_id = $registration->id;
                 $reduction->receivable_id = $receivable->id;
                 $reduction->reductable_type = 'Charge';
                 $reduction->reductable_id = $charger[0];
                 $reduction->save();
             }
         }
         // Updating Student Timelines
         $content = 'Bergabung menjadi Siswa One School ' . Auth::user()->location->name . 'untuk periode ' . Auth::user()->curr_project->name;
         $timeline = new Timeline();
         $timeline->project_id = Auth::user()->curr_project_id;
         $timeline->location_id = Auth::user()->location_id;
         $timeline->informable_type = 'Issue';
         $timeline->informable_id = $issue->id;
         $timeline->content = $content;
         $timeline->save();
         // Updating Employee Timeline
         $content = 'Menerima Pendaftaran Siswa untuk periode ' . Auth::user()->curr_project->name;
         $timeline = new Timeline();
         $timeline->project_id = Auth::user()->curr_project_id;
         $timeline->location_id = Auth::user()->location_id;
         $timeline->informable_type = 'Employee';
         $timeline->informable_id = Input::get('employee');
         $timeline->content = $content;
         $timeline->save();
         //DB::commit();
         return Response::json(array('status' => 'Succeed', 'registration_id' => $registration->id, 'issue_id' => $issue->id));
     } catch (Exception $e) {
         DB::rollback();
         return Response::json(array('status' => 'Failed', 'error' => $e));
     }
 }
コード例 #8
0
ファイル: actions.class.php プロジェクト: eyumay/srms.psco
 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();
             ## STUDENTCOURSEGRADE -----------> NEW COURSE RE-REGISTERED
             $student = new StudentCourseGrade();
             $student->setStudentId($this->studentId);
             $student->setRegistrationId($registration->getId());
             $student->setCourseId($this->courseId);
             $student->setIsRepeated(TRUE);
             $student->setIsCalculated(FALSE);
             $student->setRegradeStatus(2);
             $student->save();
             ## STUDENTCOURSEGRADE ------------> EXISTING COURSE / ONE NEEDED TO BE CHANGED
             $normalRegistration = Doctrine_Core::getTable('Registration')->getNormalRegistrationByEnrollmentId($this->enrollmentInfoId);
             $oldStudentCourseGrade = Doctrine_Core::getTable('StudentCourseGrade')->getRegisteredGradedCourse($normalRegistration->getId(), $this->studentId, $this->courseId);
             $oldStudentCourseGrade->setRegradeStatus(4);
             $oldStudentCourseGrade->save();
             //$this->showFormResult=TRUE;
             ##Do Logging!!
             $newLog = new AuditLog();
             $action = 'The Department Head has Activated  Student Regreade Process';
             $newLog->addNewLogInfo($this->getUser()->getAttribute('userId'), $action);
             $this->getUser()->setFlash('notice', 'Successfuly Activated Regrade Process');
             $this->redirect('regrade/studentRegradeDetail?sectionId=' . $this->programSectionId . '&studentId=' . $this->studentId . '&enrollmentId=' . $this->enrollmentId);
         }
     }
     #$this->sectionCourses   = Doctrine_Core::getTable('Course')->getCoursesByCourseIds($courseIds);
 }
コード例 #9
0
 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");
         }
     }
 }
コード例 #10
0
 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']));
         }
     }
 }
コード例 #11
0
ファイル: actions.class.php プロジェクト: eyumay/srms.psco
 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]
     }
 }
コード例 #12
0
ファイル: actions.class.php プロジェクト: eyumay/srms.psco
 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]
     }
 }
コード例 #13
0
 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));
 }
コード例 #14
0
ファイル: registration.php プロジェクト: ununik/DCRUN
$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');