download function

This commit is contained in:
Amirah22
2022-02-21 08:39:12 +08:00
parent b88e480969
commit c450b8b475
5 changed files with 162 additions and 186 deletions
+31 -4
View File
@@ -27,6 +27,8 @@ use App\Models\LelongBid;
use App\Models\LelongBidMarhun;
use App\Models\LelKarat;
use App\Models\Payment;
class SerahanController extends Controller
{
/**
@@ -44,19 +46,44 @@ class SerahanController extends Controller
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function pembayaran()
public function pembayaran()
{
$lelong = Lelong::all();
return view('serahan.pembayaran',compact('lelong'));
$payment= Payment::join('lelongbidder','payment.user_id','=','lelongbidder.user_id')
->join('users','payment.user_id','=','users.id')
->join('lelongbid','payment.lelongbid_id','=','lelongbid.id')
->get();
// dd($payment);
return view('serahan.pembayaran',compact('payment'));
}
public function penyatabayaran(Request $request)
{
$pdf = PDF::loadView('pdf.penyatabayaran')->setPaper('a4', 'landscape');
$payment_id = $request->paymentid;
$payment= Payment::join('lelongbidder','payment.user_id','=','lelongbidder.user_id')
->join('users','payment.user_id','=','users.id')
->join('lelongbid','payment.lelongbid_id','=','lelongbid.id')
// ->where('payment.user_id','=',$request->payment) // nnti tanya fifi tunggu dia sihat
->get();
$pdf = PDF::loadView('pdf.penyatabayaran',compact('payment','payment_id'))
->setPaper('a4', 'landscape');
return $pdf->download('Penyata Bayaran.pdf');
}
public function resitpembayaran(Request $request)
{
$pdf = PDF::loadView('pdf.resitpembayaran')->setPaper('a4', 'landscape');
+2 -2
View File
@@ -62,14 +62,14 @@
</ul>
</li>
{{-- <li class="{{ (request()->is('')) ? 'active' : '' }}">
<li class="{{ (request()->is('')) ? 'active' : '' }}">
<a href="#analisaSubmenu" data-toggle="collapse" aria-expanded="false" style="">Notis Lelong</a>
<ul class="list-unstyled collapse {{ (request()->is('analisa/*')) ? 'show' : '' }}" id="analisaSubmenu" >
<li class="{{ (request()->is('') || request()->is('') ) ? 'active' : '' }}">
<a href="{{url('#')}}">Jana Notis Lelong</a>
</li>
</ul>
</li> --}}
</li>
@endhasrole
+119 -171
View File
@@ -1,188 +1,136 @@
<style>
#customers {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size:12px;
border-collapse: collapse;
width: 100%;
}
#customers td, #customers th {
border: 0px solid;
padding: 1px;
border-bottom: 1px solid #ddd;
}
#customers {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size:12px;
border-collapse: collapse;
width: 100%;
}
#customers td, #customers th {
border: 0px solid;
padding: 1px;
border-bottom: 1px solid #ddd;
}
#customers th {
text-align: left;
table-layout:auto
color: black;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
padding: 5px;
border-bottom: 1px solid #ddd;
}
#marhun {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size:11px;
border-collapse: collapse;
width: 100%;
}
#marhun td, #marhun th {
border: 0px solid;
padding: 1px;
}
#customers th {
text-align: left;
table-layout:auto
color: black;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
padding: 5px;
border-bottom: 1px solid #ddd;
}
#marhun th {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
}
</style>
<table width="100%" border="0" id="marhun" >
<tr>
<td width="46%">Ar-Rahn Kota Belud</td>
<td width="54%" align="right">Invois</td>
</tr>
<tr>
<td>Ground Floor, Lot 11, KKMP</td>
<td align="right">No.Invois: :0002588 </td>
</tr>
<tr>
<td>Kota Belud, Sabah.</td>
<td align="right">Tarikh: 30/08/2021</td>
</tr>
<tr>
<td>Tel : 088-979599</td>
<td align="right">&nbsp;</td>
</tr>
<tr>
<td>Faks : 088-255026</td>
<td align="right">Cawangan : Ar-Rahn Kota Belud</td>
</tr>
</table>
<br>
<table width="100%" border="0" id="marhun">
<tr>
<td colspan="3"></td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<tr>
<td width="66">Nama </td>
<td width="10">:</td>
<td width="957">MOHD SAID BIN TAIB</td>
</tr>
<tr>
<td>No.K/P</td>
<td>:</td>
<td>830519125399</td>
</tr>
<tr>
<td>Alamat</td>
<td>:</td>
<td>KAMPUNG TAMAU KOTA BELUD</td>
</tr>
<tr>
<td>No.Telefon</td>
<td>:</td>
<td>0193749495</td>
</tr>
</table> </div>
#marhun {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size:11px;
border-collapse: collapse;
width: 100%;
}
#marhun td, #marhun th {
border: 0px solid;
padding: 1px;
}
#marhun th {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
}
</style>
<body>
@foreach ($payment as $index=>$info)
<table width="100%" border="0" id="marhun" >
<tr>
<td width="46%">Ar-Rahn Kota Belud</td>
<td width="54%" align="right">Invois</td>
</tr>
<tr>
<td>Ground Floor, Lot 11, KKMP</td>
<td align="right">No.Invois: :0002588 </td>
</tr>
<tr>
<td>Kota Belud, Sabah.</td>
<td align="right">Tarikh: 30/08/2021</td>
</tr>
<tr>
<td>Tel : 088-979599</td>
<td align="right">&nbsp;</td>
</tr>
<tr>
<td>Faks : 088-255026</td>
<td align="right">Cawangan : Ar-Rahn Kota Belud</td>
</tr>
</table>
<br>
<h5><u>PENYATA BAYARAN LELONGAN</u></h5>
<table width="100%" height="168" id="customers">
<thead>
<table width="100%" border="0" id="marhun">
<tr>
<th width="11%">Bil</th>
<th width="21%">No. Rujukan</th>
<th width="16%">Jenis Barang</th>
<th width="15%">Berat(g)</th>
<th width="10%"> Harga Bidaan(RM)</th>
</tr>
</thead>
<tbody>
<td colspan="3"></td>
</tr>
<tr>
<td colspan="1">1.</td>
<td colspan="1">011232200714-0049</td>
<td colspan="1">1- Cincin</td>
<td colspan="1">1.53</td>
<td colspan="1">346.00</td>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="1">2.</td>
<td colspan="1">011232200723-0039</td>
<td colspan="1">1- Cincin</td>
<td colspan="1">2.90</td>
<td colspan="1">647.00</td>
<tr>
<td width="66">Nama </td>
<td width="10">:</td>
<td width="957">{{ $info['nama_bidder'] }}</td>
</tr>
<tr>
<td colspan="3"><strong>Jumlah Bayaran</strong></td>
<td colspan="1"><strong>4.43</strong></td>
<td colspan="1"><strong>993.00</strong></td>
<td>No.K/P</td>
<td>:</td>
<td>{{$info['nokp']}}</td>
</tr>
</table>
<tr>
<td>Alamat</td>
<td>:</td>
<td>{{$info['alamat']}}</td>
</tr>
<tr>
<td>No.Telefon</td>
<td>:</td>
<td>{{$info['notelbimbit']}}</td>
</tr>
</table> </div>
</div>
<h5><u>SENARAI BAYARAN MENGIKUT AKAUN</u></h5>
<h5><u>PENYATA BAYARAN LELONGAN</u></h5>
<table width="100%" height="168" id="customers">
<thead>
<tr>
<th width="5%">Bil</th>
<th width="15%">Cawangan</th>
<th width="8%"> Berat(g)</th>
<th width="12%"> Harga Jual(RM)</th>
<th width="15%">Nama Bank</th>
<th width="27%">Pemegang Akaun</th>
<th width="18%">No.Akaun</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="1">1.</td>
<td colspan="1">Ar-Rahn Kota Belud</td>
<td colspan="1">4.43</td>
<td colspan="1">993.00</td>
<td colspan="1">Bank Muamalat Malaysia Berhad</td>
<td colspan="1">Joint Venture MVSB and PKB-Kota Belud</td>
<td colspan="1"> 0301-0006119-71-3</td>
</tr>
<tr>
<td colspan="3"><strong>Jumlah Bayaran</strong></td>
<td colspan="1"><strong>993.00</strong></td>
<td colspan="3"></td>
</tr>
<tr>
<td colspan="7"><div><font size="1"><i>*Sila Buat Pembayaran Mengikut Akaun</i></font></div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<tr>
<th width="11%">Bil</th>
<th width="21%">No. Rujukan</th>
<th width="16%">Jenis Barang</th>
<th width="15%">Berat(g)</th>
<th width="10%"> Harga Bidaan(RM)</th>
</tr>
</thead>
<tr>
<td>{{$index+1}}</td>
<td>{{$info['norujukan']}}</td>
<td>{{$info['marhun']}}</td>
<td>{{ number_format($info['berat'], 2, '.', ',') }}</td>
<td>{{ number_format($info['hargajual'], 2, '.', ',') }}</td>
</tr>
@endforeach
</tbody>
+9 -8
View File
@@ -13,6 +13,7 @@
<form id="exportform" action="" method="POST">
@csrf
<input type="hidden" name="type" value="User">
<input type="hidden" name="paymentid" value="{{ $payment }}">
<table class="table table-striped table-xl" id="lelong" style="width:100%">
<thead class="bg-primary text-white">
<tr>
@@ -29,14 +30,14 @@
</thead>
<tbody>
{{-- @foreach ($lelong as $lel) --}}
@foreach ($payment as $pay)
<tr>
<td><input type="checkbox" aria-label="Checkbox for following text input" name="checkboxdata[]" ></td>
<td>MOHD SAID BIN TAIB</td>
<td>830519125399</td>
<td>0193749495</td>
<td>2</td>
<td>993.00</td>
<td><input type="checkbox" aria-label="Checkbox for following text input" name="checkboxdata[]" value="{{ $pay->id }}" ></td>
<td>{{ $pay->nama_bidder }}</td>
<td>{{ $pay->nokp }}</td>
<td>{{ $pay->notelbimbit }}</td>
<td>{{ $pay->lelongbid_id }}</td>
<td>{{ $pay->total_payment }}</td>
<td class="text-center">
{{-- @hasrole('jurulelong')
@@ -55,7 +56,7 @@
<td class="text-center"><a href="{{ route('serahan.resitpembayaran') }}"><i class="fas fa-download"></i></a> </td>
<td class="text-center"><a href="{{ route('serahan.senaraibid') }}"><i class="fas fa-download"></i></a> </td>
</tr>
{{-- @endforeach --}}
@endforeach
</tbody>
</table>
+1 -1
View File
@@ -127,7 +127,7 @@ Route::group(['middleware' => ['permission:pengesahanpembida'],'prefix'=>'pembid
Route::group(['middleware' => ['permission:serahan'],'prefix'=>'serahan'], function () {
Route::get('/pembayaran',['as'=>'serahan.pembayaran','uses'=>'SerahanController@pembayaran']);
Route::get('/resitpembayaran',['as'=>'serahan.resitpembayaran','uses'=>'SerahanController@resitpembayaran']);
Route::post('/resitpembayaran',['as'=>'serahan.resitpembayaran','uses'=>'SerahanController@resitpembayaran']);
Route::get('/penyatabayaran',['as'=>'serahan.penyatabayaran','uses'=>'SerahanController@penyatabayaran']);
Route::get('/senaraibid',['as'=>'serahan.senaraibid','uses'=>'SerahanController@senaraibid']);