notis_call function

This commit is contained in:
nishaMuhd
2024-01-14 14:11:05 +08:00
parent 06396e236c
commit 5e19ec952d
6 changed files with 1060 additions and 2 deletions
@@ -0,0 +1,328 @@
@extends('layouts.app_callcenter')
<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>
<style>
#details {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#details td,
#details th {
padding: 8px;
font-size: 12px;
}
#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;
}
</style>
@section('content')
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="card">
<nav aria-label="breadcrumb">
<ol class="breadcrumb pb-3">
<li class="breadcrumb-item"><a href="{{ route('home') }}">Home</a></li>
<li class="breadcrumb-item"><a href="{{ route('arcc.notisperingatankedua') }}">Notis Peringatan Kedua</a></li>
<li class="breadcrumb-item"><a href="{{ route('arcc.rekodnotisperingatankedua') }}">Rekod Notis Peringatan Kedua</a></li>
<li class="breadcrumb-item active" aria-current="page">Mengikut Cawangan</li>
<li class="breadcrumb-item active" aria-current="page">{{$cawangan_info['details_caw']}}</li>
<li class="breadcrumb-item active" aria-current="page">Notis JBG</li>
</ol>
</nav>
<div class="card-body text-center">
<div class="row form-group">
<div class="col-md-2">
</div>
<div class="col-md-10">
</div>
</div>
@if ($message = Session::get('success'))
<div class="alert alert-success">
<p>{{ $message }}</p>
</div>
@elseif ($message = Session::get('failed'))
<div class="alert alert-danger">
<p>{{ $message }}</p>
</div>
@endif
<div class="container-fluid">
<form id="exportpdf" action="" target="_blank" method="POST">
@csrf
<input type="hidden" name="type" id="typedonwload" value="">
<input type='hidden' name="radaktif" value="aktif">
<input type='hidden' name="notisid" value="{{$notisid}}">
<input type='hidden' name="kodcaw" value="{{$kodcaw}}">
<table class="table table-striped table-hover" id="details">
<thead>
<th>Bil</th>
<th>Status</th>
<th>Nama</th>
<th>No. KP</th>
<th>No. Telefon</th>
<th>Norujukan</th>
<th>Tempoh</th>
<th>Baki Pembiayaan (RM)</th>
<th>Keuntungan 6Bulan (RM)</th>
<th>Amaun Telah Bayar (RM)</th>
<th>Keuntungan Semasa (RM)</th>
<th>Tarikh Matang</th>
<th>Tarikh Tamat Kontrak</th>
<th>Tarikh Panggilan</th>
<th>Nota</th>
<th>Tindakan</th>
</thead>
@php
$counter = 1;
$totalpinjaman = 0;
@endphp
@foreach ($bycawnotisjbg['rekod'] as $index => $item)
@php
$totalpinjaman += $item['listsag'][0]['pinjaman'];
if ($item['listnotis'][0]['statuscall'] == 0) {
$status = 'Belum Hubungi';
} elseif ($item['listnotis'][0]['statuscall'] == 1) {
$status = 'Berjaya Hubungi';
} else {
$status = 'Tidak Dapat Hubungi';
}
$nota = $item['listnotis'][0]['remark1'];
@endphp
<tr>
<td>{{ $loop->iteration }}</td>
<td style="white-space: nowrap">{{ $status ?? '-' }}</td>
<td style="white-space: nowrap;">{{ $item['info']['nama'] ?? '-' }}</td>
@php
$nokp = $item['info']['kpbaru'] ?? $item['info']['kplama'];
@endphp
<td>{{ $nokp }}<input type="hidden" name="nokp[]" value="{{ $nokp }}"></td>
<td>{{ $item['info']['telefon'] ?? '-' }}<input type="hidden" name="telefon[]" value="{{ $item['info']['telefon'] ?? ''}}"></td>
<td style="white-space: nowrap;">@foreach($item['listsag'] as $item1){{ $item1['norujukan']}}<br>@endforeach</td>
<td>@foreach($item['listsag'] as $item1){{ $item1['jbg']}}<br>@endforeach</td>
<td align='right' style="white-space: nowrap;">@foreach($item['listsag'] as $item1){{number_format($item1['bakipjm'], 2, '.', ',')}}<br>@endforeach</td>
<td align='right' style="white-space: nowrap;">@foreach($item['listsag'] as $item1){{number_format($item1['bakiupah'], 2, '.', ',')}}<br>@endforeach</td>
<td align='right' style="white-space: nowrap;">@foreach($item['listsag'] as $item1){{number_format($item1['hargajualan']-$item1['bakihargajualan'], 2, '.', ',')}}<br>@endforeach</td>
<td align='right' style="white-space: nowrap;">@foreach($item['listsag'] as $item1){{number_format($item1['keuntungan'], 2, '.', ',')}}<br>@endforeach<br></td>
<td align='right' style="white-space: nowrap;"><b> @foreach($item['listsag'] as $item1)
@if($item1['t_matang'] == null)
@else
@php
$myDateTime = DateTime::createFromFormat('Y-m-d', $item1['t_matang']);
$formattedtmatang = $myDateTime->format('d-m-Y');
echo($formattedtmatang);
@endphp
@endif
<br>
@endforeach
<br>
</b></td>
<td align='right' style="white-space: nowrap;"><b> @foreach($item['listsag'] as $item1)
@if($item1['t_matang1'] == null)
@else
@php
$myDateTime = DateTime::createFromFormat('Y-m-d', $item1['t_matang1']);
$formattedtmatang1 = $myDateTime->format('d-m-Y');
echo($formattedtmatang1);
@endphp
@endif
<br>
@endforeach
<br>
</b></td>
<td align='right' style="white-space: nowrap;"><b> @foreach($item['listnotis'] as $item1)
@if($item1['tarikhcall1'] == null)
@else
@php
$myDateTime = DateTime::createFromFormat('Y-m-d', $item1['tarikhcall1']);
$formattedweddingdate = $myDateTime->format('d-m-Y');
echo($formattedweddingdate);
@endphp
@endif
<br>
@endforeach
<br>
</b></td>
<td align="left">{{$nota ?? ' '}}</td>
<!-- <td style="white-space: nowrap;"><a href="{{ route('arcc.detsagcallbyjbg2', [ 'kodcaw' => $kodcaw, 'notisid' => $notisid, 'nokp' => $item['nokp'] ]) }}" class="btn btn-info text-white">Hubungi</a></td> -->
<td>
@if ($item['listnotis'][0]['statuscall'] == 0 || $item['listnotis'][0]['statuscall'] == 9)
<a href="{{ route('arcc.detsagcallbyjbg2', [ 'kodcaw' => $kodcaw, 'notisid' => $notisid, 'nokp' => $nokp ]) }}" class="btn btn-info text-white">Hubungi</a>
<!-- <td style="white-space: nowrap;"><button type="button" style="margin:auto" class="btn btn-primary" onclick="callcustomer()">Hubungi</td> -->
@else
-
@endif
</td>
</tr>
@php $counter++; @endphp
@endforeach
</table>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
var tablelelongbid = $('#details').DataTable({
"columnDefs": [{
"targets": 0,
"target": '_blank',
"orderable": false
},
{
"targets": 5,
"orderable": false
}
],
// order: [[1, 'asc']],
// // "ordering": false,
"info": false,
"lengthChange": false,
"pageLength": 9999999,
dom: 'Bfrtip',
buttons: [
// {
// className: 'btn btn-outline-success pl-4 pr-4 btn-sm export',
// target: "_blank",
// titleAttr: 'Export to Excel',
// text: '<h8><b>EXCEL</b></h8>',
// action: function ( e, dt, node, config ) {
// $('#typedonwload').val('excel');
// $("#exportpdf").submit();
// // window.open("_blank");
// }
// },
// {
// className: 'btn btn-outline-danger pl-4 pr-4 btn-sm export',
// titleAttr: 'Export to PDF',
// text: '<h8><b>PDF</b></h8>',
// action: function ( e, dt, node, config ) {
// $('#typedonwload').val('pdf');
// $("#exportpdf").submit();
// }
// },
// {
// className: 'btn btn-outline-info pl-4 pr-4 btn-sm export',
// target: "_blank",
// titleAttr: 'Blast Whatsapp',
// text: '<h8><b>WHATSAPP & SMS</b></h8>',
// action: function ( e, dt, node, config ) {
// // $('#typedonwload').val('whatsapp');
// // $("#exportpdf").submit();
// $("#exportpdf").click(function() {
// $('[data-toggle="tooltip"]').tooltip()
// alert("ADAKAH ANDA PASTI?");
// $('#typedonwload').val('whatsapp');
// $("#exportpdf").submit();
// });
// }
// }
]
});
$('.export').tooltip();
$('.export').removeClass('dt-button');
</script>
@endsection
@@ -0,0 +1,296 @@
@extends('layouts.app_callcenter')
@section('content')
<div class="container-fluid">
<div class="row justify-content-center">
<div class="col-md-12 col-lg-12">
<nav aria-label="breadcrumb">
<ol class="breadcrumb pb-3">
<li class="breadcrumb-item"><a href="{{ route('home') }}">Home</a></li>
<li class="breadcrumb-item"><a href="{{ route('arcc.notisperingatankedua') }}">Notis Peringatan Kedua</a></li>
<li class="breadcrumb-item"><a href="{{ route('arcc.rekodnotisperingatankedua') }}">Rekod Notis Peringatan Kedua</a></li>
<li class="breadcrumb-item active" aria-current="page">Mengikut Cawangan</li>
<li class="breadcrumb-item active" aria-current="page">{{$cawangan_info['details_caw']}}</li>
<li class="breadcrumb-item active" aria-current="page">Notis JBG</li>
</ol>
</nav>
<form id="kemaskiniform" action="" target="_blank" method="POST">
@csrf
<input type="hidden" name="type" id="typedonwload" value="">
<input type='hidden' name="radaktif" value="aktif">
<input type='hidden' name="notisid" id="notisid" value="{{$notisid}}">
<input type='hidden' name="kodcaw" id="kodcaw" value="{{$kodcaw}}">
<input type='hidden' name="nokp" id="nokp" value="{{$nokp}}">
<div class="form-group row col-md-12">
<div class="col-md-6">
<div class="form-group row">
<div class="col-md-4">
<b>Nama</b>
</div>
<div class="col-md-8">
<input type="text" class="form-control" name="name" id="name" readonly value="{{ $bysagnotisjbgCustomer['nama'] }}">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group row">
<div class="col-md-4">
<b>No Kad Pengenalan</b>
</div>
<div class="col-md-8">
@php
if($bysagnotisjbgCustomer['kpbaru'] != null){
$noic = $bysagnotisjbgCustomer['kpbaru'];
}else{
$noic = $bysagnotisjbgCustomer['kplama'];
}
@endphp
<input type="text" class="form-control" name="noic" id="noic" readonly value="{{ $noic }}">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group row">
<div class="col-md-4">
<b>No Telefon</b>
</div>
<div class="col-md-8">
<input type="text" class="form-control" name="telefon" id="telefon" readonly value="{{ $bysagnotisjbgCustomer['telefon'] ? $bysagnotisjbgCustomer['telefon'] : '' }}">
</div>
</div>
<div class="form-group row">
<div class="col-md-4">
<b>Status Panggilan</b>
</div>
<div class="col-md-7">
<select name="statuscall" class="form-control" id="statuscall">
@foreach ($bysagnotisjbg['getstatusremark'] as $index => $remark)
@if ($remark['statuscall'] == 0)
<option value="0" selected>Belum Hubungi</option>
<option value="1">Berjaya Hubungi</option>
<option value="9">Tidak Dapat Hubungi</option>
@elseif($remark['statuscall'] == 1)
<option value="0" >Belum Hubungi</option>
<option value="1" selected>Berjaya Hubungi</option>
<option value="9">Tidak Dapat Hubungi</option>
@else
<option value="0" >Belum Hubungi</option>
<option value="1">Berjaya Hubungi</option>
<option value="9" selected>Tidak Dapat Hubungi</option>
@endif
@endforeach
</select>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group row">
<div class="col-md-4">
<b>Alamat </b>
</div>
<div class="col-md-8">
<input type="text" class="form-control" name="alamat" id="alamat" readonly value="{{$bysagnotisjbgCustomer['alamat1'] }}">
</div>
</div>
<div class="form-group row">
<div class="col-md-4">
<b>Nota</b>
</div>
<div class="col-md-8">
@foreach($bysagnotisjbg['getstatusremark'] as $index => $remark)
<textarea type="text" class="form-control" name="remark" id="remark">{{ $remark['remark1'] }}</textarea>
@endforeach
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-body">
<div class="container-fluid">
<table class="table table-striped table-hover" id="details">
<thead>
<th>Bil</th>
<!-- <th>Status</th> -->
<th>Norujukan</th>
<th>Tempoh</th>
<th>Baki Pembiayaan (RM)</th>
<th>Keuntungan 6Bulan (RM)</th>
<th>Amaun Telah Bayar (RM)</th>
<th>Keuntungan Semasa (RM)</th>
<th>Tarikh Matang</th>
<th>Tarikh Tamat Kontrak</th>
<th>Tarikh Panggilan</th>
<th>Nota</th>
</thead>
@php
$counter = 1;
$totalpinjaman = 0;
@endphp
@foreach ($bysagnotisjbg['rekodnotis'] as $index => $item)
@php
$totalpinjaman += $item['listsag'][0]['pinjaman'];
if ($item['listnotis'][0]['tarikhcall1'] == null) {
$status = 'Belum';
} else {
$status = 'Selesai';
}
@endphp
<tr>
<td>@foreach($item['listsag'] as $item1){{ $loop->iteration }}<br>@endforeach</td>
<!-- <td style="white-space: nowrap">{{ $status ?? '-' }}</td> -->
<td style="white-space: nowrap;">@foreach($item['listsag'] as $item1){{ $item1['norujukan']}}<br>@endforeach</td>
<td>@foreach($item['listsag'] as $item1){{ $item1['jbg']}}<br>@endforeach</td>
<td align='right' style="white-space: nowrap;">@foreach($item['listsag'] as $item1){{number_format($item1['bakipjm'], 2, '.', ',')}}<br>@endforeach</td>
<td align='right' style="white-space: nowrap;">@foreach($item['listsag'] as $item1){{number_format($item1['bakiupah'], 2, '.', ',')}}<br>@endforeach</td>
<td align='right' style="white-space: nowrap;">@foreach($item['listsag'] as $item1){{number_format($item1['hargajualan']-$item1['bakihargajualan'], 2, '.', ',')}}<br>@endforeach</td>
<td align='right' style="white-space: nowrap;">@foreach($item['listsag'] as $item1){{number_format($item1['keuntungan'], 2, '.', ',')}}<br>@endforeach<br></td>
<td align='right' style="white-space: nowrap;"><b> @foreach($item['listsag'] as $item1)
@if($item1['t_matang'] == null)
@else
@php
$myDateTime = DateTime::createFromFormat('Y-m-d', $item1['t_matang']);
$formattedtmatang = $myDateTime->format('d-m-Y');
echo($formattedtmatang);
@endphp
@endif
<br>
@endforeach
<br>
</b></td>
<td align='right' style="white-space: nowrap;"><b> @foreach($item['listsag'] as $item1)
@if($item1['t_matang1'] == null)
@else
@php
$myDateTime = DateTime::createFromFormat('Y-m-d', $item1['t_matang1']);
$formattedtmatang1 = $myDateTime->format('d-m-Y');
echo($formattedtmatang1);
@endphp
@endif
<br>
@endforeach
<br>
</b></td>
<td align='right' style="white-space: nowrap;"><b> @foreach($item['listnotis'] as $item1)
@if($item1['tarikhcall1'] == null)
@else
@php
$myDateTime = DateTime::createFromFormat('Y-m-d', $item1['tarikhcall1']);
$formattedweddingdate = $myDateTime->format('d-m-Y');
echo($formattedweddingdate);
@endphp
@endif
<br>
@endforeach
<br>
</b></td>
<td align="right">@foreach($item['listnotis'] as $item1){{ $item1['remark1']}}<br>@endforeach</td>
</tr>
@php $counter++; @endphp
@endforeach
</table>
</div>
</div>
</div>
</form>
<div class="mr-5 form-group float-right">
<button type="button" class="btn btn-primary" onclick="kemaskinihubungi()" id="btnsave">Kemaskini</button>
</div>
</div>
</div>
</div>
<script>
var api_url = "{{ $api_url }}";
// var kodcaw = "{{ $kodcaw }}";
// var notisid = "{{ $notisid }}";
//var nokp = "{{ $noic }}";
var staf = "{{ Auth::user()->name }}";
$("#kemaskiniform").submit(function(event) {
event.preventDefault();
var nokp = $('#nokp').val();
var telefon = $('#telefon').val();
var nota = $('#remark').val();
var nama = $('#nama').val();
var alamat = $('#alamat').val();
var notisid = $('#notisid').val();
var kodcaw = $('#kodcaw').val();
var statuscall = $('#statuscall').val();
let caller = "{{ Auth::user()->name }}";
$.ajax({
method:"put",
url: api_url + "/arcc/updatecall/"+ kodcaw + "/" + notisid + "/" + nokp,
data:{
'nota':nota,
'statuscall':statuscall,
'caller':caller
// 'notisid':notisid,
// 'kodcaw':kodcaw,
// 'nokp':nokp
},
success: function(success){
if(success){
Swal.fire({
icon: 'success',
title: 'Berjaya',
text: 'Berjaya mengemaskini maklumat notis JBG'
}).then((result) => {
if (result.isConfirmed) {
location.reload();
}
});
}else{
Swal.fire({
icon: 'error',
title: 'Tidak Berjaya',
text: 'Tidak berjaya mengemaskini maklumat notis JBG',
allowEscapeKey : false,
allowOutsideClick: false,
});
}
},
error: function (request, status, error) {
alert(request.responseText);
}
});
});
function kemaskinihubungi(){
$('#telefon').attr('readonly', true);
$('#telefon2').attr('readonly', true);
// $('#nota').attr('readonly', true);
$('#nama').attr('readonly', true);
$('#alamat').attr('readonly', true);
$('#kemaskiniform').trigger('submit');
}
</script>
@endsection
@@ -147,7 +147,9 @@
<td style="white-space: nowrap;">@if($item['totalsag'] == 0)<a style="color: #e74c3c; nowrap">{{number_format($item['totalbakipjm'],2)}}</a>@else {{number_format($item['totalbakipjm'],2)}}@endif</td>
<td style="white-space: nowrap;">
{{-- <a href="{{ route('arcc.bycawnotisperingatankedua', [ 'kodcaw' => $item['namacaw'][$index]['kodcaw'], 'notisid' => $notisid ]) }}" class="btn btn-info text-white">Lihat</a> --}}
<a href="{{ route('arcc.kemaskininotisperingatankeduabycaw', [ 'kodcaw' => $item['namacaw'][$index]['kodcaw'],'notisid' => $notisid] ) }}" class="btn btn-warning text-white">Kemaskini</a></td>
<a href="{{ route('arcc.kemaskininotisperingatankeduabycaw', [ 'kodcaw' => $item['namacaw'][$index]['kodcaw'],'notisid' => $notisid] ) }}" class="btn btn-warning text-white">Kemaskini</a>
<a href="{{ route('arcc.bycawnotisjbg2', [ 'kodcaw' => $item['namacaw'][$index]['kodcaw'], 'notisid' => $notisid ]) }}" class="btn btn-info text-white">Notis JBG</a></td>
</tr>
@endforeach
</table>