예제 #1
0
 public function register()
 {
     $data = Input::all();
     $rules = array('name' => 'min:2', 'email' => 'required|unique:registrations', 'course' => 'required', 'branch' => 'required', 'contact' => 'required', 'college' => 'required', 'year' => 'required');
     $validator = Validator::make($data, $rules);
     if ($validator->fails()) {
         // send back to the page with the input data and errors
         return "Looks Like You Have Already Registeres With This Email ID";
     } else {
         $last = Registration::all()->last();
         if ($last == null) {
             $last = 1;
         } else {
             $last = $last->id;
         }
         $registrations = new Registration();
         $registrations->name = $data['name'];
         $registrations->email = $data['email'];
         $registrations->course = $data['course'];
         $registrations->branch = $data['branch'];
         $registrations->contact = $data['contact'];
         $registrations->college = $data['college'];
         $registrations->year = $data['year'];
         $registrations->zeal_id = "zeal_onl_" . strval($last + 1);
         $registrations->save();
         return strtoupper($registrations->zeal_id);
     }
 }
예제 #2
0
 public function add($id)
 {
     // Es würede auch Funktionieren wenn ich ein Turnier erstelle und diesem Benutzer hinzufüge.. (bessere Lösung)..
     $userid = Auth::user()->id;
     $registration = new Registration();
     $registration->tournament()->associate(Tournament::find($id));
     $registration->user()->associate(User::find($userid));
     $registration->save();
     return $this->index($id);
     // methoden parameter request apramter
 }
예제 #3
0
 public function store(Request $request)
 {
     $messages = ['digits_between' => 'The :attribute must be :max digits.'];
     $v = Validator::make($request->all(), ['email1' => 'required|email', 'contact1' => 'required|integer|digits_between:10,10', 'name1' => 'required|string|max:255', 'college1' => 'required|string|max:255', 'email2' => 'required_with:contact2,name2,college2|email', 'name2' => 'required_with:contact2,email2,college2|string|max:255', 'contact2' => 'required_with:email2,name2,college2|integer|digits_between:10,10', 'college2' => 'required_with:contact2,email2,name2|string|max:255', 'email3' => 'required_with:contact3,name3,college3|email', 'name3' => 'required_with:contact3,email3,college3|string|max:255', 'contact3' => 'required_with:email3,name3,college3|integer|digits_between:10,10', 'college3' => 'required_with:contact3,email3,name3|string|max:255', 'email4' => 'required_with:contact4,name4,college4|email', 'name4' => 'required_with:contact4,email4,college4|string|max:255', 'contact4' => 'required_with:email4,name4,college4|integer|digits_between:10,10', 'college4' => 'required_with:contact4,email4,name4|string|max:255', 'abstract' => 'required|max:5000', 'file' => 'max:10240', 'g-recaptcha-response' => 'required|recaptcha'], $messages);
     //redirect to registration page with errors if there is any
     if ($v->fails()) {
         return redirect(action('HomeController@register'))->withErrors($v->errors())->withInput();
     }
     $registration = new Registration();
     $registration->email_1 = $request->email1;
     $registration->name_1 = $request->name1;
     $registration->contact_number_1 = $request->contact1;
     $registration->college_1 = $request->college1;
     $registration->email_2 = $request->email2;
     $registration->name_2 = $request->name2;
     $registration->contact_number_2 = $request->contact2;
     $registration->college_2 = $request->college2;
     $registration->email_3 = $request->email3;
     $registration->name_3 = $request->name3;
     $registration->contact_number_3 = $request->contact3;
     $registration->college_3 = $request->college3;
     $registration->email_4 = $request->email4;
     $registration->name_4 = $request->name4;
     $registration->contact_number_4 = $request->contact4;
     $registration->college_4 = $request->college4;
     $registration->abstract = $request->abstract;
     $registration->save();
     if ($request->file) {
         $destinationPath = base_path() . '/Upload/';
         // upload path
         $extension = $request->file('file')->getClientOriginalExtension();
         // getting file extension
         $fileName = $registration->id . '.' . $extension;
         // renameing image
         $request->file('file')->move($destinationPath, $fileName);
         $registration->file_name = $fileName;
         $registration->save();
     }
     return view('success');
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Requests\RegFormRequest $request)
 {
     $input = $request->all();
     $eduData = new Educations();
     $eduData->name_of_degree = $input['name_of_degree'];
     $eduData->subject = $input['subject'];
     $eduData->Year = $input['Year'];
     $eduData->board = $input['board'];
     $eduData->save();
     $lastEduId = $eduData->id;
     //dd($lastInsertedId);
     if (isset($input['img_path'])) {
         $Image = $input['img_path'];
         $Image = $this->imageUpload($Image);
         //dd($Image);
         $input['img_path'] = $Image;
     } else {
         $input['img_path'] = "reg_img/default.gif";
     }
     $regData = new Registration();
     $regData->bengali_name = $input['bengali_name'];
     $regData->english_name = $input['english_name'];
     $regData->father_name = $input['father_name'];
     $regData->mother_name = $input['mother_name'];
     $regData->date_of_birth = $input['date_of_birth'];
     $regData->village = $input['village'];
     $regData->post_office = $input['post_office'];
     $regData->upazila = $input['upazila'];
     $regData->district = $input['district'];
     $regData->id_code = $input['id_code'];
     $regData->organization = $input['organization'];
     $regData->telephone = $input['telephone'];
     $regData->fax = $input['fax'];
     $regData->e_mail = $input['e-mail'];
     $regData->mobile = $input['mobile'];
     $regData->joining_date = $input['joining_date'];
     $regData->service_code = $input['service_code'];
     $regData->marital_status = $input['marital_status'];
     $regData->contact_person_name = $input['contact_person_name'];
     $regData->contact_person_address = $input['contact_person_address'];
     $regData->contact_person_tel = $input['contact_person_tel'];
     $regData->participant_rel = $input['participant_rel'];
     $regData->img_path = $input['img_path'];
     $regData->edu_id = $lastEduId;
     $regData->user_id = 1;
     $regData->save();
     return redirect()->intended('registration/create');
 }
