Merge branch 'faiqahzaman' of https://gitlab.com/azfararsyad/lelong into faiqahzaman
This commit is contained in:
@@ -163,7 +163,7 @@ class ApiController extends Controller
|
||||
Money::MYR($total_bayaran),
|
||||
route('pay.callback'),
|
||||
'Bayaran Borang',
|
||||
['redirect_url' => 'http://192.168.88:8003/api/pembayaran/response']
|
||||
['redirect_url' => 'http://192.168.85:8003/api/pembayaran/response']
|
||||
);
|
||||
// dd($response);
|
||||
$previous_siri = Resit::orderBy('id','desc')->first();
|
||||
@@ -341,7 +341,7 @@ class ApiController extends Controller
|
||||
Money::MYR($total_bayaran),
|
||||
route('pay.bidcallback'),
|
||||
'Bayaran Bidaan',
|
||||
['redirect_url' => 'http://192.168.88:8003/api/pembayaran/bidresponse']
|
||||
['redirect_url' => 'http://192.168.85:8003/api/pembayaran/bidresponse']
|
||||
);
|
||||
// dd($response);
|
||||
$previous_siri = Resit::orderBy('id','desc')->first();
|
||||
|
||||
@@ -76,6 +76,25 @@ class CartController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function removeFromCart(Request $request)
|
||||
{
|
||||
$item = Cart::where('id',$request->cart_id)->first();
|
||||
if($item->delete())
|
||||
{
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'carts' => $item
|
||||
]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Error! Cannot save.',
|
||||
], 401);
|
||||
}
|
||||
}
|
||||
|
||||
public function updateItem (Request $request)
|
||||
{
|
||||
$cart = Cart::where('id','=',$request->id)->first();
|
||||
|
||||
@@ -138,30 +138,9 @@ class MarhunController extends Controller
|
||||
// dd($lelkarat);
|
||||
return view('marhun.marhun',compact('marhun','lelongbid','karatall','emasall','lelkarat'));
|
||||
}
|
||||
|
||||
public function exportmarhundetails(Request $request)
|
||||
{
|
||||
$lelongbid = LelongBid::where('id','=',$request->lelongbid)->first();
|
||||
$marhun = LelongBidMarhun::where('lelongbid_id','=',$request->lelongbid)->get();
|
||||
|
||||
$karatall = JenisKarat::all();
|
||||
$emasall = JenisEmas::all();
|
||||
|
||||
|
||||
|
||||
$pdf = PDF::loadView('pdf.marhundetails',compact('marhun',
|
||||
'lelongbid',
|
||||
'karatall',
|
||||
|
||||
'emasall'))->setPaper('a4', 'landscape');
|
||||
|
||||
return $pdf->download('Senarai Lelong Details.pdf');
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function senarailelongmarhun(Request $request)
|
||||
{
|
||||
public function senarailelongmarhun(Request $request){
|
||||
|
||||
$user = Auth::user();
|
||||
|
||||
@@ -217,6 +196,58 @@ class MarhunController extends Controller
|
||||
}
|
||||
|
||||
//Operasi
|
||||
|
||||
|
||||
public function exportmarhundetails($lelong_id)
|
||||
{
|
||||
$lelongs= LelongBid::where('lelong_id','=',$lelong_id)->get()->toArray();
|
||||
|
||||
$arraycaw= [];
|
||||
|
||||
$total_berat = 0;
|
||||
$berat = 0;
|
||||
|
||||
$total_harga = 0;
|
||||
$harga = 0;
|
||||
|
||||
$total_nmarhun = 0;
|
||||
$nilai_marhun = 0;
|
||||
|
||||
$total_hargaasas = 0;
|
||||
$hargaasas = 0;
|
||||
|
||||
foreach($lelongs as $index1=>$lelong){
|
||||
|
||||
$marhun= LelongBidMarhun::where('lelongbid_id','=',$lelong['id'])->get();
|
||||
$total_berat = $total_berat + ($marhun->sum('berat'));
|
||||
$total_harga = $total_harga + ($marhun->sum('harga'));
|
||||
$total_nmarhun = $total_nmarhun + ($marhun->sum('n_marhun'));
|
||||
$total_hargaasas = $total_hargaasas + ($marhun->sum('hargaasas'));
|
||||
|
||||
$lelongs[$index1]['detailmarhun']=$marhun;
|
||||
|
||||
}
|
||||
|
||||
array_push($arraycaw,[
|
||||
'berat'=>$berat,
|
||||
'harga'=>$harga,
|
||||
'n_marhun'=>$nilai_marhun,
|
||||
'hargaasas'=>$hargaasas
|
||||
|
||||
]);
|
||||
|
||||
|
||||
|
||||
|
||||
$pdf = PDF::loadView('pdf.marhundetails',compact('lelongs','arraycaw','total_nmarhun','total_berat','total_harga','total_hargaasas'
|
||||
))->setPaper('a4', 'potrait');
|
||||
|
||||
return $pdf->download('Senarai Marhun.pdf');
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function sahubahmutu(Request $request)
|
||||
{
|
||||
// dd($request->all());
|
||||
|
||||
@@ -646,6 +646,20 @@ class SimulasiController extends Controller
|
||||
|
||||
}
|
||||
|
||||
array_push($arraycaw,[
|
||||
'cawangan'=>$cawangan->caw_name,
|
||||
't_lelong'=>$simulasi->tarikh_lelong,
|
||||
'bil_marhun'=>sizeof($databid),
|
||||
'berat'=>$berat,
|
||||
'n_marhun'=>$nilai_marhun,
|
||||
'pinjaman'=>$pinjaman,
|
||||
'upah'=>0,
|
||||
'hargaasas'=>$hargaasas,
|
||||
'cajlelong'=>$cajlelong,
|
||||
'rugilelong'=>$rugilelong,
|
||||
'bakilelong'=>$bakilelong,
|
||||
]);
|
||||
|
||||
|
||||
|
||||
$total_marhun = $total_marhun + sizeof($databid);
|
||||
|
||||
Reference in New Issue
Block a user