jana notis, notis pdf, excel

This commit is contained in:
Amirah22
2022-03-02 15:08:40 +08:00
parent ac6f1d8ca4
commit cd55888d05
10 changed files with 12410 additions and 112 deletions
+36 -1
View File
@@ -18,6 +18,9 @@ use App\Models\Gadai;
use Carbon\Carbon;
use PDF;
use DateTime;
use Maatwebsite\Excel\Concerns\FromCollection;
use Excel;
class NotisController extends Controller
@@ -100,7 +103,6 @@ class NotisController extends Controller
$lelong = Lelong::where('id', $lelongid)->get();
// return view ('pdf.jananotis',compact('payment','lelong_id','lelongid','caw','tarikh_cetak'));
$pdf = PDF::loadView('pdf.jananotis',compact('payment','lelong_id','lelongid','caw','tarikh_cetak'))
->setPaper('a4', 'potrait');
@@ -111,6 +113,39 @@ class NotisController extends Controller
public function listnotis(Request $request){
$user = Auth::user();
$caw = Cawangan::where('caw_code','=',$user->kodcaw)
->first();
$lelong_id = $request->lelong_id;
$payment = LelongBid::join('gadai','lelongbid.norujukan','=','gadai.norujukan')
->where('lelongbid.lelong_id', $lelong_id)
->get()->toArray();
if($request->type == 'excel')
{
return view('excel.listnotis_excel',compact('payment','caw','lelong_id'));
}
else
{
$pdf = PDF::loadView('pdf.listnotis',compact('payment','caw','lelong_id'))
->setPaper('a4', 'landscape');
return $pdf->download('Senarai Notis.pdf');
}
}
}
+6 -3
View File
@@ -56,9 +56,9 @@ class SerahanController extends Controller
return view('serahan.laporanserahan',compact('lelongbid','lelongid'));
}
public function pembayaran($id){
public function pembayaran($lelong_id){
$lelong_id = $id;
$lelong_id = $lelong_id;
$payment = LelongBidder::join('lelongbid', 'lelongbidder.lelongbid_id', '=', 'lelongbid.id')
->where('lelongbidder.status_bidder', 1)
@@ -130,6 +130,7 @@ class SerahanController extends Controller
public function resitpembayaran($user_id, $lelong_id)
{
$user = Auth::user();
$caw = Cawangan::where('caw_code','=',$user->kodcaw)->first()->toArray();
@@ -141,8 +142,10 @@ class SerahanController extends Controller
->first();
$invois = Payment::join('resit','payment.resit_id','=','resit.id')
->where('payment.id',$lelong_id)
->where('resit.id',$lelong_id)
->first();
// dd($invois);
$SAGWin = LelongBidder::join('lelongbid', 'lelongbidder.lelongbid_id', '=', 'lelongbid.id')
->where('user_id',$user_id)
+9337 -26
View File
File diff suppressed because it is too large Load Diff
+2759
View File
File diff suppressed because one or more lines are too long
@@ -0,0 +1,102 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script src="{{ asset('js/table2excel.js') }}"></script>
<style>
.letter{
font-family:'Times New Roman', Times, serif;
}
.row::after {
content: "";
clear: both;
display: table;
}
.first-prgph{
float: left;
width: 10%;
padding: 2px;
}
.first-prgph1{
float: left;
width: 30%;
padding-left: 50px;
}
.page-break {
page-break-before: always;
}
.name{
padding-top: 40px;
}
</style>
<body>
<div class = "letter">
<div class="row">
<div class="first-prgph">
<img src="http://lelongrpt.test/img/icon_pkb.png" alt="PKB LOGO" width="100" height="100">
</div>
<div class="first-prgph1">
<p> {{$caw['caw_name']}}<br>
{{$caw['alamat1']}}<br>
{{$caw['alamat2']}}<br>
No Tel: {{$caw['notel']}}<br>
No Faks: {{$caw['nofaks']}}
</p><br>
</div>
<br>
</div>
<table width="100%" height="168" id="customers">
<thead>
<tr>
<th>No</th>
<th>No Rujukan</th>
<th>JBG</th>
<th>No KP</th>
<th>Pembiayaan</th>
<th>Keuntungan 6 Bulan</th>
<th>Bayaran Telah Dibuat</th>
</tr>
</thead>
@foreach($payment as $pay)
<tr>
<td>{{ $loop->iteration }} </td>
<td>{{ $pay['norujukan']}}</td>
<td>{{ $pay['jbg']}}</td>
<td>{{ $pay['nokp']}}</td>
<td>{{ $pay['pinjaman']}}</td>
<td>{{ $pay['bakiupah']}}</td>
<td></td>
{{-- join online_arrahn table (transaksi_keuntungan) --}}
@endforeach
</div>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function () {
// window.print();
// window.onfocus=function(){ window.close();}
var table2excel = new Table2Excel();
table2excel.export(document.querySelectorAll("#customers"),'senarai_notis');
setTimeout(function(){ window.close() }, 1000);
});
</script>
@@ -1,11 +1,23 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid">
<div class="row ">
<div class="col-md-11 mx-auto card p-4">
<table class="table table-striped table-xl text-center" style="width:100%">
@if ($message = Session::get('success'))
<div class="alert alert-success">
<p>{{ $message }}</p>
</div>
@endif
<form id="exportpdf" action="{{route('jananotis.listnotis')}}" method="POST">
{{-- <form id="exportexcel" action="{{route('jananotis.listnotis_excel')}}" method="POST"> --}}
@csrf
<input type="hidden" name="type" id="typedonwload" value="">
<input type="hidden" name="lelong_id" value="{{ $lelong_id}}">
<table class="table table-striped table-xl" id="notis" style="width:100%">
<thead class="bg-primary text-white">
<tr>
<th>No</th>
@@ -29,9 +41,6 @@
<td></td>
{{-- join online_arrahn table (transaksi_keuntungan) --}}
</tr>
@endforeach
</tbody>
</table>
@@ -39,26 +48,8 @@
</div>
</div>
<script>
$('a.confirmdel').confirm({
title: 'Confirmation',
content: 'Anda pasti?',
type: 'orange',
typeAnimated: true,
buttons: {
Delete: {
btnClass: 'btn-warning',
action: function () {
location.href = this.$target.attr('href');
}
},
Batal: {
btnClass: 'btn-default',
action: function () {}
}
}
});
var tablesimulasi = $('#simulasi').DataTable( {
var tablelelongbid= $('#notis').DataTable( {
"columnDefs": [
{
"targets": 0,
@@ -69,46 +60,43 @@
"orderable": false
}
],
order: [[1, 'asc']],
// "ordering": false,
// order: [[1, 'asc']],
// // "ordering": false,
"info": false,
"lengthChange": false,
"pageLength": 15,
dom: 'Bfrtip',
buttons: [
// 'copy', 'excel', 'pdf'
// { text: 'copy', className: 'btn btn-primary' },
{
className: 'btn btn-outline-success pl-4 pr-4 btn-sm addsim',
text: '<i class="fas fa-plus" id="test"></i>',
titleAttr: 'Tambah Simulasi',
className: 'btn btn-outline-secondary pl-4 pr-4 btn-sm export',
titleAttr: 'Export to Excel',
text: '<i class="fas fa-download"></i>',
action: function ( e, dt, node, config ) {
alert( 'Button activated' );
$('#typedonwload').val('excel');
$("#exportpdf").submit();
}
},
{
className: 'btn btn-outline-secondary pl-4 pr-4 btn-sm export',
titleAttr: 'Export to CSV',
titleAttr: 'Export to PDF',
text: '<i class="fas fa-download"></i>',
action: function ( e, dt, node, config ) {
$("#exportform").submit();
$('#typedonwload').val('pdf');
$("#exportpdf").submit();
}
}
]
});
$('.addsim').tooltip();
$('.export').tooltip();
// $( '.dt-buttons').addClass('btn-group');
$( '.addsim').removeClass('dt-button');
$( '.export').removeClass('dt-button');
function selectall(cb) {
tablesimulasi.rows().nodes().to$().find('input[type="checkbox"]').each(function(){
$(this).prop('checked', cb.checked);
})
}
</script>
@endsection
+91
View File
@@ -0,0 +1,91 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<style>
.letter{
font-family:'Times New Roman', Times, serif;
}
.row::after {
content: "";
clear: both;
display: table;
}
.first-prgph{
float: left;
width: 10%;
padding: 2px;
}
.first-prgph1{
float: left;
width: 30%;
padding-left: 50px;
}
.page-break {
page-break-before: always;
}
.name{
padding-top: 40px;
}
</style>
<body>
<div class = "letter">
<div class="row">
<div class="first-prgph">
<img src="http://lelongrpt.test/img/icon_pkb.png" alt="PKB LOGO" width="100" height="100">
</div>
<div class="first-prgph1">
<p> {{$caw['caw_name']}}<br>
{{$caw['alamat1']}}<br>
{{$caw['alamat2']}}<br>
No Tel: {{$caw['notel']}}<br>
No Faks: {{$caw['nofaks']}}
</p><br>
</div>
<br>
</div>
<table width="100%" height="168" id="customers">
<thead>
<tr>
<th>No</th>
<th>No Rujukan</th>
<th>JBG</th>
<th>No KP</th>
<th>Pembiayaan</th>
<th>Keuntungan 6 Bulan</th>
<th>Bayaran Telah Dibuat</th>
</tr>
</thead>
@foreach($payment as $pay)
<tr>
<td>{{ $loop->iteration }} </td>
<td>{{ $pay['norujukan']}}</td>
<td>{{ $pay['jbg']}}</td>
<td>{{ $pay['nokp']}}</td>
<td>{{ $pay['pinjaman']}}</td>
<td>{{ $pay['bakiupah']}}</td>
<td></td>
{{-- join online_arrahn table (transaksi_keuntungan) --}}
@endforeach
</div>
</body>
@@ -55,7 +55,7 @@
</tr>
<tr>
<td>{{$caw['alamat1']}}</td>
<td align="right">No.Slip: {{$invois->reference_no}}</td>
<td align="right">No.Slip: {{$invois['reference_no']}}</td>
</tr>
<tr>
<td>{{$caw['alamat2']}}</td>
+6
View File
@@ -44,6 +44,12 @@
}
</style>
<div class="row">
<div class="first-prgph">
<img src="http://lelong.test/img/icon_pkb.png" alt="PKB LOGO" width="100" height="100">
</div>
<h5><u>SENARAI BARANG LELONGAN DIBIDA OLEH PEMBIDA</u></h5>
<table width="100%" border="0" id="marhun">
<tr>
+3
View File
@@ -160,6 +160,9 @@ Route::group(['middleware' => ['permission:jananotis'],'prefix'=>'jananotis'], f
Route::get('/notislelong',['as'=>'jananotis.notislelong','uses'=>'NotisController@notislelong']);
Route::get('/senarainotis/{lelong_id}',['as'=>'jananotis.senarainotis','uses'=>'NotisController@senarainotis']);
Route::get('/jananotis/{lelong_id}',['as'=>'jananotis.jananotis','uses'=>'NotisController@jananotis']);
Route::post('/listnotis',['as'=>'jananotis.listnotis','uses'=>'NotisController@listnotis']);