Commit 4ca66c00 by Juliper

no message

parent eb6c3919
...@@ -44,6 +44,12 @@ class AdminController extends Controller ...@@ -44,6 +44,12 @@ class AdminController extends Controller
->select('homestay.nama_homestay','homestay.owner','pelanggan.nama','transaksi.total_pembayaran','transaksi.jumlah_kamar','daftar_book.*') ->select('homestay.nama_homestay','homestay.owner','pelanggan.nama','transaksi.total_pembayaran','transaksi.jumlah_kamar','daftar_book.*')
->get(); ->get();
$data2 = DB::table('daftar_book')
->where('daftar_book.homestay','=',$dataHomestay[0]->id)
->where('daftar_book.id_transaksi','=',null)
->whereMonth('daftar_book.tanggal_mulai','=',$request['bulan'])
->get();
//$i=0; //$i=0;
$penghasilan = 0; $penghasilan = 0;
foreach ($data as $a){ foreach ($data as $a){
...@@ -51,7 +57,12 @@ class AdminController extends Controller ...@@ -51,7 +57,12 @@ class AdminController extends Controller
//$i++; //$i++;
} }
dd($data,$penghasilan); foreach ($data2 as $b){
$biaya = ($b->jumlah_kamar * 150000) * $b->lama_menginap;
$penghasilan += $biaya;
}
dd($data,$data2,$penghasilan);
dd('masuk',$request['bulan'],$request['nama_homestay'],$data); dd('masuk',$request['bulan'],$request['nama_homestay'],$data);
return view(''); return view('');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment