public function signin()
 {
     $personnel = new Personnel();
     $personnel->serviceno = Input::get('serviceno');
     $personnel_credentials = Personnel::where('serviceno', $personnel->serviceno)->first();
     return view('clients.index', compact('personnel_credentials'));
 }
Esempio n. 2
0
 public function index()
 {
     $army = Personnel::where('depart', 'Army')->count();
     $navy = Personnel::where('depart', 'Navy')->count();
     $airforce = Personnel::where('depart', 'Airforce')->count();
     return view('index', compact('army', 'navy', 'airforce'));
 }
 public function update_nominated_for()
 {
     $action = Input::get('action');
     if (Input::has('nominate')) {
         switch ($action) {
             case 'Peace Keeping':
                 foreach (Input::get('nominate') as $p) {
                     $personnel = Personnel::find($p);
                     $personnel->nominated_for_peace = 1;
                     $personnel->save();
                 }
                 break;
             case 'Promotion':
                 foreach (Input::get('nominate') as $p) {
                     $personnel = Personnel::find($p);
                     $personnel->nominated_for_prom = 1;
                     $personnel->save();
                 }
                 break;
             case 'Courses':
                 foreach (Input::get('nominate') as $p) {
                     $personnel = Personnel::find($p);
                     $personnel->nominated_for_course = 1;
                     $personnel->save();
                 }
                 break;
             case 'Remove peace':
                 foreach (Input::get('nominate') as $p) {
                     $personnel = Personnel::find($p);
                     $personnel->nominated_for_peace = 0;
                     $personnel->save();
                 }
                 break;
             case 'Remove course':
                 foreach (Input::get('nominate') as $p) {
                     $personnel = Personnel::find($p);
                     $personnel->nominated_for_course = 0;
                     $personnel->save();
                 }
                 break;
                 //                case 'Army':
                 //                $view_army = Personnel::where('depart','Army')->get();
                 //                return view('promote_army',compact('view_army'));
                 //                break;
                 //                case 'Airforce':
                 //                    $view_army = Personnel::where('depart','Airforce')->get();
                 //                    return view('promote_airforce',compact('view_airforce'));
                 //                    break;
                 //                case 'Navy':
                 //                    $view_army = Personnel::where('depart','Navy')->get();
                 //                    return view('promote_navy',compact('view_navy'));
                 //                    break;
             //                case 'Army':
             //                $view_army = Personnel::where('depart','Army')->get();
             //                return view('promote_army',compact('view_army'));
             //                break;
             //                case 'Airforce':
             //                    $view_army = Personnel::where('depart','Airforce')->get();
             //                    return view('promote_airforce',compact('view_airforce'));
             //                    break;
             //                case 'Navy':
             //                    $view_army = Personnel::where('depart','Navy')->get();
             //                    return view('promote_navy',compact('view_navy'));
             //                    break;
             case 'Undo_promote':
                 foreach (Input::get('nominate') as $p) {
                     $personnel = Personnel::find($p);
                     $personnel->nominated_for_prom = 0;
                     $personnel->save();
                 }
                 break;
             default:
                 # code...
                 break;
         }
     }
     return Redirect()->back();
 }