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'); } }
/** * 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::where("id_karyawan", "=", $id_karyawan)->where("tanggal", "=", $today)->get(); 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 = 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::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'); } }
/** * 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'); } }
/** * 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'); } }