view senarai bidaan pembida
This commit is contained in:
@@ -299,6 +299,72 @@ class ReportController extends Controller
|
||||
|
||||
|
||||
|
||||
// $pdf = PDF::loadView('pdf.pdfsenarailapbidaan', compact('lelongid','arraydetails','lelong_id','lelongid','cawangan','arrayinfocaw','total_hargaasas','total_hargabida'))
|
||||
// ->setPaper('a4', 'potrait');
|
||||
|
||||
// return $pdf->download('Senarai Nama Bidaan Pembida.pdf');
|
||||
|
||||
return view('lelong.senarailapbidaanpembida',compact('kodcaw','lelongid','arraydetails','lelong_id','lelongid','cawangan','arrayinfocaw','total_hargaasas','total_hargabida'));
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function senarailapbidaanpdf ($lelong_id, $kodcaw){
|
||||
|
||||
|
||||
$arraydetails = [];
|
||||
$arrayinfocaw = [];
|
||||
$total_hargaasas = 0;
|
||||
$total_hargabida = 0;
|
||||
|
||||
$lelongid = CawanganLelong::join('lelong','cawangan_lelong.lelong_id','=','lelong.id')
|
||||
->join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
|
||||
->where('cawangan_lelong.lelong_id','=',$lelong_id)
|
||||
->where('cawangan.caw_code',$kodcaw)
|
||||
->select('lelong_id','tarikh_lelong','lelong.fasa')
|
||||
->groupBy('lelong_id')
|
||||
->get();
|
||||
|
||||
foreach($lelongid as $laporancaw)
|
||||
{
|
||||
$cawangan = CawanganLelong::join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
|
||||
->where('lelong_id',$laporancaw['lelong_id'])
|
||||
->where('cawangan.caw_code',$kodcaw)
|
||||
->get()
|
||||
->toArray();
|
||||
array_push($arrayinfocaw,['laporancaw' => $laporancaw,'cawangan' => $cawangan]);
|
||||
}
|
||||
|
||||
|
||||
$laporanpembida= LelongBid::join('lelongbidder','lelongbid.id','=','lelongbidder.lelongbid_id')
|
||||
->select('lelongbid_id','norujukan','hargaasas')
|
||||
->where('lelongbid.kodcaw',$kodcaw)
|
||||
->where('lelongbid.lelong_id','=',$lelong_id)
|
||||
->groupBy('lelongbid_id')
|
||||
->get()
|
||||
->toArray();
|
||||
|
||||
foreach( $laporanpembida as $index1=>$totlappembida){
|
||||
|
||||
$total_hargaasas = $total_hargaasas + $totlappembida['hargaasas'];
|
||||
// $total_hargabida = $total_hargabida + $totlappembida['hargabida'];
|
||||
|
||||
}
|
||||
foreach($laporanpembida as $laporan)
|
||||
{
|
||||
$details = LelongBidder::where('lelongbid_id',$laporan['lelongbid_id'])
|
||||
->orderBy('hargabida','desc')
|
||||
->orderBy('masa_bidaan','asc')
|
||||
->get()
|
||||
->toArray();
|
||||
array_push($arraydetails,['laporan' => $laporan,'details' => $details]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$pdf = PDF::loadView('pdf.pdfsenarailapbidaan', compact('lelongid','arraydetails','lelong_id','lelongid','cawangan','arrayinfocaw','total_hargaasas','total_hargabida'))
|
||||
->setPaper('a4', 'potrait');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user