Ejemplo n.º 1
0
 public function anyData()
 {
     $data = Dokumens::all();
     return $data;
     //
 }
Ejemplo n.º 2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $data_dokumen = Dokumens::find($id);
     $data_dokumen_pesan = $data_dokumen;
     // dd($data_dokumen_pesan->nama_skpd);
     if ($data_dokumen) {
         $data_dokumen->delete();
         $file = $data_dokumen->file;
         // dd($file);
         // $file->get()['filename'];
         if ($file) {
             $lokasi_baru = $file->dir . '/' . $file->nama_baru;
             $lokasi_lama = $file->filename;
             if ($file->nama_baru && $file->dir && \Storage::exists($lokasi_baru)) {
                 # code...
                 // echo $lokasi_baru;
                 \Storage::move($lokasi_baru, 'RecycleBin/' . $file->nama_baru);
             }
             if (\Storage::exists($lokasi_lama)) {
                 // echo $lokasi_lama;
                 \Storage::move($lokasi_lama, 'RecycleBin/' . $file->filename);
                 # code...
             }
             // $file->delete();
         }
     }
     $data_dokumenx = Dokumens::find($id);
     if (!$data_dokumenx) {
         return 'Sukses data SPPD  ' . $data_dokumen_pesan->no_sppd;
     } else {
         return 'gagal data SPPD  ' . $data_dokumen_pesan->no_sppd;
     }
     // return __function__;
     //
 }
Ejemplo n.º 3
0
 function per_skpd_tahun($tahun = '', $skpd_id = '')
 {
     // dd($this->req->all());
     if ($this->req->get('tahun') && $this->req->get('skpd_id')) {
         $tahun = $this->req->get('tahun');
         $skpd_id = $this->req->get('skpd_id');
         // $nama_skpd=Skpd::find($skpd_id)->toArray();
         /* get data filter skpd dokument======================================================================================*/
         $skpd = Skpd::find($skpd_id)->toArray();
         /* get rekap data dokument======================================================================================*/
         $jenissppd_s = Jenissppd::all();
         // dd($jenissppd_s);
         $data['rows'] = array();
         foreach ($jenissppd_s as $key => $jenissppd) {
             // dd($jenissppd->rekapdokumen($tahun,$skpd_id)->toArray());
             $data['rows'][$key] = array_merge($jenissppd->toArray(), $jenissppd->rekapdokumen($tahun, $skpd_id)->toArray());
         }
         /* get rekap total dokument======================================================================================*/
         $dokumen = new Dokumens();
         $total = $dokumen->rekaptotal($tahun, $skpd_id)->toArray();
         return $data + $this->req->all() + $skpd + $total;
         // return collect($data)->merge( $this->req->all())->merge( $skpd)->merge($total);
         // dd($data);
     }
 }
Ejemplo n.º 4
0
     $holidays = array("2008-12-25", "2008-12-26", "2009-01-01");
     // return getHariKerja("2008-12-22","2009-01-02",$holidays);
     $doks = Dokumens::where('tahun', 2009)->get();
     // $libur = Tahun::where('tahun',2009)->first()->liburs;
     $libur = Libur::select('tanggal_libur_nasional')->where('tahun_id', 3)->get();
     // dd($libur);
     foreach ($doks as $key => $dok) {
         // dd($dok);
         // $dok->keterangan=cekTelat($dok->tgl_diterima,$dok->tgl_sppd,$holidays);
         echo $key . '--' . $dok->no_sppd . '--' . $dok->tgl_sppd . '--' . $dok->tgl_diterima . '--';
         echo cekTelat($dok->tgl_diterima, $dok->tgl_sppd, $libur);
         echo '<br>';
         $dok->keterangan = cekTelat($dok->tgl_diterima, $dok->tgl_sppd, $libur);
         $dok->save();
     }
     $doks = Dokumens::where('tahun', 2009)->get();
     dd($doks);
     // return cekTelat("2008-12-22","2009-01-02",$holidays);
 });
 // Route::get('sx', function(Request $request)
 // 		{
 // 			$bag = Session::getMetadataBag();
 // 		    $pesan=['error'=>['Peringatan : File PDF tidak di atur dengan benar !', 'Terjadi kesalahan upload File PDf '], 'succes'=>'Sukses mengupload Dokumen PDF '];
 // 		    echo date('m/d/Y H:i:s', time());
 // 		});
 // rename file pdf =============================================================================================
 // Route::get('/ren', function(Request $request)
 // {
 // 	// $entry = File::where('dokumen_id','=',91)->first();
 // 	// // echo str_replace('/', '-', $entry->dokumen->no_sppd);
 // 	// $entry->nama_baru=!empty($entry->nama_baru)?$entry->nama_baru:str_replace('/', '-', $entry->dokumen->no_sppd).'-'.$entry->filename;