Exemplo n.º 1
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     //dd($request);
     $patient = new Patient([]);
     $patient->save();
     $patient_info = new PersonalInformation(['patient_id' => $patient->id, 'last_name' => $request->get('last_name'), 'first_name' => $request->get('first_name'), 'middle_name' => $request->get('middle_name'), 'birth_date' => $request->get('birth_date'), 'gender' => $request->get('gender'), 'civil_status' => $request->get('civil_status'), 'house_no' => $request->get('address'), 'street' => $request->get('address'), 'barangay' => $request->get('address'), 'municipality' => $request->get('address'), 'province' => $request->get('address')]);
     $patient_info->save();
     $referral = new Referral(['urgent' => $request->get('urgent'), 'reason' => $request->get('referral_reason'), 'patient_id' => $patient->id, 'chief_complaint' => $request->get('chief_complaint'), 'history' => $request->get('history'), 'exams_performed' => $request->get('exams_performed'), 'treatment_medication' => 'treatment_medication', 'operation_performed' => $request->get('operation_performed'), 'diagnosis' => $request->get('diagnosis'), 'remarks' => $request->get('remarks')]);
     $referral->save();
     //dd($referral);
     $user_referral = new UserReferral(['referral_id' => $referral->id, 'user_id' => Auth::user()->id, 'placeholder_id' => 1, 'is_read' => 0, 'is_important' => $referral->urgent, 'receiver_id' => $request->get('referred_to')]);
     //dd($user_referral);
     $user_referral->save();
     return redirect('hhway/referrals');
 }
