Merge branch 'atie' into 'main'
add function notis fasa 2 See merge request online-sistem1/lelong!195
This commit is contained in:
@@ -55,6 +55,17 @@ class NotisController extends Controller
|
||||
->join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
|
||||
->where('cawangan.caw_code','=',$user->kodcaw)
|
||||
->get();
|
||||
// dd($lelongid);
|
||||
foreach($lelongid as $index1=>$bil){
|
||||
$listsag = LelongBid::where('lelong_id', $bil['lelong_id'])
|
||||
->where('kodcaw','=',$user->kodcaw)
|
||||
->get();
|
||||
|
||||
|
||||
$lelongid[$index1]['bilangan'] = sizeof($listsag);
|
||||
// dd(sizeof($listsag));
|
||||
|
||||
}
|
||||
|
||||
return view('jananotis.notislelong',compact('lelongid'));
|
||||
}
|
||||
@@ -146,7 +157,7 @@ class NotisController extends Controller
|
||||
$listsag = Gadai::on($datalelong[0]['kodcaw'])->whereIn('norujukan', $arraynorujukan)
|
||||
->where('nokp','=',$cal['nokp'])
|
||||
->get();
|
||||
// dd($listgadai);
|
||||
// dd($listsag);
|
||||
foreach($listsag as $index=>$listing){
|
||||
|
||||
$bayaran = $listing['hargajualan'] - $listing['bakihargajualan'];
|
||||
@@ -182,7 +193,7 @@ class NotisController extends Controller
|
||||
$pdf = PDF::loadView('pdf.jananotis',compact('marhuns','lelong_id','lelongid','caw','tarikh_cetak','customer','listsag'))
|
||||
->setPaper('a4', 'potrait');
|
||||
|
||||
return $pdf->download('Penjanaan Notis.pdf');
|
||||
return $pdf->download('Penjanaan Notis Fasa 1: ID Lelong '.$lelong_id.'.pdf');
|
||||
|
||||
}
|
||||
|
||||
@@ -325,6 +336,94 @@ class NotisController extends Controller
|
||||
return view('jananotis.kemaskininotisbycaw',compact('caw'));
|
||||
|
||||
|
||||
}
|
||||
public function jananotisfasa2($lelong_id){
|
||||
|
||||
$user = Auth::user();
|
||||
|
||||
$caw = Cawangan::where('caw_code','=',$user->kodcaw)
|
||||
->first();
|
||||
|
||||
$lelong_id = $lelong_id;
|
||||
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
$tarikh_cetak = $current->toDateString();
|
||||
|
||||
$marhun = LelongBid::join('cawangan', 'lelongbid.caw_id', '=', 'cawangan.id')
|
||||
->where('lelong_id','=',$lelong_id)
|
||||
->where('lelongbid.kodcaw','=',$user->kodcaw);
|
||||
|
||||
$arraynorujukan = $marhun->pluck('norujukan')->toArray();
|
||||
$datalelong = $marhun->get();
|
||||
$marhuns = Gadai::on($datalelong[0]['kodcaw'])->whereIn('norujukan', $arraynorujukan)
|
||||
->select('nokp','norujukan')
|
||||
->get();
|
||||
// dd($marhuns);
|
||||
$arraysag = [];
|
||||
|
||||
|
||||
foreach($marhuns as $index1=>$cal){
|
||||
$customer = Customer::where('kpbaru','=',$cal['nokp'])
|
||||
->orWhere('kplama','=',$cal['nokp'])
|
||||
->join('poskod','customer.poskod','=','poskod.poskod')
|
||||
->join('daerah','poskod.koddaerah','=','daerah.koddaerah')
|
||||
->join('negeri','poskod.kodnegeri','=','negeri.kodnegeri')
|
||||
->first();
|
||||
|
||||
$listsag = Gadai::on($datalelong[0]['kodcaw'])->whereIn('norujukan', $arraynorujukan)
|
||||
->where('nokp','=',$cal['nokp'])
|
||||
->get();
|
||||
// dd($listsag);
|
||||
foreach($listsag as $index=>$listing){
|
||||
|
||||
$bayaran = $listing['hargajualan'] - $listing['bakihargajualan'];
|
||||
|
||||
}
|
||||
$marhuns[$index1]['nama'] = ($customer) ? $customer : dd($cal['nokp']);
|
||||
$marhuns[$index1]['listsag'] = $listsag;
|
||||
|
||||
|
||||
}
|
||||
|
||||
$lelongid = CawanganLelong::join('lelong','cawangan_lelong.lelong_id','=','lelong.id')
|
||||
->join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
|
||||
->where('cawangan.caw_code','=',$user->kodcaw)
|
||||
->where('cawangan_lelong.lelong_id', $lelong_id)
|
||||
->get();
|
||||
|
||||
// return view('pdf.jananotisfasa2',compact('marhuns','lelong_id','lelongid','caw','tarikh_cetak','customer','listsag'));
|
||||
$pdf = PDF::loadView('pdf.jananotisfasa2',compact('marhuns','lelong_id','lelongid','caw','tarikh_cetak','customer','listsag'))
|
||||
->setPaper('a4', 'potrait');
|
||||
|
||||
return $pdf->download('Penjanaan Notis Fasa 2: ID Lelong '.$lelong_id.'.pdf');
|
||||
|
||||
}
|
||||
|
||||
public function storeallfasa2(Request $request) {
|
||||
|
||||
|
||||
// dd($request->all());
|
||||
$tetapan = Tetapan::find(1);
|
||||
|
||||
$tetapan->para3 = $request->para3;
|
||||
$tetapan->update();
|
||||
|
||||
$cawangan = Cawangan::all();
|
||||
|
||||
foreach($cawangan as $updatecaw){
|
||||
|
||||
$update = Cawangan::where('id', $updatecaw['id'])
|
||||
->update(['para3'=>$request->para3]);
|
||||
// $update->para2 = $request->para2;
|
||||
// $update->update();
|
||||
|
||||
}
|
||||
|
||||
return redirect()->route('jananotis.kemaskininotis')
|
||||
->with('success','Kemaskini Berjaya');
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,10 +7,11 @@
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.10/js/select2.min.js"></script>
|
||||
<script src="https://cdn.ckeditor.com/4.16.2/standard/ckeditor.js"></script>
|
||||
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row ">
|
||||
<div class="col-md-12 mx-auto card">
|
||||
<h3 class="pt-3">Kemaskini Notis Lelong</h3>
|
||||
<h3 class="pt-3">Kemaskini Notis Lelong Fasa 1</h3>
|
||||
|
||||
@if ($message = Session::get('failed'))
|
||||
<div class="alert alert-danger">
|
||||
@@ -41,6 +42,40 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row ">
|
||||
<div class="col-md-12 mx-auto card">
|
||||
<h3 class="pt-3">Kemaskini Notis Lelong Fasa 2</h3>
|
||||
|
||||
@if ($message = Session::get('failed'))
|
||||
<div class="alert alert-danger">
|
||||
<p>{{ $message }}</p>
|
||||
</div>
|
||||
@endif
|
||||
<form action="{{route('jananotis.storeallfasa2')}}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@foreach($tetapan as $notis)
|
||||
{{-- {{dd($notis->para2)}} --}}
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-4" id="para3">
|
||||
<textarea name="para3" id="article-ckeditor2" >
|
||||
{{$notis->para3}}
|
||||
</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-10">
|
||||
<button type="submit" class="btn btn-primary">Simpan</button>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
CKEDITOR.replace( 'article-ckeditor', {
|
||||
height: 400,
|
||||
@@ -48,6 +83,15 @@
|
||||
|
||||
} );
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
CKEDITOR.replace( 'article-ckeditor2', {
|
||||
height: 400,
|
||||
width: 1500
|
||||
|
||||
} );
|
||||
</script>
|
||||
<script>
|
||||
$('#caw').select2({
|
||||
width: '100%',
|
||||
|
||||
@@ -15,9 +15,11 @@
|
||||
<table class="table table-striped table-xl" id="tablenotislelong" style="width:100%">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr>
|
||||
<th><input type="checkbox" aria-label="Checkbox for following text input" onclick="selectall(this)"></th>
|
||||
{{-- <th><input type="checkbox" aria-label="Checkbox for following text input" onclick="selectall(this)"></th> --}}
|
||||
<th>ID Lelong</th>
|
||||
<th>Tarikh Lelong</th>
|
||||
<th>Fasa</th>
|
||||
<th>Bilangan SAG</th>
|
||||
<th class="text-center">Tindakan</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -25,15 +27,27 @@
|
||||
|
||||
@foreach ($lelongid as $bid)
|
||||
<tr>
|
||||
<td><input type="checkbox" aria-label="Checkbox for following text input" name="checkboxdata[]" value="{{ $bid->id }}"></td>
|
||||
{{-- <td><input type="checkbox" aria-label="Checkbox for following text input" name="checkboxdata[]" value="{{ $bid->id }}"></td> --}}
|
||||
<td>{{ $bid->lelong_id}}</td>
|
||||
<td>{{ $bid->tarikh_lelong }}</td>
|
||||
<td> @php
|
||||
$myDateTime = DateTime::createFromFormat('Y-m-d', $bid->tarikh_lelong );
|
||||
$datez = $myDateTime->format('d-m-Y');
|
||||
echo($datez);
|
||||
@endphp</td>
|
||||
<td>{{ $bid->fasa }}</td>
|
||||
<td>{{ $bid['bilangan'] }}</td>
|
||||
<td class="text-center">
|
||||
<a href="{{ route('jananotis.jananotis',$bid->lelong_id) }}" data-toggle="tooltip" data-placement="top" title="Muat Turun Jana Notis" style="margin-right:40px" ><i class="fas fa-download"></i></a>
|
||||
@if($bid->fasa == '1')
|
||||
<a href="{{ route('jananotis.jananotis',$bid->lelong_id) }}" data-toggle="tooltip" data-placement="top" title="Muat Turun Jana Notis Fasa 1" style="margin-right:40px" ><i class="fas fa-download"></i></a>
|
||||
|
||||
@elseif($bid->fasa == '2')
|
||||
<a href="{{ route('jananotis.jananotisfasa2',$bid->lelong_id) }}" data-toggle="tooltip" data-placement="top" title="Muat Turun Jana Notis Fasa 2" style="margin-right:40px" ><i class="fas fa-download"></i></a>
|
||||
@endif
|
||||
<a href="{{ route('jananotis.senarainotis',$bid->lelong_id) }}" data-toggle="tooltip" data-placement="top" title="Butiran Senarai Notis" ><i class="far fa-edit"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
@@ -226,7 +226,8 @@
|
||||
<tr>
|
||||
<td>Waktu</td>
|
||||
<td>:</td>
|
||||
<td>{{ date('H:i',strtotime($notis['masa'])). ' pagi' }}</td>
|
||||
{{-- <td>{{ date('H:i',strtotime($notis['masa'])). ' pagi' }}</td> --}}
|
||||
<td>{{ '10.30 pagi' }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -240,7 +241,7 @@
|
||||
@endphp:-</b></p>
|
||||
|
||||
|
||||
@php echo $caw['para2']; @endphp
|
||||
@php echo $caw['para3']; @endphp
|
||||
<p>Notis:</p>
|
||||
<i>Sila bawa bersama Surat Akaun Gadai (SAG) untuk sebarang urusan.</i>
|
||||
<br>
|
||||
|
||||
@@ -0,0 +1,255 @@
|
||||
<style>
|
||||
#header {
|
||||
/* font-family: Arial, Helvetica, sans-serif; */
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#header td, #customers th {
|
||||
|
||||
padding-left:4px;
|
||||
font-size:12px;
|
||||
}
|
||||
|
||||
#header tr:nth-child(even){background-color: #ffffff;}
|
||||
|
||||
#header tr:hover {background-color: #ddd;}
|
||||
|
||||
#header th {
|
||||
/* padding-top: 12px;
|
||||
padding-bottom: 12px; */
|
||||
text-align: left;
|
||||
/* padding:4px; */
|
||||
color:black;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
#scan {
|
||||
/* font-family: Arial, Helvetica, sans-serif; */
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#scan td, #scan th {
|
||||
|
||||
padding: 8px;
|
||||
font-size:11px;
|
||||
}
|
||||
|
||||
#scan tr:nth-child(even){background-color: #ffffff;}
|
||||
|
||||
#scan tr:hover {background-color: #ddd;}
|
||||
|
||||
#scan th {
|
||||
padding-top: 12px;
|
||||
padding-bottom: 12px;
|
||||
text-align: left;
|
||||
padding:4px;
|
||||
color:black;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<style>
|
||||
#scan {
|
||||
/* font-family: Arial, Helvetica, sans-serif; */
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#scan td, #scan th {
|
||||
border-collapse: collapse;
|
||||
padding: 8px;
|
||||
font-size:11px;
|
||||
}
|
||||
|
||||
#scan tr:nth-child(even){background-color: #ffffff;}
|
||||
|
||||
#scan tr:hover {background-color: #ddd;}
|
||||
|
||||
#scan th {
|
||||
border-collapse: collapse;
|
||||
padding-top: 12px;
|
||||
padding-bottom: 12px;
|
||||
text-align: left;
|
||||
padding:4px;
|
||||
color:black;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
#details {
|
||||
/* font-family: Arial, Helvetica, sans-serif; */
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#details td, #details th {
|
||||
|
||||
padding: 8px;
|
||||
font-size:11px;
|
||||
}
|
||||
|
||||
#details tr:nth-child(even){background-color: #ffffff;}
|
||||
|
||||
#details tr:hover {background-color: #ddd;}
|
||||
|
||||
#details th {
|
||||
padding-top: 12px;
|
||||
font-style:bold;
|
||||
padding-bottom: 12px;
|
||||
text-align: left;
|
||||
padding:4px;
|
||||
color:black;
|
||||
}
|
||||
.container{
|
||||
page-break-after:always;
|
||||
padding: 20px 20px 20px 20px;
|
||||
}
|
||||
.tablestyle{
|
||||
font-size:12px;
|
||||
}
|
||||
.tablestyle td, .tablestyle th{
|
||||
/* padding-top: 12px; */
|
||||
/* border:1px solid black; */
|
||||
|
||||
}
|
||||
.page-break {
|
||||
page-break-before: always;
|
||||
}
|
||||
</style>
|
||||
@foreach($marhuns as $index1=> $notis)
|
||||
{{-- {{dd($notis['nama']['alamat1'])}} --}}
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="container">
|
||||
<table id="header">
|
||||
<tr>
|
||||
{{-- <th rowspan="4"style="width:100px"><br><img src="{{ asset('img/icon_pkb.png') }}" style="width:70px"></img></th> --}}
|
||||
<th colspan="1">{{ $caw['caw_name'] }}</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align:top;">{{ $caw['alamat1'] }}</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align:top;">{{ $caw['alamat2'] }}</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align:top;">{{ ' No Tel : '. $caw['notel'] . ' No Faks : '. $caw['nofaks'] }}</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
|
||||
|
||||
<div>
|
||||
<table class="tablestyle">
|
||||
<tr>
|
||||
<td width="15%">TARIKH CETAK
|
||||
</td>
|
||||
<td width="1%">:</td>
|
||||
<td width="43%">@php
|
||||
$myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_cetak);
|
||||
$datez = $myDateTime->format('d-m-Y');
|
||||
echo($datez);
|
||||
@endphp
|
||||
<td colspan="3"></td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>NO RUJUKAN</td>
|
||||
<td>:</td>
|
||||
<td>{{ $notis['norujukan']}}</td>
|
||||
<td></td>
|
||||
<td width="14%">NO TELEFON</td>
|
||||
<td width="1%">:</td>
|
||||
<td>{{ $notis['nama']['telefon'] }}</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align:top;">KEPADA</td>
|
||||
<td style="vertical-align:top;">:</td>
|
||||
<td style="vertical-align:top;">{{ $notis['nama']['nama']}}
|
||||
<br> {{ strtoupper($notis['nama']['alamat1']) }}
|
||||
{{-- {!! ($notis['nama']['alamat1'] === null || $notis['nama']['alamat1'] === '') ? '' : '<br>' . strtoupper($notis['nama']['alamat1']) !!} <br> --}}
|
||||
{!! ($notis['nama']['alamat2'] === null || $notis['nama']['alamat2'] === '') ? '' : '<br>' . strtoupper($notis['nama']['alamat2']) !!} <br>
|
||||
{{ ' ' . $notis['nama']['poskod'] . ' ' . strtoupper($notis['nama']['namadaerah']) . ' ' . strtoupper($notis['nama']['negeri'])}}</td>
|
||||
<td></td>
|
||||
<td style="vertical-align:top;">NO K/P</td>
|
||||
<td style="vertical-align:top;">:</td>
|
||||
<td style="vertical-align:top;"> {{ $notis['nokp'] }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@foreach ($lelongid as $bid)
|
||||
|
||||
<p>Tuan/Puan,</p>
|
||||
<h4>LELONGAN BARANGAN GADAIAN SECARA TENDER PADA
|
||||
@php
|
||||
$myDateTime = DateTime::createFromFormat('Y-m-d', $bid->tarikh_lelong);
|
||||
$datez = $myDateTime->format('d-m-Y');
|
||||
echo($datez);
|
||||
|
||||
@endphp</h4>
|
||||
<p>Dengan hormatnya kami ingin memaklumkan bahawa barang-barang cagaran tuan/puan yang digadai di cawangan seperti di atas <strong>akan/telah tamat kontrak dan akan dilelong.</strong></p>
|
||||
|
||||
<p>Butiran lelongan adalah seperti berikut :-</p>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>Tarikh</td>
|
||||
<td>:</td>
|
||||
<td> @php
|
||||
$myDateTime = DateTime::createFromFormat('Y-m-d', $bid->tarikh_lelong);
|
||||
$datez = $myDateTime->format('d-m-Y');
|
||||
echo($datez);
|
||||
@endphp</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cawangan</td>
|
||||
<td>:</td>
|
||||
<td>{{ $caw['caw_name'] }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Waktu</td>
|
||||
<td>:</td>
|
||||
{{-- <td>{{ date('H:i',strtotime($notis['masa'])). ' pagi' }}</td> --}}
|
||||
<td>{{ '10.30 pagi' }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<p>Tuan/Puan adalah dikehendaki untuk membuat urusan berikut <b>pada atau sebelum
|
||||
@php
|
||||
$myDateTime = DateTime::createFromFormat('Y-m-d', $bid->tarikh_lelong );
|
||||
$datez = $myDateTime->modify('-2 day')->format('d-m-Y');
|
||||
echo($datez);
|
||||
|
||||
@endphp:-</b></p>
|
||||
|
||||
|
||||
@php echo $caw['para3']; @endphp
|
||||
<p>Notis:</p>
|
||||
<i>Sila bawa bersama Surat Akaun Gadai (SAG) untuk sebarang urusan.</i>
|
||||
<br>
|
||||
<i>Sila abaikan notis ini sekiranya penebusan telah dibuat.</i>
|
||||
|
||||
<p>Surat ini adalah cetakan komputer dan tiada tandatangan diperlukan</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endforeach
|
||||
@@ -390,6 +390,8 @@ Route::group(['middleware' => ['permission:jananotis'],'prefix'=>'jananotis'], f
|
||||
|
||||
Route::post('/store',['as'=>'jananotis.store','uses'=>'NotisController@store']);
|
||||
Route::get('/kemaskininotisbycaw',['as'=>'jananotis.kemaskininotisbycaw','uses'=>'NotisController@kemaskininotisbycaw']);
|
||||
Route::get('/jananotisfasa2/{lelong_id}',['as'=>'jananotis.jananotisfasa2','uses'=>'NotisController@jananotisfasa2']);
|
||||
Route::post('/storeallfasa2',['as'=>'jananotis.storeallfasa2','uses'=>'NotisController@storeallfasa2']);
|
||||
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user