new commit

export simulasi to pdf
This commit is contained in:
Amirah22
2022-01-24 09:55:15 +08:00
parent 8d199979f7
commit 15c4c79945
4 changed files with 181 additions and 2 deletions
@@ -462,6 +462,13 @@ class SimulasiController extends Controller
{
}
public function export(Request $request)
{
$pdf = PDF::loadView('pdf.simrpt2');
return $pdf->download('Taraf.pdf');
}
}
+170
View File
@@ -0,0 +1,170 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<style>
#customers {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size:11px;
border-collapse: collapse;
width: 100%;
}
#customers td {padding:3px 5px 3px 5px; padding-right:10px;}, #customers th {
border: 0px solid;
padding: 1px;
}
#customers tr:nth-child(even){}
#customers tr:hover {}
#customers th {
text-align: left;
table-layout:auto;
color: black;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
}
</style>
<table width="100%" border="0" id="customers">
<tr>
<td width="50%"><h3>PERMODALAN KELANTAN BERHAD</h3></td>
</tr>
<tr>
<td colspan="2"><u><b>LAPORAN SIMULASI SEMUA CAWANGAN</b></u></td>
</tr>
</table>
<br>
<table width="100%" border="0" id="customers">
<tr><td><b>Tarikh Lelong: </b></td></tr>
<tr><td><b>Jbg: </b></td></tr>
<tr><td><b>Caj Lelong: </b></td></tr>
<tr><td><b>Harga Emas Asas: </b></td></tr>
</table>
<br>
<table cellspacing="" cellpadding="5" style="float:left;" text-align="left" border="1" width="10%" height="25" align="left" id="customers">
<thead>
<br>
<tr>
<th>Bilangan Lelong:</th>
<th>Nilai Marhun Keseluruhan:</th>
<th>Pembiayaan Keseluruhan:</th>
<th>Keuntungan Keseluruhan:</th>
<th>Rugi Lelong Keseluruhan:</th>
<th>Baki Lelong Keseluruhan:</th>
<th>Caj Lelong Keseluruhan:</th>
</tr>
</thead>
</table>
<br>
<br>
<table cellspacing="0" cellpadding="5" style="float:right;" border="1" width="100%" height="80" align="right" id="customers">
<thead>
<tr>
<th width="2%">No.</th>
<!-- <th>Pilihan</th>-->
<th width="9%" align="center">Cawangan</th>
<th width="9%" align="center">Bil Marhun(paket)</th>
<th width="9%" align="center">No Rujukan</th>
<th width="9%" align="center">Berat(gm)</th>
<th width="7%" align="center">Margin Pinjaman</th>
<th width="10%" align="center">Harga Asas(RM)
<th width="8%" align="center">Nilai Marhun(RM)</th>
<th width="7%" align="center">Pembiayaan(RM)</th>
<th width="8%" align="center">Keuntungan(RM)</th>
<th width="10%" align="center">Baki Lelong(RM)</th>
<th width="10%" align="center">Rugi Lelong(RM)</th>
<th width="10%" align="center">Caj Lelong(RM)</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="1">&nbsp;</td>
<td colspan="1" align="right">&nbsp;</td>
<td colspan="1" align="right">&nbsp;</td>
<td colspan="1" align="right">&nbsp;</td>
<td colspan="1" align="right">&nbsp;</td>
<td colspan="1" align="right">&nbsp;</td>
<td colspan="1" align="right">&nbsp;</td>
<td colspan="1" align="right">&nbsp;</td>
<td colspan="1" align="right">&nbsp;</td>
<td colspan="1" align="right">&nbsp;</td>
<td colspan="1" align="right">&nbsp;</td>
<td colspan="1" align="right"></td>
</tr>
<tr>
<td colspan="6" align="left"><strong>Jumlah Keseluruhan</strong></td>
<td colspan="1" align="right">&nbsp;</td>
<td colspan="1" align="right">&nbsp;</td>
<td colspan="1" align="right">&nbsp;</td>
<td colspan="1" align="right">&nbsp;</td>
<td colspan="1" align="right">&nbsp;</td>
<td colspan="1" align="right">&nbsp;</td>
<td colspan="1" align="right">&nbsp;</td>
</tr>
</tbody>
</table>
<br>
<br>
<br>
<br>
<br>
<br>
<table cellspacing="0" cellpadding="2" style="float:right;" border="1" width="100%" height="80" align="right" id="customers">
<thead>
<tr>
<th style="text-align:center;" colspan="10"><h3><b>JUMLAH BERAT MENGIKUT MUTU (KESELURUHAN)</b></h3></th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="1" align="left"><strong>MUTU &nbsp;</strong></td>
<td colspan="1" align="center">24Kgb &nbsp;</td>
<td colspan="1" align="center">24K&nbsp;</td>
<td colspan="1" align="center">23K&nbsp;</td>
<td colspan="1" align="center">22K&nbsp;</td>
<td colspan="1" align="center">21K&nbsp;</td>
<td colspan="1" align="center">20K&nbsp;</td>
<td colspan="1" align="center">18K&nbsp;</td>
<td colspan="1" align="center">14K&nbsp;</td>
<td colspan="1" align="center">9K&nbsp;</td>
</tr>
<tr>
<td colspan="1" align="left"><strong>BERAT(gm)</strong></td>
<td colspan="1" align="right">&nbsp;</td>
<td colspan="1" align="right">&nbsp;</td>
<td colspan="1" align="right">&nbsp;</td>
<td colspan="1" align="right">&nbsp;</td>
<td colspan="1" align="right">&nbsp;</td>
<td colspan="1" align="right">&nbsp;</td>
<td colspan="1" align="right">&nbsp;</td>
<td colspan="1" align="right">&nbsp;</td>
</tr>
</tbody>
</table>
<pre>&nbsp; </pre>
<script type="text/javascript">
function TotalPriceCalc() {
var total = 0;
$(".totalprice").each(function() {
total += parseFloat($(this).text());
});
$("#lblTotalPrice").val(total);
}
</script>
@@ -13,7 +13,8 @@
<div class="tab-content" id="nav-tabContent">
<div class="tab-pane fade show active" id="nav-simulasi" role="tabpanel" aria-labelledby="nav-simulasi-tab">
<br>
<form id="exportform" action="" method="POST">
<form id="exportform" action="{{route('analisa.export')}}" method="POST">
@csrf
<input type="hidden" name="type" value="User">
<div class="row">
<div class="col-md-5">
@@ -253,7 +254,7 @@
},
{
className: 'btn btn-outline-secondary pl-4 pr-4 btn-sm export',
titleAttr: 'Export to CSV',
titleAttr: 'Download to PDF',
text: '<i class="fas fa-download"></i>',
action: function ( e, dt, node, config ) {
$("#exportform").submit();
+1
View File
@@ -54,6 +54,7 @@ Route::group(['middleware' => ['permission:analisa'],'prefix'=>'analisa'], funct
Route::get('/deletesimulasi/{id}',['as'=>'analisa.delete','uses'=>'SimulasiController@delete']);
Route::post('/filter',['as'=>'analisa.filter','uses'=>'SimulasiController@filter']);
Route::post('/export',['as'=>'analisa.export','uses'=>'SimulasiController@export']);
});
Route::group(['middleware' => ['permission:sistem'],'prefix'=>'sistem'], function () {