laporan backdate update

This commit is contained in:
Amirah22
2022-10-30 10:18:50 +08:00
parent 72febb9dc4
commit fda7db5f1c
4 changed files with 350 additions and 2 deletions
+40 -1
View File
@@ -961,9 +961,48 @@ class ReportController extends Controller
public function bdbrglelong (){
return view('laporan.bdbrglelong');
$caw = Cawangan::all();
return view('laporan.bdbrglelong',compact('caw'));
}
public function cetakbdbrglelong (Request $request){
$current = Carbon::now();
$current = new Carbon();
$tarikh_cetak = $current->toDateString();
$arraydetails = [];
$cawangan_id = $request->caw;
if($request->datemula == null){
$mula_date = '2017-01-01';
}else{
$split_date = explode('-', $request->datemula);
$mula_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
}
if($request->datehingga == null){
$hingga_date = $current->toDateString();
}else{
$split_date = explode('-', $request->datehingga);
$hingga_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
}
$cawangan = Cawangan::where('cawangan.id',$cawangan_id)
->join('cawangan_lelong','cawangan.id','=','cawangan_lelong.caw_id')
->join('lelong','cawangan_lelong.lelong_id','=','lelong.id')
->join('lelongbid','cawangan.caw_code','=','lelongbid.kodcaw')
->where([['tarikh_lelong','>=',$request->datemula],['tarikh_lelong','<=',$request->datehingga]])
->get()->toArray();
return view('pdf.cetakbdbrglelong',compact('cawangan'));
}
+164 -1
View File
@@ -1 +1,164 @@
holla
@extends('layouts.app')
<style>
.radiostyle .radio-green {
background-color: #27ae60;
color:white;
box-shadow: 5px 10px #888888;
width:200px;
margin-right:5px;
transition: 0.5s ease;
}
.radiostyle .radio-red {
background-color: #e74c3c;
color:white;
width:200px;
margin-right:5px;
box-shadow: 5px 10px #888888;
transition: 0.5s ease;
}
.radiostyle .radio-yellow {
background-color: #3498db;
color:white;
width:200px;
margin-right:5px;
box-shadow: 5px 10px #888888;
transition: 0.5s ease;
}
.radiostyle .radio-green:hover {
box-shadow: 5px 5px #888888;
}
.radiostyle .radio-red:hover {
box-shadow: 5px 5px #888888;
}
.radiostyle .radio-yellow:hover {
box-shadow: 5px 5px #888888;
}
.radiostyle .radio-green input[type="radio"]:checked{
box-shadow: 5px 10px #888888;
}
.radiostyle .radio-yellow input[type="radio"]:checked{
box-shadow: 5px 10px #888888;
}
.radiostyle .radio-red input[type="radio"]:checked{
box-shadow: 5px 10px #888888;
}
</style>
@section('content')
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-body text-center">
<div class="row form-group">
<div class="col-md-5">
<h4> Laporan Barang Lelong Back Date</h4>
</div>
<div class="col-md-10">
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-30 mx-auto">
<form action="{{ route('backdate.cetakbdbrglelong') }}" target="_blank" method="post">
@csrf
<div class="input-group mb-10">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">Mula</span>
</div>
<input type="date" class="form-control" placeholder="Pilih Tarikh" aria-label="Tarikh" id="datemula" name="datemula">
<div class="input-group-prepend ml-2">
<span class="input-group-text" id="basic-addon1">Hingga</span>
</div>
<input type="date" class="form-control" placeholder="Pilih Tarikh" aria-label="Tarikh" id="datehingga" name="datehingga">
<div class="input-group-prepend ml-2">
<span class="input-group-text" id="basic-addon1">Cawangan</span>
</div>
<select class="custom-select" name="caw" id="caw">
<option value="">Please select</option>
@foreach ($caw as $item)
<option value="{{$item->id}}">{{$item->caw_name}}</option>
@endforeach
</select>
<input type="submit" class="btn btn-primary ml-md-5" id="submit_button" name="submit_button" value="Cetak">
</div>
</div>
</div>
<br><br>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var tablecustomers = $('#myTable').DataTable({
"ordering": false
});
$(document).ready( function () {
var today = new Date();
var dateObject = '';
$('#datemula').datepicker({
maxViewMode:1,
format: 'dd-mm-yyyy',
autoclose:true,
endDate: "today",
maxDate: today
});
$('#datehingga').datepicker({
maxViewMode:1,
format: 'dd-mm-yyyy',
autoclose:true,
endDate: "today",
maxDate: today
});
$('#datemula').change(function() {
$('#datehingga').datepicker('option', 'maxDate', new Date($(this).val()));
console.log($(this).val());
});
});
</script>
@endsection
@@ -0,0 +1,144 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<style>
#sim {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size:10px;
border-collapse: collapse;
width: 100%;
}
#sim td {padding:3px 5px 3px 5px; padding-right:10px;}, #sim th {
border: 0px solid;
padding: 1px;
text-align: left;
}
#sim tr:nth-child(even){}
#sim tr:hover {}
#sim th {
text-align: left;
border: 0px solid;
table-layout:auto;
color: black;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
}
* {
box-sizing: border-box;
}
.row {
margin-left:-5px;
margin-right:-5px;
}
.column {
float: left;
width: 100%;
padding: 5px;
}
/* Clearfix (clear floats) */
.row::after {
content: "";
clear: both;
display: table;
}
table {
border-collapse: collapse;
border-spacing: 0;
width: 200%;
border: 0px solid #ddd;
}
td {
text-align: left;
padding: 16px;
}
th{
text-align: left;
padding: 16px;
background-color:gainsboro;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
</style>
<body>
<table width="100%" border="0" id="sim">
<tr>
<td width="50%"><h3>PERMODALAN KELANTAN BERHAD</h3></td>
</tr>
<tr>
<td colspan="2"><u><b>LAPORAN BARANG LELONG</b></u></td>
</tr>
</table>
<table cellspacing="" cellpadding="5" text-align="left" border="0" height="25" align="left" id="sim">
<thead>
<br>
{{-- <tr>
@foreach ($arrayinfo as $laporan)
<td>ID Lelong : {{$laporan['laporan']['lelong_id']}}</td>
<td>Tarikh Lelong : @php
$myDateTime = DateTime::createFromFormat('Y-m-d', $laporan['laporan']['tarikh_lelong'] );
$t_lelong = $myDateTime->format('d-m-Y');
echo($t_lelong);
@endphp</td>
<td>Fasa : {{$laporan['laporan']['fasa']}}</td>
@foreach ($laporan['details'] as $details)
<td>Cawangan : {{$details['caw_name']}}
@endforeach
@endforeach
</tr> --}}
</thead>
</table>
<br>
<table cellspacing="0" cellpadding="5" style="float:right;" border="0" width="100%" height="80" align="left" id="sim">
<thead>
<tr>
<th width="5%" align="left">No</th>
<th width="25%" align="left">No Rujukan</th>
<th width="25%" align="left">Marhun</th>
<th width="25%" align="left">Berat (gm)</th>
<th width="25%" align="left">Harga Asas</th>
</tr>
</thead>
@foreach ($cawangan as $item)
<tr>
<td>{{ $loop->iteration }} </td>
<td>{{ $item['norujukan'] }}</td>
<td>{{ $item['marhun'] }}</td>
<td>{{ $item['berat'] }}</td>
<td>{{ $item['hargaasas'] }}</td>
</tr>
@endforeach</td>
</table>
</tbody>
+2
View File
@@ -562,6 +562,8 @@ Route::group(['middleware' => ['permission:reportcawkhas'],'prefix'=>'reportcawk
Route::group(['middleware' => ['permission:backdate'],'prefix'=>'backdate'], function () {
Route::get('/bdbrglelong',['as'=>'backdate.bdbrglelong','uses'=>'ReportController@bdbrglelong']);
Route::post('/cetakbdbrglelong',['as'=>'backdate.cetakbdbrglelong','uses'=>'ReportController@cetakbdbrglelong']);