Ejemplo n.º 1
0
 /**
  * Show the view for stats
  *
  * @param MemberRequest $request
  * @return \Illuminate\Http\Response
  */
 public function store(MemberRequest $request)
 {
     $family = new family();
     $member = new member();
     $family->Agency = $request['Agency'];
     $family->letterdate = Carbon::now();
     $family->Address1 = $request['address1'];
     $family->address2 = $request['address2'];
     $family->city = $request['city'];
     $family->postalCode = $request['postalCode'];
     $family->PhoneNo = $request['PhoneNo'];
     $family->province = $request['province'];
     $family->StartDate = Carbon::now();
     $family->save();
     $FID = family::orderBy('FID', 'desc')->first()->FID;
     $member->Fname = $request['Fname'];
     $member->Lname = $request['Lname'];
     $member->Other = $request['Other'] == null ? false : true;
     $member->Clothing = $request['Clothing'] == null ? false : true;
     $member->Furniture = $request['Furniture'] == null ? false : true;
     $member->FID = $FID;
     $member->save();
     $MID = member::orderBy('MID', 'desc')->first()->MID;
     return redirect('members/' . $MID);
 }
 public function addmemberprofile(Requests\member $request)
 {
     try {
         $input = Request::all();
         $memberprofile = new member();
         $memberprofile->cus_id = $input['customer_id'];
         $memberprofile->fname = $input['first_name'];
         $memberprofile->lname = $input['last_name'];
         $memberprofile->contact_no = $input['telephone_number'];
         $memberprofile->NIC_Passport = $input['nic_passport'];
         $memberprofile->save();
         $changelog = new changes_log();
         $changelog->user = '******';
         $changelog->action_type = 'Add Member';
         $changelog->description = 'New member added for ' . $memberprofile->fname . " " . $memberprofile->lname;
         $changelog->save();
         return redirect('/guest_profile/member_list')->with('succ_status', 'Successfully Added');
     } catch (Exception $e) {
         return redirect('/guest_profile/member_list/create')->with(['exception' => 'You cannot add the Travel Agent.Please Chack you NIC and Contact No!']);
     }
 }