コード例 #1
0
ファイル: BarangController.php プロジェクト: ibnoe/trustline
 /**
  * Get an excel table export.
  *
  * @return Response
  */
 public function export()
 {
     $barang = new Barang();
     $barangs = $barang->get($barang->getFillable());
     $barangs = $barangs->toArray();
     if ($barangs == []) {
         return view('barang.export');
     }
     return ExcelHelper::export($barangs, 'barangs');
 }
コード例 #2
0
 public function export()
 {
     $karyawan = new Karyawan();
     //$karyawan->count() handle if count 0
     $karyawans = Karyawan::get($karyawan->getFillable())->toArray();
     return ExcelHelper::export($karyawans);
 }
コード例 #3
0
 /**
  * Get an excel table export.
  *
  * @return Response
  */
 public function export()
 {
     $tipeakun = new TipeAkun();
     $tipeakuns = $tipeakun->get($tipeakun->getFillable());
     $tipeakuns = $tipeakuns->toArray();
     if ($tipeakuns == []) {
         return view('tipeakun.export');
     }
     return ExcelHelper::export($tipeakuns, 'tipeakuns');
 }
コード例 #4
0
ファイル: ExcelHelper.php プロジェクト: ibnoe/trustline
 /**
  * Create an Excel file to help user fill the
  * table to import.
  *
  * @param Model that instanced
  * @return File excel
  */
 public static function template(Model $model)
 {
     $fillable = $model->getFillable();
     foreach ($fillable as $key => $value) {
         $fillable[$key] = ucwords(str_replace('_', ' ', $value));
     }
     $upgrades = ExcelHelper::upgrade($fillable);
     return ExcelHelper::export($upgrades, $model->getTable());
 }
コード例 #5
0
ファイル: AkunController.php プロジェクト: ibnoe/trustline
 /**
  * Get an excel table export.
  *
  * @return Response
  */
 public function export()
 {
     // $akun = new Akun();
     // $akun = $akun->get($akun->getFillable());
     // $akun = $akun->toArray();
     // if ($akun == []) {
     // 	return view('akun.export');
     // }
     // return ExcelHelper::export($akun, 'akun');
     $akuns = [];
     foreach (Akun::get() as $akun) {
         $q['No Akun'] = $akun->no_akun;
         $q['Nama'] = $akun->nama;
         $q['Tipe'] = $akun->tipeakun->nama;
         $q['Mata Uang'] = $akun->mata_uang;
         $q['Saldo Awal'] = $akun->saldo_awal;
         $q['Tanggal'] = $akun->tanggal;
         array_push($akuns, $q);
     }
     if ($akuns == []) {
         return view('akun.export');
     }
     return ExcelHelper::export($akuns, 'akun');
 }