예제 #1
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index($id)
 {
     if ($id != null || intval($id) > 0) {
         $user = Member::find(intval($id));
         $payment = Payment::filterByServiceAndMember(1, $user->id)->first();
         //membership
         $journal = Journal::where('payment_id', $payment->id);
         return view('backend.memberships.payment', compact('user', 'payment', 'journal'));
     }
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \App\Http\NoteRequest  $request
  * @return \Illuminate\Http\Response
  */
 public function store(NoteRequest $request)
 {
     $collection = Auth::user()->notes()->where('name', $request->get('name'))->get();
     if ($collection->isEmpty()) {
         $notes = new Note();
         $notes->fill($request->all());
         Auth::user()->notes()->save($notes);
     } else {
         $notes = $collection->first();
     }
     if ($request->has('journal')) {
         $jID = $request->get('journal');
         $journal = Journal::findOrFail($jID);
         $journal->notes()->attach($notes);
     }
     return redirect('/note');
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \App\Http\TriggerRequest  $request
  * @return \Illuminate\Http\Response
  */
 public function store(TriggerRequest $request)
 {
     $collection = Auth::user()->triggers()->where('name', $request->get('name'))->get();
     if ($collection->isEmpty()) {
         $trigger = new Trigger();
         $trigger->fill($request->all());
         Auth::user()->triggers()->save($trigger);
     } else {
         $trigger = $collection->first();
     }
     if ($request->has('journal')) {
         $jID = $request->get('journal');
         $journal = Journal::findOrFail($jID);
         $journal->triggers()->attach($trigger);
     }
     if (Session::has('backTo')) {
         Session::keep('backTo');
     }
     // pass it forward
     return ($returnPath = Session::get('backTo')) ? redirect($returnPath) : redirect('/trigger');
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \App\Http\MedicineRequest  $request
  * @return \Illuminate\Http\Response
  */
 public function store(MedicineRequest $request)
 {
     // keep backtrack token in the session one more step of the way.
     if (Session::has('backTo')) {
         Session::keep('backTo');
     } else {
         Session::flash('backTo', Request::fullUrl());
     }
     $collection = Auth::user()->medicines()->where('name', $request->get('name'))->get();
     if ($collection->isEmpty()) {
         $medicine = new Medicine();
         $medicine->fill($request->all());
         Auth::user()->medicines()->save($medicine);
     } else {
         $medicine = $collection->first();
     }
     if ($request->has('journal')) {
         $jID = $request->get('journal');
         $journal = Journal::findOrFail($jID);
         $journal->medicines()->attach($medicine);
     }
     return ($returnPath = Session::get('backTo')) ? redirect($returnPath) : redirect('/medicine');
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $journals = Journal::whereid($id)->firstOrfail();
     $journals->delete();
     return redirect('/journal');
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $journals = Journal::lists('title', 'id');
     $volume = Volume::whereid($id)->firstOrFail();
     return view('volume.edit', compact('volume', 'journals'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $journals = Journal::all();
     return view('public_journal.index', compact('journals'));
 }
예제 #8
0
 private function storeStudentIndividual()
 {
     $var = DB::transaction(function ($connection) {
         $membership_period = Input::get('membership-period');
         $salutation = Input::get('salutation');
         $fname = Input::get('fname');
         $mname = Input::get('mname');
         $lname = Input::get('lname');
         $card_name = Input::get('card_name');
         $dob = Input::get('dob');
         $gender = Input::get('gender');
         $country = Input::get('country');
         $state = Input::get('state');
         $address = Input::get('address');
         $city = Input::get('city');
         $pincode = Input::get('pincode');
         $stud_branch = Input::get('stud_branch');
         $college = Input::get('college');
         $course = Input::get('course');
         $cbranch = Input::get('cbranch');
         $cduration = Input::get('cduration');
         $email1 = Input::get('email1');
         $email2 = Input::get('email2');
         $std = Input::get('std');
         $phone = Input::get('phone');
         $country_code = Input::get('country-code');
         $mobile = Input::get('mobile');
         $paymentMode = Input::get('paymentMode');
         $tno = Input::get('tno');
         $drawn = Input::get('drawn');
         $bank = Input::get('bank');
         $branch = Input::get('branch');
         $paymentReciept = Input::file('paymentReciept');
         $amountPaid = Input::get('amountPaid');
         $student_branch = AcademicMember::Where('is_student_branch', $stud_branch)->first();
         $chapter = $student_branch->institution->member->csi_chapter_id;
         $member = new Member();
         $member->membership_id = 2;
         // individual member
         $membership_type = 3;
         // student member
         $member->csi_chapter_id = $chapter;
         $member->email = $email1;
         $member->email_extra = $email2;
         $member->password = bcrypt('1234');
         $member->save();
         $member->id;
         $filename = $member->id . '.';
         $filename .= $paymentReciept->getClientOriginalExtension();
         Address::create(['type_id' => 1, 'member_id' => $member->id, 'country_code' => $country, 'state_code' => $state, 'address_line_1' => $address, 'city' => $city, 'pincode' => $pincode]);
         Phone::create(['member_id' => $member->id, 'std_code' => $std, 'landline' => $phone, 'country_code' => $country_code, 'mobile' => $mobile]);
         $paymentReciept->move(storage_path('uploads/payment_proofs'), $filename);
         $individual = Individual::create(['member_id' => $member->id, 'membership_type_id' => $membership_type, 'salutation_id' => $salutation, 'first_name' => $fname, 'middle_name' => $mname, 'last_name' => $lname, 'card_name' => $card_name, 'gender' => $gender, 'dob' => $dob]);
         $student_details = StudentMember::create(['id' => $individual->id, 'student_branch_id' => $student_branch->id, 'college_name' => $college, 'course_name' => $course, 'course_branch' => $cbranch, 'course_duration' => $cduration]);
         // 2nd arg is currency.. needs to be queried to put here
         $head = PaymentHead::getHead($membership_period, 1)->first();
         $payment = Payment::create(['paid_for' => $member->id, 'payment_head_id' => $head->id, 'service_id' => 1]);
         $narration = Narration::create(['payer_id' => $member->id, 'mode' => $paymentMode, 'transaction_number' => $tno, 'bank' => $bank, 'branch' => $branch, 'date_of_payment' => $drawn, 'drafted_amount' => $head->amount, 'paid_amount' => $amountPaid, 'proof' => $filename]);
         $journal = Journal::create(['payment_id' => $payment->id, 'narration_id' => $narration->id]);
         if (!is_null($member->id) && $member->id > 0) {
             $user = $member;
         }
         return $member;
     });
     return $var;
 }
예제 #9
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker\Factory::create();
     /**
      * academic institution
      */
     factory(Member::class, 'institution', 5)->create()->each(function ($member) use($faker) {
         Address::create(['type_id' => 1, 'member_id' => $member->id, 'country_code' => 'IND', 'state_code' => CsiChapter::find($member->csi_chapter_id)->state->state_code, 'address_line_1' => $faker->streetAddress, 'city' => State::filterByStateCode(CsiChapter::find($member->csi_chapter_id)->state->state_code)->first()->name, 'pincode' => 110052]);
         $this->command->info('address done!');
         Phone::create(['member_id' => $member->id, 'std_code' => 011, 'landline' => 47028209, 'country_code' => 91, 'mobile' => 1234567890]);
         $this->command->info('phone done!');
         $institution = Institution::create(['member_id' => $member->id, 'membership_type_id' => 1, 'salutation_id' => 1, 'name' => $faker->company, 'head_name' => $faker->name, 'head_designation' => $faker->word, 'email' => $faker->email, 'mobile' => 1234567890]);
         $this->command->info('institution done!');
         AcademicMember::create(['id' => $institution->id, 'institution_type_id' => 2]);
         $this->command->info('academic done!');
         $head = PaymentHead::getHead(1, 1)->first();
         $payment = Payment::create(['paid_for' => $member->id, 'payment_head_id' => $head->id, 'service_id' => 1]);
         $this->command->info('payment done!' . $member->id);
         $narration = Narration::create(['payer_id' => $member->id, 'mode' => 1, 'transaction_number' => str_random(12), 'bank' => 'sbi', 'branch' => 'kamla nagar', 'date_of_payment' => $faker->date('d/m/Y'), 'drafted_amount' => $head->amount, 'proof' => '6.jpg']);
         $this->command->info('narration done!');
         Journal::create(['payment_id' => $payment->id, 'narration_id' => $narration->id, 'paid_amount' => $head->amount]);
         $this->command->info('Journal done!');
         RequestService::create(['service_id' => Service::getServiceIDByType('membership'), 'payment_id' => $payment->id, 'member_id' => $member->id]);
         $this->command->info('request done!');
     });
     /**
      * non academic institution
      */
     factory(Member::class, 'institution', 5)->create()->each(function ($member) use($faker) {
         Address::create(['type_id' => 1, 'member_id' => $member->id, 'country_code' => 'IND', 'state_code' => CsiChapter::find($member->csi_chapter_id)->state->state_code, 'address_line_1' => $faker->streetAddress, 'city' => State::filterByStateCode(CsiChapter::find($member->csi_chapter_id)->state->state_code)->first()->name, 'pincode' => 110052]);
         $this->command->info('address done!');
         Phone::create(['member_id' => $member->id, 'std_code' => 011, 'landline' => 47028209, 'country_code' => 91, 'mobile' => 1234567890]);
         $this->command->info('phone done!');
         $institution = Institution::create(['member_id' => $member->id, 'membership_type_id' => 2, 'salutation_id' => 1, 'name' => $faker->company, 'head_name' => $faker->name, 'head_designation' => $faker->word, 'email' => $faker->email, 'mobile' => 1234567890]);
         $this->command->info('institution done!');
         $head = PaymentHead::getHead(9, 1)->first();
         $payment = Payment::create(['paid_for' => $member->id, 'payment_head_id' => $head->id, 'service_id' => 1]);
         $this->command->info('payment done!' . $member->id);
         $narration = Narration::create(['payer_id' => $member->id, 'mode' => 1, 'transaction_number' => str_random(12), 'bank' => 'sbi', 'branch' => 'kamla nagar', 'date_of_payment' => $faker->date('d/m/Y'), 'drafted_amount' => $head->amount, 'proof' => '6.jpg']);
         $this->command->info('narration done!');
         Journal::create(['payment_id' => $payment->id, 'narration_id' => $narration->id, 'paid_amount' => $head->amount]);
         $this->command->info('Journal done!');
         RequestService::create(['service_id' => Service::getServiceIDByType('membership'), 'payment_id' => $payment->id, 'member_id' => $member->id]);
         $this->command->info('request done!');
     });
     /**
      * professional individual
      */
     factory(Member::class, 'individual', 5)->create()->each(function ($member) use($faker) {
         Address::create(['type_id' => 1, 'member_id' => $member->id, 'country_code' => 'IND', 'state_code' => CsiChapter::find($member->csi_chapter_id)->state->state_code, 'address_line_1' => $faker->streetAddress, 'city' => State::filterByStateCode(CsiChapter::find($member->csi_chapter_id)->state->state_code)->first()->name, 'pincode' => 110052]);
         $this->command->info('address done!');
         Phone::create(['member_id' => $member->id, 'std_code' => 011, 'landline' => 47028209, 'country_code' => 91, 'mobile' => 1234567890]);
         $this->command->info('phone done!');
         $individual = Individual::create(['member_id' => $member->id, 'membership_type_id' => 4, 'salutation_id' => $faker->randomElement(range(1, 5)), 'first_name' => $faker->firstName, 'middle_name' => $faker->word, 'last_name' => $faker->lastname, 'card_name' => $faker->name, 'gender' => $faker->randomElement(['m', 'f']), 'dob' => $faker->date('d/m/Y')]);
         $this->command->info('individual done!');
         $professional = ProfessionalMember::create(['id' => $individual->id, 'organisation' => $faker->company, 'designation' => $faker->word]);
         $this->command->info('professional done!');
         $head = PaymentHead::getHead(17, 1)->first();
         $payment = Payment::create(['paid_for' => $member->id, 'payment_head_id' => $head->id, 'service_id' => 1]);
         $this->command->info('payment done!' . $member->id);
         $narration = Narration::create(['payer_id' => $member->id, 'mode' => 1, 'transaction_number' => str_random(12), 'bank' => 'sbi', 'branch' => 'kamla nagar', 'date_of_payment' => $faker->date('d/m/Y'), 'drafted_amount' => $head->amount, 'proof' => '6.jpg']);
         $this->command->info('narration done!');
         Journal::create(['payment_id' => $payment->id, 'narration_id' => $narration->id, 'paid_amount' => $head->amount]);
         $this->command->info('Journal done!');
         RequestService::create(['service_id' => Service::getServiceIDByType('membership'), 'payment_id' => $payment->id, 'member_id' => $member->id]);
         $this->command->info('request done!');
     });
     /**
      * academic individual
      */
     factory(Member::class, 'individual', 5)->create()->each(function ($member) use($faker) {
         Address::create(['type_id' => 1, 'member_id' => $member->id, 'country_code' => 'IND', 'state_code' => CsiChapter::find($member->csi_chapter_id)->state->state_code, 'address_line_1' => $faker->streetAddress, 'city' => State::filterByStateCode(CsiChapter::find($member->csi_chapter_id)->state->state_code)->first()->name, 'pincode' => 110052]);
         $this->command->info('address done!');
         Phone::create(['member_id' => $member->id, 'std_code' => 011, 'landline' => 47028209, 'country_code' => 91, 'mobile' => 1234567890]);
         $this->command->info('phone done!');
         $individual = Individual::create(['member_id' => $member->id, 'membership_type_id' => 3, 'salutation_id' => $faker->randomElement(range(1, 5)), 'first_name' => $faker->firstName, 'middle_name' => $faker->word, 'last_name' => $faker->lastname, 'card_name' => $faker->name, 'gender' => $faker->randomElement(['m', 'f']), 'dob' => $faker->date('d/m/Y')]);
         $this->command->info('individual done!');
         $student_details = StudentMember::create(['id' => $individual->id, 'student_branch_id' => 1, 'college_name' => $faker->company, 'course_name' => $faker->word, 'course_branch' => $faker->word, 'course_duration' => 3]);
         $this->command->info('student done!');
         $head = PaymentHead::getHead(21, 1)->first();
         $payment = Payment::create(['paid_for' => $member->id, 'payment_head_id' => $head->id, 'service_id' => 1]);
         $this->command->info('payment done!' . $member->id);
         $narration = Narration::create(['payer_id' => $member->id, 'mode' => 1, 'transaction_number' => str_random(12), 'bank' => 'sbi', 'branch' => 'kamla nagar', 'date_of_payment' => $faker->date('d/m/Y'), 'drafted_amount' => $head->amount, 'proof' => '6.jpg']);
         $this->command->info('narration done!');
         Journal::create(['payment_id' => $payment->id, 'narration_id' => $narration->id, 'paid_amount' => $head->amount]);
         $this->command->info('Journal done!');
         RequestService::create(['service_id' => Service::getServiceIDByType('membership'), 'payment_id' => $payment->id, 'member_id' => $member->id]);
         $this->command->info('request done!');
     });
 }
 public function destroy(Journal $journal)
 {
     $journal->delete();
     $journals = Journal::all();
     return ($returnPath = Session::get('backTo')) ? redirect($returnPath) : redirect('/journal');
 }
 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function Volumes($id)
 {
     $journal = Journal::where('id', '=', $id)->pluck('title');
     $volumes = Volume::wherejournals_id($id)->get();
     return view('public_journal.volumes', compact('volumes', 'journal'));
 }