public function handle() { $karyawan = data_karyawan::find($this->req['karyawan']); $user = User::create(['id_karyawan' => $this->req['karyawan'], 'name' => $karyawan->nm_depan . ' ' . $karyawan->nm_belakang, 'username' => $this->req['username'], 'password' => bcrypt($this->req['password']), 'permission' => $this->req['permission']]); foreach ($this->req['levels'] as $level) { data_level::firstOrCreate(['id_user' => $user->id_user, 'id_level_user' => $level]); } return $user; }
public function postDetailspb(Request $req) { if ($req->ajax()) { $result = []; $out = ''; $spb = data_spb::find($req->id); if ($spb->status > 2) { $items = data_spb_item::join('data_barang', 'data_barang.id_barang', '=', 'data_spb_item.id_item')->join('ref_satuan', 'ref_satuan.id_satuan', '=', 'data_spb_item.id_satuan')->where('data_spb_item.id_spb', $req->id)->whereIn('data_spb_item.status', [1, 2])->select('data_spb_item.*', 'data_barang.nm_barang', 'data_barang.kode', 'ref_satuan.nm_satuan')->get(); } else { $items = data_spb_item::join('data_barang', 'data_barang.id_barang', '=', 'data_spb_item.id_item')->join('ref_satuan', 'ref_satuan.id_satuan', '=', 'data_spb_item.id_satuan')->where('data_spb_item.id_spb', $req->id)->where('data_spb_item.status', 1)->select('data_spb_item.*', 'data_barang.nm_barang', 'data_barang.kode', 'ref_satuan.nm_satuan')->get(); } if ($spb->id_acc > 0) { $me = data_karyawan::find($spb->id_acc); $out .= '<div class="grid simple"> <div class="grid-title no-border"></div> <div class="grid-body no-border"> <b>Disetujui Oleh : </b> ' . $me->nm_depan . ' ' . $me->nm_belakang . ' </div> </div> '; } else { $out .= '<div class="grid simple"> <div class="grid-title no-border"></div> <div class="grid-body no-border"> <i class="fa fa-warning"></i> Permintaan belum disetujui Kepala </div> </div> '; } $out .= '<div class="grid simple"> <div class="grid-title no-border"> <h4>' . count($items) . ' barang <strong>ditemukan</strong></4><br /> <small>Deadline : ' . \Format::indoDate($spb->deadline) . '</small> </div> <div class="grid-body no-border"> <table class="table table-striped"> <thead> <tr> <th>Kode</th> <th>Barang</th> <th class="text-right">Req Qty</th> </tr> </thead> <tbody> '; foreach ($items as $item) { $out .= ' <tr> <td>' . $item->kode . '</td> <td>' . \Format::substr($item->nm_barang, 20) . '</td> <td class="text-right">' . number_format($item->qty_lg, 0, ',', '.') . ' ' . $item->nm_satuan . '</td> </tr> '; } $out .= ' </tbody> </table> </div> </div>'; $btn = $spb->id_acc > 0 && \Auth::user()->permission > 1 && in_array($spb->status, [1, 2]) ? '<a href="' . url('/skb/process/' . $req->id) . '" class="btn btn-primary">Proses</a>' : ''; $result['kode'] = $spb->no_spb; $result['content'] = $out; $result['button'] = $btn; return json_encode($result); } }
function getPrint($id) { $karyawan = data_karyawan::find($id); $keluarga = data_karyawan_klrg::where('id_karyawan', $karyawan->id_karyawan)->get(); $status_karyawan = data_personalia::join('ref_status_karyawan', 'ref_status_karyawan.id', '=', 'data_personalia.id_status')->where('tipe_status', 1)->where('id_karyawan', $karyawan->id_karyawan)->get(); $catatan = data_personalia::join('ref_status_karyawan', 'ref_status_karyawan.id', '=', 'data_personalia.id_status')->where('tipe_status', 3)->orWhere('tipe_status', 4)->orWhere('tipe_status', 5)->where('id_karyawan', $karyawan->id_karyawan)->get(); $jabatan = ref_jabatan::where('id', $karyawan->jabatan)->first(); $agama = ref_agama::where('id', $karyawan->agama)->first(); return view('Print.Personalia.karyawan', ['karyawan' => $karyawan, 'keluarga' => $keluarga, 'status_karyawan' => $status_karyawan, 'jabatan' => $jabatan, 'agama' => $agama, 'catatan' => $catatan]); }
public function getChain(Request $req) { $result = []; if ($req->ajax()) { $result['result'] = true; $data = data_karyawan::find($req->id); $result['departemen'] = $data->id_departemen; $result['jabatan'] = $data->jabatan; } else { $result['result'] = false; } return json_encode($result); }
/** * Edit barang * @access Admin Logistik * @author @hexters */ public function getUpdate($id) { $item = data_barang::find($id); if ($item == null) { return redirect('/logistik')->withNotif(['label' => 'danger', 'err' => 'Maaf, Tidak ditemukan !']); } if (!in_array($item->tipe, \Me::accessGudang())) { return redirect('/logistik')->withNotif(['label' => 'danger', 'err' => 'Maaf Bukan domain anda!']); } $user = data_karyawan::find($item->id_karyawan); $details = data_barang_detail::where('id_barang', $item->id_barang)->get(); $konversi = ref_konversi_satuan::where('ref_konversi_satuan.id_barang', $id)->whereNotIn('ref_konversi_satuan.id_satuan_max', [$item->id_satuan])->get(); return view('Pengadaan.Update', ['kategoris' => ref_kategori::all(), 'satuan' => ref_satuan::all(), 'item' => $item, 'oleh' => $user->nm_depan . ' ' . $user->nm_belakang, 'details' => $details, 'klasifikasi' => ref_klasifikasi::all(), 'konversi' => $konversi]); }
public function postDetailspb(Request $req) { if ($req->ajax()) { $result = []; $out = ''; $spb = data_spb::find($req->id); if ($spb->status > 2) { $items = data_spb_item::join('data_barang', 'data_barang.id_barang', '=', 'data_spb_item.id_item')->join('ref_satuan', 'ref_satuan.id_satuan', '=', 'data_barang.id_satuan')->where('data_spb_item.id_spb', $req->id)->whereIn('data_spb_item.status', [1, 2])->select('data_spb_item.*', 'data_barang.nm_barang', 'data_barang.kode', 'data_barang.in', 'data_barang.out', 'ref_satuan.nm_satuan')->get(); } else { $items = data_spb_item::join('data_barang', 'data_barang.id_barang', '=', 'data_spb_item.id_item')->join('ref_satuan', 'ref_satuan.id_satuan', '=', 'data_spb_item.id_satuan')->where('data_spb_item.id_spb', $req->id)->where('data_spb_item.status', 1)->select('data_spb_item.*', 'data_barang.nm_barang', 'data_barang.kode', 'data_barang.in', 'data_barang.out', 'ref_satuan.nm_satuan')->get(); } if ($spb->id_acc > 0) { $me = data_karyawan::find($spb->id_acc); $out .= '<div class="grid simple"> <div class="grid-title no-border"></div> <div class="grid-body no-border"> <b>Disetujui Oleh : </b> ' . $me->nm_depan . ' ' . $me->nm_belakang . '<br /> <small class="text-muted">' . \Format::hari($spb->tgl_approval) . ', ' . \Format::indoDate2($spb->tgl_approval) . ' ' . \Format::jam($spb->tgl_approval) . '</small> </div> </div> '; } $out .= '<div class="grid simple"> <div class="grid-title no-border"> <h4>' . count($items) . ' barang <strong>ditemukan</strong></4><br /> <small>Deadline : ' . \Format::indoDate($spb->deadline) . '</small> </div> <div class="grid-body no-border"> <table class="table table-striped"> <thead> <tr> <th>Kode</th> <th>Barang</th> <th>Sisa</th> <th class="text-right">Qty</th> </tr> </thead> <tbody> '; foreach ($items as $item) { $out .= ' <tr> <td>' . $item->kode . '</td> <td>' . \Format::substr($item->nm_barang, 20) . '</td> <td>' . number_format($item->in - $item->out, 0, ',', '.') . ' ' . $item->nm_satuan . '</td> <td class="text-right">' . number_format($item->qty_lg, 0, ',', '.') . ' ' . $item->nm_satuan . '</td> </tr> '; } $out .= ' </tbody> </table> </div> </div>'; $btn = \Auth::user()->permission > 2 && $spb->status < 2 && empty($spb->id_acc) ? '<button data-loading-text="<i class=\'fa fa-circle-o-notch fa-spin\'></i> Proses..." class="btn btn-primary btn-accspb" onclick="acc(' . $req->id . ');"><i class="fa fa-check"></i> Setujui</button>' : ''; $result['kode'] = $spb->no_spb; $result['content'] = $out; $result['button'] = $btn; return json_encode($result); } }
public function fullName() { $user = data_karyawan::find(\Auth::user()->id_karyawan); return $user->nm_depan . ' ' . $user->nm_belakang; }
/** * Execute the job. * * @return void */ public function handle() { data_karyawan::find($this->req['id'])->update(['NIK' => $this->req['nik'], 'nm_depan' => $this->req['nm_depan'], 'nm_belakang' => $this->req['nm_belakang'], 'telp' => $this->req['telp'], 'email' => $this->req['email'], 'sex' => $this->req['gender'], 'hp' => $this->req['hp'], 'tempat_lahir' => $this->req['tempat_lahir'], 'tgl_lahir' => date('Y-m-d', strtotime($this->req['tgl_lahir'])), 'jabatan' => $this->req['jabatan'], 'alamat' => $this->req['alamat'], 'agama' => $this->req['agama'], 'pendidikan' => $this->req['pendidikan'], 'id_status' => 1, 'tgl_bergabung' => date('Y-m-d', strtotime($this->req['tgl_bergabung'])), 'id_departemen' => $this->req['id_departemen']]); return $this->req; }
/** * Execute the job. * * @return void */ public function handle() { data_personalia::create(['id_karyawan' => $this->req['id_karyawan'], 'id_status' => $this->req['id_status'], 'surat_keputusan' => $this->req['surat_keputusan'], 'datetime_in' => date('Y-m-d', strtotime($this->req['datetime_in'])), 'keterangan' => $this->req['keterangan']]); data_karyawan::find($this->req['id_karyawan'])->update(['id_status' => $this->req['id_status']]); return $this->req; }