public function listKaryawan()
 {
     if (Auth::check() && Auth::user()->id_jabatan == '2') {
         $listKaryawan = Karyawan::where("id_divisi", "=", Auth::user()->id_divisi)->where("id_karyawan", "!=", Auth::user()->id_karyawan)->paginate(10);
         $getNotice = Notice::byDivisi(Auth::user()->id_divisi);
         return view('karyawan/karyawan')->with('listKaryawan', $listKaryawan)->with('getNotice', $getNotice);
     } else {
         return view('errors/403');
     }
 }
 /**
  * Tampil halaman pengaturan ganti password.
  *
  * @return string
  */
 public function pengaturan()
 {
     if (Auth::check()) {
         $id_karyawan = Auth::user()->id_karyawan;
         $today = date('Y-m-d');
         $getNotice = Notice::byDivisi(Auth::user()->id_divisi);
         return view('dashboard/pengaturan')->with("getNotice", $getNotice);
     } else {
         return \Redirect::to('login');
     }
 }
 public function index()
 {
     if (Auth::check()) {
         $today = date("Y-m-d");
         $id_karyawan = Auth::user()->id_karyawan;
         $getNotice = Notice::where("id_karyawan", "=", $id_karyawan)->where("tanggal", "=", $today)->get();
         return \View::make('karyawan.profile')->with('getNotice', $getNotice);
     } else {
         return \Redirect::to('login');
     }
 }
 public function update(Request $request, $id)
 {
     if (Auth::check() && Auth::user()->id_jabatan == '2') {
         $getNotice = Notice::byDivisi(Auth::user()->id_divisi);
         $data = Reqmodel::find($id);
         $data->status = "Accept";
         $data->save();
         return \Redirect::to('request');
     } else {
         return view('errors/403');
     }
 }
 /**
  * Display a listing of the resource.
  *
  * @return string Data absen karyawan dan pengumuman.
  */
 public function index()
 {
     if (Auth::check()) {
         $id_karyawan = Auth::user()->id_karyawan;
         $today = date("Y-m-d");
         $absen = Absen::where("id_karyawan", "=", $id_karyawan)->orderBy("id_absen", "DESC")->paginate(10);
         $getNotice = Notice::byDivisi(Auth::user()->id_divisi);
         return view('absen/index')->with("absen", $absen)->with("getNotice", $getNotice);
     } else {
         return \Redirect::to('login');
     }
 }
 /**
  * Display a listing of the resource.
  *
  * @return string Data pengumuman.
  */
 public function index()
 {
     //
     if (Auth::check()) {
         $id_karyawan = Auth::user()->id_karyawan;
         $today = date("Y-m-d");
         $notice = Notice::orWhere('id_divisi', '0')->orWhere('id_divisi', Auth::user()->id_divisi)->where("tanggal", "=", $today)->paginate(10);
         $getNotice = Notice::byDivisi(Auth::user()->id_divisi);
         return view('pengumuman/index')->with("notice", $notice)->with("getNotice", $getNotice);
     } else {
         return \Redirect::to('login');
     }
 }
 /**
  * Menampilkan daftar laporan dan pengumuman berdasarkan user.
  *
  * @return string
  */
 public function index()
 {
     //
     if (Auth::check()) {
         $id_karyawan = Auth::user()->id_karyawan;
         $today = date("Y-m-d");
         $report = Laporan::where("id_karyawan", "=", $id_karyawan)->paginate(10);
         $getNotice = Notice::byDivisi(Auth::user()->id_divisi);
         return view('laporan/index')->with("report", $report)->with("getNotice", $getNotice);
     } else {
         return \Redirect::to('login');
     }
 }
 /**
  * Edit data pengumuman.
  *
  * @return integer
  */
 public function update($id)
 {
     if (Auth::check() && Auth::user()->id_karyawan == '1') {
         $data = Notice::find($id);
         $data->id_divisi = \Input::get('divisi');
         $tgl = explode("/", \Input::get('tanggal'));
         $data->tanggal = $tgl[2] . "-" . $tgl[0] . "-" . $tgl[1];
         $data->isi = \Input::get('isi');
         $data->save();
         return \Redirect::to('admin/karyawan');
     } else {
         return view('errors/403');
     }
 }
 /**
  * Display a listing of the resource.
  *
  * @return string Data pengumuman.
  */
 public function index()
 {
     //
     if (Auth::check()) {
         $id_karyawan = Auth::user()->id_karyawan;
         $today = date("Y-m-d");
         $notice = pModel::where("id_karyawan", "=", $id_karyawan)->paginate(10);
         $getNotice = pModel::where("id_karyawan", "=", $id_karyawan)->where("tanggal", "=", $today)->get();
         \DB::table('logs')->insert(['id_karyawan' => $id_karyawan, 'content' => Auth::user()->username . ' akses halaman daftar pengumuman', 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s')]);
         return view('pengumuman/index')->with("notice", $notice)->with("getNotice", $getNotice);
     } else {
         return \Redirect::to('login');
     }
 }
 /**
  * Display a listing of the resource.
  *
  * @return string Data shift dan request.
  */
 public function index()
 {
     //
     if (Auth::check()) {
         $id_karyawan = Auth::user()->id_karyawan;
         $today = date("Y-m-d");
         $getNotice = Notice::byDivisi(Auth::user()->id_divisi);
         $shift = \DB::table('shift')->get();
         $month_end = date('Y-m-d', strtotime('last day of this month', time()));
         $shiftLine = Shift::join("shift", "shift_line.id_shift", "=", "shift.id_shift")->where("id_karyawan", "=", $id_karyawan)->whereBetween("tanggal_shift", array($today, $month_end))->orderBy("id_shiftline")->get();
         $req = rModel::join("shift_line", "request.shift_lama", "=", "shift_line.tanggal_shift")->where("request.id_karyawan", "=", "{$id_karyawan}")->orderBy("id", "DESC")->first();
         return view('shift/index')->with("getNotice", $getNotice)->with("shift", $shift)->with("shiftLine", $shiftLine)->with("req", $req);
     } else {
         return \Redirect::to('login');
     }
 }
Example #11
0
 /**
  * Display a listing of the resource.
  *
  * @return string Data shift dan request.
  */
 public function index()
 {
     //
     if (Auth::check()) {
         $id_karyawan = Auth::user()->id_karyawan;
         $today = date("Y-m-d");
         $getNotice = Notice::where("id_karyawan", "=", $id_karyawan)->where("tanggal", "=", $today)->get();
         $shift = \DB::table('shift')->get();
         $month_end = date('Y-m-d', strtotime('last day of this month', time()));
         $shiftLine = Shift::join("shift", "shift_line.id_shift", "=", "shift.id_shift")->where("id_karyawan", "=", $id_karyawan)->whereBetween("tanggal_shift", array($today, $month_end))->orderBy("id_shiftline")->get();
         $req = rModel::where("id_karyawan", "=", $id_karyawan)->orderBy("id", "DESC")->first();
         \DB::table('logs')->insert(['id_karyawan' => $id_karyawan, 'content' => Auth::user()->username . ' akses halaman daftar shift', 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s')]);
         return view('shift/index')->with("getNotice", $getNotice)->with("shift", $shift)->with("shiftLine", $shiftLine)->with("req", $req);
     } else {
         return \Redirect::to('login');
     }
 }
Example #12
0
 /**
  * Tampil halaman pengaturan ganti password.
  *
  * @return string
  */
 public function pengaturan()
 {
     if (Auth::check()) {
         $id_karyawan = Auth::user()->id_karyawan;
         $today = date('Y-m-d');
         $getNotice = pModel::where("id_karyawan", "=", $id_karyawan)->where("tanggal", "=", $today)->get();
         /*
             		\DB::table('logs')->insert([
             	                       'id_karyawan' => Auth::user()->id_karyawan, 
             	                       'content'     => Auth::user()->username.' akses halaman pengaturan',
             	                       'created_at'  => date('Y-m-d H:i:s'),
             	                       'updated_at'  => date('Y-m-d H:i:s')]
                        	   );
         */
         return view('dashboard/pengaturan')->with("getNotice", $getNotice);
     } else {
         return \Redirect::to('login');
     }
 }
Example #13
0
 /**
  * Tampil profile karyawan dengan form edit data karyawan.
  *
  * @return string 
  */
 public function profile()
 {
     if (Auth::check()) {
         $id_karyawan = Auth::user()->id_karyawan;
         $data = Login::where("id_karyawan", "=", $id_karyawan)->first();
         $today = date('Y-m-d');
         $getNotice = Notice::where("id_karyawan", "=", $id_karyawan)->where("tanggal", "=", $today)->get();
         return view('dashboard/profile')->with("data", $data)->with("getNotice", $getNotice);
     } else {
         return \Redirect::to('login');
     }
 }