コード例 #1
0
 /**
  * Show the application registration form.
  *
  * @return \Illuminate\Http\Response
  */
 public function getRegister()
 {
     $positions = Positions::all();
     $shifts = Shifts::all();
     $data = array('positions_all' => $positions, 'shifts' => $shifts);
     return view('auth.register')->with($data);
 }
コード例 #2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $inboxNotif = $this->inboxNotif();
     $approvalNotif = $this->approvalNotif();
     $profileImage = $this->getImage();
     $positions = $this->position();
     $positions_all = Positions::all();
     $user_position = Auth::user()->position_id;
     $empDepartment = Positions::find($user_position)->departments;
     $count = $this->forms();
     $data = array('title' => 'Edit Profile', 'positions' => $positions, 'positions_all' => $positions_all, 'profileImage' => $profileImage, 'inboxNotif' => $inboxNotif, 'approvalNotif' => $approvalNotif, 'empDepartment' => $empDepartment, 'count' => $count);
     return view('auth.editProfile')->with($data);
 }
コード例 #3
0
 public function addPosition(Request $request)
 {
     if ($request->input('position_name') == '') {
         return redirect('/accounts');
     } else {
         $positions = Positions::all();
         foreach ($positions as $position) {
             if (strcasecmp($position->position_name, $request->input('position_name')) == 0) {
                 $status = "Position is already exist!";
                 return redirect('/accounts')->with('status', $status);
             }
         }
         $result = Positions::create(['position_name' => $request->input('position_name'), 'department_id' => $request->input('department')]);
         if ($result) {
             $status = "Success!";
         } else {
             $status = "Failed!";
         }
         return redirect('/accounts')->with('status', $status);
     }
     // dd($request->all());
     // echo $request->input('department');
 }