Пример #1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $data = Employee::all();
     $name = Auth::user()->name;
     $pos = ProjectOfficer::all();
     $adms = Admin::all();
     $tls = Teamleader::all();
     $mems = Member::all();
     return view('dropmin.dashboard.index')->with('data', $name)->with('pos', $pos)->with('adms', $adms)->with('tls', $tls)->with('mems', $mems)->with('data', $data);
 }
Пример #2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $data = Employee::all();
     $name = Auth::user()->name;
     $pos = ProjectOfficer::all();
     $adms = Admin::all();
     $tls = Teamleader::all();
     $mems = Member::all();
     $proj = Project::all();
     $ac = Auth::user()->id;
     $acc = AccessClient::where('id_users', $ac)->get();
     return view('dropmin.dashboard.index')->with('data', $name)->with('pos', $pos)->with('adms', $adms)->with('tls', $tls)->with('mems', $mems)->with('projs', $proj)->with('accss', $acc)->with('datas', $data);
 }
Пример #3
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     // Start Check Authorization
     $invalid_auth = 1;
     $authRole = Auth::user()->UserRoles->role;
     if ($authRole == 1 or $authRole == 3 or $authRole == 5 or $authRole == 7 or $authRole == 9) {
         $invalid_auth = 0;
     }
     if ($invalid_auth == 1) {
         Alert::error('Anda tidak memilik akses ini')->persistent('close');
         return redirect('dashboard');
     }
     // End Check Authorization
     $data = Employee::all();
     $name = Auth::user()->name;
     $pos = ProjectOfficer::all();
     $adms = Admin::all();
     $tls = Teamleader::all();
     $mems = Member::all();
     return view('dropmin.record.index')->with('data', $name)->with('pos', $pos)->with('adms', $adms)->with('tls', $tls)->with('mems', $mems)->with('datas', $data);
 }
Пример #4
0
 public function Fired($id, $get, $id_par, $id_emplo)
 {
     // Start Check Authorization
     /**
      * 1. FullAccess - 1
      * 2. HRD - 3
      * 3. Creator - 5
      * 4. Handler - 7
      */
     $invalid_auth = 1;
     $authRole = Auth::user()->UserRoles->role;
     if ($authRole == 7 or $authRole == 1 or $authRole == 3) {
         $invalid_auth = 0;
     }
     if ($invalid_auth == 1) {
         Alert::error('Anda tidak memilik akses ini')->persistent('close');
         return redirect('project/view/' . $id);
     }
     // End Check Authorization
     $now = date('Y-m-d');
     $gat = str_replace('_', ' ', $get);
     $got = ucfirst($gat);
     if ($get == 'admin') {
         $admin = Admin::find($id_par);
         $admin->status = 0;
         $admin->end = $now;
         $admin->save();
     } elseif ($get == 'project_officer') {
         $po = ProjectOfficer::find($id_par);
         $po->status = 0;
         $po->end = $now;
         $po->save();
     } elseif ($get == 'teamleader') {
         $po = Teamleader::find($id_par);
         $po->status = 0;
         $po->end = $now;
         $po->save();
     }
     $emplo = Employee::find($id_emplo);
     $emplo->status = 0;
     $emplo->save();
     Alert::success('Sukses memberhentikan ' . $got)->persistent("Close");
     return redirect('project/view/' . $id);
 }
Пример #5
0
 public function Fired($id, $get, $id_par, $id_emplo)
 {
     $now = date('Y-m-d');
     $gat = str_replace('_', ' ', $get);
     $got = ucfirst($gat);
     if ($get == 'admin') {
         $admin = Admin::find($id_par);
         $admin->status = 0;
         $admin->end = $now;
         $admin->save();
     } elseif ($get == 'project_officer') {
         $po = ProjectOfficer::find($id_par);
         $po->status = 0;
         $po->end = $now;
         $po->save();
     } elseif ($get == 'teamleader') {
         $po = Teamleader::find($id_par);
         $po->status = 0;
         $po->end = $now;
         $po->save();
     }
     $emplo = Employee::find($id_emplo);
     $emplo->status = 0;
     $emplo->save();
     Alert::success('Sukses memberhentikan ' . $got)->persistent("Close");
     return redirect('project/view/' . $id);
 }
Пример #6
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $data = Employee::find($id);
     $province = Province::all();
     $cities = City::all();
     $citmin = City::whereRaw('id = (select min(`id`) from cities)')->get();
     $citmax = City::whereRaw('id = (select max(`id`) from cities)')->get();
     $grade = Grade::all();
     $jabatans = Jabatan::all();
     $pt = array('sd' => 'SD', 'smp' => 'SMP', 'sma' => 'SMA', 'd3' => 'D3', 's1' => 'S1', 'S2' => 'S2');
     $citsel = unserialize($data->id_cities);
     $tls = Teamleader::where('id_users', $data->id)->get();
     $pos = ProjectOfficer::where('id_users', $data->id)->get();
     $adms = Admin::where('id_users', $data->id)->get();
     return view('dropmin/data/edit')->with('data', $data)->with('province', $province)->with('grade', $grade)->with('tls', $tls)->with('pos', $pos)->with('adms', $adms)->with('jabatans', $jabatans)->with('pt', $pt)->with('citsel', $citsel)->with('cities', $cities);
 }
Пример #7
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     // Start Check Authorization
     /**
      * 1. FullAccess - 1
      * 2. HRD - 3
      * 3. Creator - 5
      * 4. Handler - 7
      */
     $invalid_auth = 1;
     $authRole = Auth::user()->UserRoles->role;
     if ($authRole == 7 or $authRole == 1 or $authRole == 3) {
         $invalid_auth = 0;
     }
     if ($invalid_auth == 1) {
         Alert::error('Anda tidak memilik akses ini')->persistent('close');
         return redirect('data/list');
     }
     // End Check Authorization
     $data = Employee::find($id);
     $province = Province::all();
     $cities = City::all();
     $citmin = City::whereRaw('id = (select min(`id`) from cities)')->get();
     $citmax = City::whereRaw('id = (select max(`id`) from cities)')->get();
     $grade = Grade::all();
     $jabatans = Jabatan::all();
     $pt = array('sd' => 'SD', 'smp' => 'SMP', 'sma' => 'SMA', 'd3' => 'D3', 's1' => 'S1', 'S2' => 'S2');
     $citsel = unserialize($data->id_cities);
     $tls = Teamleader::where('id_users', $data->id)->get();
     $pos = ProjectOfficer::where('id_users', $data->id)->get();
     $adms = Admin::where('id_users', $data->id)->get();
     return view('dropmin/data/edit')->with('data', $data)->with('province', $province)->with('grade', $grade)->with('tls', $tls)->with('pos', $pos)->with('adms', $adms)->with('jabatans', $jabatans)->with('pt', $pt)->with('citsel', $citsel)->with('cities', $cities);
 }