Exemplo n.º 2
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $det = PersonalInformation::where('id', $id)->first();
     if ($det) {
         $ag = Member::where('id', $det->agent_id)->first();
         $em = Member::where('id', $det->approved_by)->first();
         return view('resume.approvalDetail')->with('det', $det)->with('ag', $ag)->with('em', $em);
     }
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     if ($id != 0) {
         $resumdel1 = PersonalInformation::where('id', $id)->delete();
         $resumdel2 = EducationalInformation::where('pid', $id)->delete();
         $resumdel3 = WorkInformation::where('pid', $id)->delete();
         $resumdel4 = Language::where('pid', $id)->delete();
         $resumdel5 = SkillsInformation::where('pid', $id)->delete();
         $resumdel = AdditionalInformation::where('pid', $id)->delete();
         $resumdel = UploadInformation::where('pid', $id)->delete();
         $resumdel = PrivacyInformation::where('pid', $id)->delete();
     } else {
         $deleteChecked = Input::get('resume');
         if ($deleteChecked) {
             foreach ($deleteChecked as $delete) {
                 $resumdel1 = PersonalInformation::where('id', $delete)->delete();
                 $resumdel2 = EducationalInformation::where('pid', $delete)->delete();
                 $resumdel3 = WorkInformation::where('pid', $delete)->delete();
                 $resumdel4 = Language::where('pid', $delete)->delete();
                 $resumdel5 = SkillsInformation::where('pid', $delete)->delete();
                 $resumdel = AdditionalInformation::where('pid', $delete)->delete();
                 $resumdel = UploadInformation::where('pid', $delete)->delete();
                 $resumdel = PrivacyInformation::where('pid', $delete)->delete();
             }
             Session::flash('message', 'Successfully deleted');
             $history = new History();
             $history->action_id = 0;
             $history->action = 'Resume deleted';
             $history->user = Auth::user()->name;
             $history->remark = 'Number of Resume deleted=' . count($deleteChecked);
             $history->save();
         } else {
             Session::flash('nrmessage', 'Resume are not Selected');
         }
     }
     return Redirect::to('resume');
 }
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Request $request)
 {
     $resume = PersonalInformation::where('country', 'LIKE', '%' . $request['country'] . '%')->where('fname', 'LIKE', '%' . $request['name'] . '%')->where('lname', 'LIKE', '%' . $request['name'] . '%')->get();
     //return $resume;
     return view('search')->with('resume', $resume);
 }
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create(Request $request)
 {
     if ($request['todate']) {
         $tdate = date("Y-m-d h:m:s", strtotime($request['todate']));
     } else {
         $tdate = date("Y-m-d h:m:s");
     }
     if ($request['fromdate']) {
         $fdate = date("Y-m-d h:m:s", strtotime($request['fromdate']));
     } else {
         $fdate = date("Y-m-d h:m:s");
     }
     if (Auth::user()->type == 1 && Auth::user()->loginas == 1) {
         $admin = count(Member::select('id')->where('type', 1)->whereBetween('created_at', [$fdate, $tdate])->get());
         $employer = count(Member::select('id')->where('type', 2)->whereBetween('created_at', [$fdate, $tdate])->get());
         $agent = count(Member::select('id')->where('type', 3)->whereBetween('created_at', [$fdate, $tdate])->get());
         $adminblock = count(Member::select('id')->whereTypeAndStatus(1, 0)->whereBetween('created_at', [$fdate, $tdate])->get());
         $employerblock = count(Member::select('id')->whereTypeAndStatus(2, 0)->whereBetween('created_at', [$fdate, $tdate])->get());
         $agentblock = count(Member::select('id')->whereTypeAndStatus(3, 0)->whereBetween('created_at', [$fdate, $tdate])->get());
         $resume = count(PersonalInformation::select('id')->whereBetween('created_at', [$fdate, $tdate])->get());
         $resumerequest = count(PersonalInformation::select('id')->where('approved_by', '!=', 0)->whereBetween('created_at', [$fdate, $tdate])->get());
         $resumeapproved = count(PersonalInformation::select('id')->where('approval_status', 1)->whereBetween('created_at', [$fdate, $tdate])->get());
         $demand = count(Demand::select('id')->whereBetween('created_at', [$fdate, $tdate])->get());
         return view('history.index')->with('admin', $admin)->with('employer', $employer)->with('agent', $agent)->with('adminblock', $adminblock)->with('employerblock', $employerblock)->with('agentblock', $agentblock)->with('resume', $resume)->with('resumerequest', $resumerequest)->with('resumeapproved', $resumeapproved)->with('demand', $demand);
     } else {
         if (Auth::user()->loginas == 2) {
             $resume = count(PersonalInformation::select('id')->whereBetween('created_at', [$fdate, $tdate])->get());
             $resumerequest = count(EmployerApproval::select('apid')->whereEmpid(Auth::user()->id)->whereBetween('created_at', [$fdate, $tdate])->get());
             $resumeapproved = count(PersonalInformation::select('id')->whereApproval_statusAndApproved_by(1, Auth::user()->id)->whereBetween('created_at', [$fdate, $tdate])->get());
             $demand = count(Demand::select('id')->whereEid(Auth::user()->id)->whereBetween('created_at', [$fdate, $tdate])->get());
             return view('history.index')->with('resume', $resume)->with('resumerequest', $resumerequest)->with('resumeapproved', $resumeapproved)->with('demand', $demand);
         } else {
             $resume = count(PersonalInformation::select('id')->where('agent_id', Auth::user()->id)->whereBetween('created_at', [$fdate, $tdate])->get());
             $resumerequest = count(PersonalInformation::select('id')->where('agent_id', Auth::user()->id)->where('approved_by', '!=', 0)->whereBetween('created_at', [$fdate, $tdate])->get());
             $resumeapproved = count(PersonalInformation::select('id')->where('agent_id', Auth::user()->id)->where('approval_status', 1)->whereBetween('created_at', [$fdate, $tdate])->get());
             $demand = count(Demand::select('id')->whereBetween('created_at', [$fdate, $tdate])->get());
             return view('history.index')->with('resume', $resume)->with('resumerequest', $resumerequest)->with('resumeapproved', $resumeapproved)->with('demand', $demand);
         }
     }
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     if ($id != 0) {
         $resumdel1 = PersonalInformation::where('id', $id)->delete();
         $resumdel2 = EducationalInformation::where('pid', $id)->delete();
         $resumdel3 = WorkInformation::where('pid', $id)->delete();
         $resumdel4 = Language::where('pid', $id)->delete();
         $resumdel5 = SkillsInformation::where('pid', $id)->delete();
         $resumdel = AdditionalInformation::where('pid', $id)->delete();
         $resumdel = UploadInformation::where('pid', $id)->delete();
         $resumdel = PrivacyInformation::where('pid', $id)->delete();
     } else {
         $deleteChecked = Input::get('resume');
         if ($deleteChecked) {
             foreach ($deleteChecked as $delete) {
                 $resumdel1 = PersonalInformation::where('id', $delete)->delete();
                 $resumdel2 = EducationalInformation::where('pid', $delete)->delete();
                 $resumdel3 = WorkInformation::where('pid', $delete)->delete();
                 $resumdel4 = Language::where('pid', $delete)->delete();
                 $resumdel5 = SkillsInformation::where('pid', $delete)->delete();
                 $resumdel = AdditionalInformation::where('pid', $delete)->delete();
                 $resumdel = UploadInformation::where('pid', $delete)->delete();
                 $resumdel = PrivacyInformation::where('pid', $delete)->delete();
             }
         }
     }
     Session::flash('message', 'Successfully deleted');
     return Redirect::to('resume');
 }
 public function resume_preview($id)
 {
     $personal = PersonalInformation::where('id', $id)->first();
     $phd1 = DB::table('educationinformation')->where('pid', $id)->get();
     $experience = WorkInformation::where('pid', $personal->id)->first();
     $skills = SkillsInformation::where('pid', $personal->id)->get();
     $additional = AdditionalInformation::where('pid', $personal->id)->first();
     $language = Language::where('pid', $personal->id)->get();
     $upload = UploadInformation::where('pid', $personal->id)->first();
     $privacy = PrivacyInformation::where('pid', $personal->id)->first();
     return view('resume')->with('personal', $personal)->with('phd1', $phd1)->with('experience', $experience)->with('skills', $skills)->with('additional', $additional)->with('language', $language)->with('upload', $upload);
 }