예제 #5
0
 public function saveRegistration($input)
 {
     $registration = new Registration();
     $registration->player_first_name = $input['player_first_name'];
     $registration->player_last_name = $input['player_last_name'];
     $registration->guardian_names = $input['guardian_names'];
     $registration->player_birthdate = Carbon::parse($input['player_birthdate']);
     $registration->player_email = $input['player_email'];
     $registration->player_phone_number = $input['player_phone_number'];
     $registration->emergency_contact = $input['emergency_contact'];
     $registration->emergency_phone_number = $input['emergency_phone_number'];
     $registration->player_previous_team = $input['player_previous_team'];
     $registration->player_conflicts = $input['player_conflicts'];
     $registration->save();
     return $registration;
 }
예제 #6
0
 public function store(Request $request)
 {
     // TODO: recent coursemajor must not match wil the current coursemajor
     $system = Api::systemValue();
     $coursemajor = DB::table('tbl_coursemajor')->where('course', $request->course)->where('major', $request->major)->first();
     $registration = new Registration();
     $registration->coursemajor = $coursemajor->id;
     $registration->student = $request->student;
     $registration->academicterm = $system->currentacademicterm;
     $registration->status = 'P';
     $registration->curriculum = Curriculum::getCurrentCurriculum($request->course, $request->major, $system);
     $registration->datecreated = date('Y-m-d');
     $registration->save();
     Session::flashdata('message', htmlAlert('Successfully Saved', 'success'));
     return redirect('shift_student');
 }
예제 #7
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(Request $request)
 {
     $registration = new Registration();
     $postData = Input::all();
     $messages = ['program.required' => 'Enter Program', 'specialty.required' => 'Enter Specialty', 'period.required' => 'Enter Period', 'user_id.required' => 'Enter User Id'];
     $rules = ['program' => 'required|integer|min:1|max:3', 'specialty' => 'required|integer|min:1|max:3', 'period' => 'required|integer|min:1|max:3', 'user_id' => 'required|integer|min:1'];
     $validator = Validator::make($postData, $rules, $messages);
     if ($validator->fails()) {
         // send back to the page with the input data and errors
         return Response::json(['Error' => ['message' => $validator->messages(), 'status_code' => 200]], 200);
     } else {
         // Do your stuff here.
         // send back to the page with success message
         $registration->program = $request->input('program');
         $registration->specialty = $request->input('specialty');
         $registration->period = $request->input('period');
         $registration->user_id = $request->input('user_id');
         $registration->save();
         return Response::json(['Success' => ['message' => 'Record Save Exits', 'status_code' => 200]], 200);
     }
 }
예제 #8
0
 public function register_new_student(NewStudentRegRequest $request)
 {
     DB::transaction(function () {
         $party = new Party();
         $party->firstname = $request->firstname;
         $party->lastname = $request->lastname;
         $party->middlename = $request->middlename;
         $party->sex = $request->gender;
         $party->placeofbirth = $request->pob;
         $party->dateofbirth = $request->dob;
         $party->mobilenumber = $request->contact;
         $party->religion = $request->religion;
         $party->emailaddress = $request->emailadd;
         $party->civilstatus = $request->maritalstatus;
         $party->legacyid = $this->system->laststudentid;
         $party->address1 = $request->mailing_add;
         // insert into party
         $party->save();
         // get the inserted id
         $party_id = $party->id;
         // set the laststudentid
         $this->setLastStudentId();
         $curriculum = Curriculum::getCurrentCurriculum($request->course, $request->major, $this->system);
         $coursemajor = DB::table('coursemajor')->where('course', $request->course)->where('major', $request->major)->first();
         $registration = new ModelRegistration();
         $registration->curriculum = $curriculum;
         $registration->student = $party_id;
         $registration->academicterm = $this->system->currentacademicterm;
         $registration->status = 'P';
         $registration->date = date('Y-m-d');
         $registration->coursemajor = $coursemajor->id;
         // insert into registration
         $registration->save();
         DB::table('tbl_student')->insert(['id' => $party_id, 'fathername' => $request->father_name, 'fatherproffession' => $request->father_occupation, 'mothername' => $request->mother_name, 'motherproffession' => $request->mother_occupation]);
         DB::table('tbl_useraccess')->insert(['id' => $party_id, 'username' => $request->username, 'password' => password_hash($request->password, PASSWORD_BCRYPT)]);
         // TODO: insert into tbl_useroption
     });
     Session::put('message', htmlAlert('Successfully Registered', 'success'));
     return back();
 }
예제 #9
0
 public function register($event_slug)
 {
     $json['errors'] = [];
     $json['messages'] = [];
     $event = Event::where('slug', $event_slug)->where('verified', true)->first();
     if (Session::has('id')) {
         $student = Student::where('id', Session::get('id'))->first();
         if ($event) {
             if (Registration::where('student_id', Session::get('id'))->where('event_id', $event->id)->first()) {
                 $json['errors'][] = "Already Registered";
             } else {
                 $round = $event->rounds->where('no', '1')->first();
                 $qualifier = new Qualifier();
                 $qualifier->save();
                 $round->qualifiers()->save($qualifier);
                 $student->qualifiers()->save($qualifier);
                 $registration = new Registration();
                 $registration->save();
                 $student->registrations()->save($registration);
                 $event->registrations()->save($registration);
                 $json['messages'][] = "successfull";
             }
         } else {
             $json['errors'][] = "Event dont exist";
         }
     } else {
         $json['errors'][] = "Please login to continue";
     }
     return response()->json($json);
 }
 /**
  * 支付挂号费
  *
  * @param Request      $request
  * @param Registration $registration
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function pay(Request $request, Registration $registration)
 {
     $user = $request->user();
     if ($user->id != $registration->user_id) {
         return response()->json(['status' => 1, 'message' => '无权限']);
     }
     if ($registration->is_paid == 1) {
         return response()->json(['status' => 8, 'message' => '已支付']);
     }
     $this->validate($request, ['payerAccount' => 'required|max:128']);
     $payerAccount = $request->get('payerAccount');
     $payeeAccount = '88888888';
     $state = RegistrationController::xxPay($payerAccount, $payeeAccount, $registration->fee);
     if ($state == 1) {
         $payDeal = new Deal();
         $payDeal->registration_id = $registration->id;
         $payDeal->fee = $registration->fee;
         $payDeal->payer_account = $payerAccount;
         $payDeal->payee_account = $payeeAccount;
         $payDeal->type = '付款';
         $registration->is_paid = 1;
         if ($payDeal->save()) {
             $registration->save();
             return response()->json(['status' => 0]);
         } else {
             return response()->json(['status' => 7, 'message' => '系统繁忙,请稍后再试']);
         }
     }
     return response()->json(['status' => 5, 'message' => '付款失败']);
 }