add view photo resit

This commit is contained in:
Nur Izzati Zulkifli
2022-12-21 16:13:41 +08:00
parent e6026611cc
commit 1ecd3141d6
9 changed files with 717 additions and 47 deletions
+152
View File
@@ -15,9 +15,21 @@ use App\Models\LelongBid;
use App\Models\LelongBidder;
use App\Models\Resit;
use App\Models\FileResit;
use App\Services\ResitPhotoService;
use App\Models\FileMarhun;
use App\Services\MarhunPhotoService;
class AccountController extends Controller
{
private $resitPhotoService;
private $marhunPhotoService;
public function __construct(ResitPhotoService $resitPhotoService, MarhunPhotoService $marhunPhotoService)
{
$this->middleware('auth');
$this->resitPhotoService = $resitPhotoService;
$this->marhunPhotoService = $marhunPhotoService;
}
public function senarailelongan(){
@@ -485,4 +497,144 @@ class AccountController extends Controller
return view('account.listbayaranonlinesah',compact('listwinner','lelong_id', 'getkodcaw', 'kodcaw'));
}
public function sahsagcdm($lelong_id, $user_id, $caw_code)
{
$userdetails = User::where('id', $user_id)->first();
$senaraisag = LelongBidder::join('lelongbid', 'lelongbidder.lelongbid_id', '=', 'lelongbid.id')
->join('payment', 'lelongbidder.payment_id', '=', 'payment.id')
->join('resit', 'payment.resit_id', '=', 'resit.id')
->where('lelongbid.lelong_id', $lelong_id)
->where('lelongbidder.user_id', $userdetails['id'])
->where('lelongbid.kodcaw', $caw_code)
->where('lelongbidder.status_bidder', 1)
// ->where('payment.status_payment_opt', 3)
// ->orWhere('payment.status_payment_opt', 2)
->where('lelongbidder.status_payment', 2)
->select('lelongbidder.id as lelongbidder_id',
'lelongbidder.user_id',
'lelongbidder.hargabida',
'lelongbidder.status_bidder',
'lelongbidder.status_payment',
'lelongbidder.masa_bidaan',
'lelongbid.id as lelongbid_id',
'lelongbid.lelong_id',
'lelongbid.caw_id',
'lelongbid.kodcaw',
'lelongbid.norujukan',
'lelongbid.t_lelong',
'lelongbid.hargaasas',
'lelongbid.hargajual',
'lelongbid.t_jual',
'lelongbid.status_jual',
'lelongbid.status_payment as sts_payment_lelbid',
'lelongbid.status_semak',
'payment.id as payment_id',
'payment.remark',
'payment.kodcaw',
'payment.status_payment_opt',
'payment.resit_id',
'payment.status',
'payment.remark',
'payment.total_payment',
'payment.disahkan_pada',
'payment.disahkan_oleh',
'resit.reference_no'
)
->get();
foreach($senaraisag as $index1=>$sag)
{
if($sag)
{
// dd($sag);
$checking = Payment::join('lelongbid', 'payment.lelong_id', '=', 'lelongbid.lelong_id')
->where('payment.id', $sag['payment_id'])
->where('lelongbid.status_jual', 1)
->where('payment.kodcaw', $caw_code)
->where('lelongbid.status_payment', 1)
->whereNotNull('payment.disahkan_pada')
->whereNotNull('payment.disahkan_pada')
->first();
$noresit = Resit::where('lelong_id',$lelong_id)
->where('user_id','=',$user_id)
->first();
$senaraisag[$index1]['checking_payment'] = $checking;
// dd($checking);
}
else
{
//
}
}
$saggroupbyid = LelongBidder::join('lelongbid', 'lelongbidder.lelongbid_id', '=', 'lelongbid.id')
->join('payment', 'lelongbidder.payment_id', '=', 'payment.id')
->where('lelongbid.lelong_id', $lelong_id)
->where('lelongbidder.user_id', $user_id)
->where('lelongbid.kodcaw', $caw_code)
->where('lelongbidder.status_bidder', 1)
->where('payment.status_payment_opt', 3)
->orWhere('payment.status_payment_opt', 2)
->where('lelongbidder.status_payment', 2)
->select(
'lelongbidder.payment_id as payment_id'
)
->groupBy('lelongbidder.payment_id')
->get();
// $payments = Payment::whereIn($saggroupbyid)->get()
$total_payment = Payment::whereIn('id',$saggroupbyid)->sum('total_payment');
// $getresit = FileResit::join('payment', 'fileresit.payment_id', '=', 'payment.id')
// ->where('payment.lelong_id', $lelong_id)
// ->where('payment.user_id', $user_id)
// ->where('payment.kodcaw', $caw_code)
// ->get()->toArray();
// $array_resit = [];
// foreach($getresit as $index1=>$resit)
// {
// $getresit[$index1]['resit64'] = 'data:image/' . $resit['file_type'] . ';base64' . base64_encode($resit['filename']);
// }
$fileresit = FileResit::where('lelong_id', $lelong_id)
->where('user_id', $user_id)
->where('photo_type', '=', '1')
->get();
// dd($fileresit);
foreach ($fileresit as $index => $itemresit) {
// dd($itemresit);
if (isset($itemresit)) {
$itemresit->fileresit_filename = true;
$itemresit->fileresit_id = $itemresit->id;
}
$fileresit[$index]['itemresit'] = $itemresit->fileresit_id;
}
// $lelongbid = LelongBid::where('id', '=', $sag->lelongbid_id)->first();
// $filemarhun = FileMarhun::where('lelongbid_id', '=', $lelongbid['id'])
// ->where('photo_type', '=', '1')
// ->first();
// // dd($filemarhun);
// if (isset($filemarhun)) {
// $lelongbid->filemarhun_filename = true;
// $lelongbid->filemarhun_id = $filemarhun->id;
// }
return view('account.sahsagcdm', compact('senaraisag', 'lelong_id', 'user_id', 'total_payment', 'caw_code', 'userdetails', 'fileresit'));
}
public function showPhotoResit(Request $request)
{
$resit = FileResit::where('id', '=', $request->fileresit_id)->first();
// dd($this->resitPhotoService->show($request->user_id, $resit));
return $this->resitPhotoService->show($request->user_id, $resit);
}
}
+96 -6
View File
@@ -113,7 +113,7 @@ class HomeController extends Controller
->join('lelongbid','lelongbid.norujukan','=','pengesahan.norujukan')
// ->where('sts_lelong', 0)
->where('lelongbid.kodcaw', $user->kodcaw)
->whereIn('pengesahan.status_ubah', [1,2,3,4,5])
->whereIn('pengesahan.status_ubah', [1,2,3,4,5,7,8,9,10])
->where('disahkan_oleh','=', NULL)
->select('pengesahan.lelong_id','lelong.id','lelong.tarikh_lelong','lelong.masatamat_lelong','lelong.harga_emas_asas','lelong.jbg','lelong.cajlelong','sts_lelong')
// ->groupBy('pengesahan.lelong_id')
@@ -272,10 +272,7 @@ class HomeController extends Controller
// ->where('lelongbidder.status_payment', 2)
->where('payment.status', 2)
->whereNull('payment.disahkan_pada')
->orWhere(function ($query) {
$query->where('payment.status_payment_opt', 3)
->where('payment.status_payment_opt', 2);
})
->where('payment.status_payment_opt', 2)
->select('lelongbidder.user_id', 'payment.user_id')
->groupBy('lelongbidder.user_id', 'payment.user_id')
->get();
@@ -327,10 +324,103 @@ class HomeController extends Controller
array_push($arrayinfoaccount,['detail'=>$details, 'detailsinfo'=>$detailsinfo, 'listwinner'=>$listwinner]);
}
$arrayinfoaccountcdm = [];
$listwinnercdm = [];
$dateTimedummy = date('2022-12-14');
$senaraicdm = Lelong::join('cawangan_lelong','lelong.id','=','cawangan_lelong.lelong_id')
->select('lelong_id','tarikh_lelong','lelong.fasa','sts_lelong')
->distinct()
->orderBy('lelong_id')
->where('lelong.sts_lelong', 3)
->where('tarikh_lelong', '=', $dateTimedummy)
->get()
->toArray();
// dd($senarai);
foreach($senaraicdm as $detailscdm)
{
// dd($details['lelong_id']);
$detailsinfocdm = CawanganLelong::join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
->select('cawangan_lelong.lelong_id','cawangan_lelong.caw_id','caw_name','cawangan.caw_code','cawangan_lelong.export_data_sts')
->where('lelong_id',$detailscdm['lelong_id'])
->distinct()
->orderBy('lelong_id')
->get();
// dd($detailsinfo);
foreach($detailsinfocdm as $index1=>$details1cdm)
{
// dd($details1['caw_code']);
$listwinnercdm = Payment::join('lelongbid', 'payment.kodcaw', '=', 'lelongbid.kodcaw')
->join('lelongbidder', 'payment.id', '=', 'lelongbidder.payment_id')
->where('lelongbidder.status_bidder', 1)
->where('lelongbid.lelong_id', $details1cdm['lelong_id'])
->where('payment.kodcaw', $details1cdm['caw_code'])
// ->where('lelongbidder.status_payment', 2)
->where('payment.status', 2)
->whereNull('payment.disahkan_pada')
->where('payment.status_payment_opt', 3)
// ->orWhere(function ($query) {
// $query->where('payment.status_payment_opt', 3);
// })
->select('lelongbidder.user_id', 'payment.user_id')
->groupBy('lelongbidder.user_id', 'payment.user_id')
->get();
// dd($listwinner);
foreach($listwinnercdm as $index=>$listwincdm)
{
$namawinnercdm = User::where('id', $listwincdm['user_id'])
->first();
$total_paymentcdm = 0;
$userdetailscdm = User::where('id', $listwincdm['user_id'])->first();
$SAGWincdm = LelongBidder::join('lelongbid', 'lelongbidder.lelongbid_id', '=', 'lelongbid.id')
->where('lelongbid.nopembeli', $listwincdm['user_id'])
->where('lelongbid.kodcaw', $listwincdm['kodcaw'])
->where('lelongbidder.status_bidder', 1)
->where('lelongbid.lelong_id', $listwincdm['lelong_id'])
->get();
foreach($SAGWincdm as $index2=>$sagcdm)
{
// dd($detailspayment);
$detailspaymentcdm = null;
if($sagcdm['payment_id'] != null)
{
$detailspaymentcdm = Payment::where('id', $sagcdm['payment_id'])->first();
$total_paymentcdm = $total_payment + $detailspaymentcdm->total_payment;
// dd($total_payment);
}else
{
$total_paymentcdm = '0.00';
}
$listwinnercdm[$index]['jenisbayaran'] = $detailspaymentcdm ;
}
// dd($namawinner);
// $listwinner[$index]['namawinner'] = sizeof($namawinner);
$listwinnercdm[$index]['details'] = $userdetailscdm;
$listwinnercdm[$index]['nama'] = $userdetailscdm['name'];
$listwinnercdm[$index]['caw_code'] = $details1cdm['caw_code'];
$listwinnercdm[$index]['totalPay'] = $total_paymentcdm;
$detailsinfocdm[$index1]['nama'] = $userdetailscdm;
}
// $detailsinfo[$index1]['nama'] = $namawinner['name'];
$detailsinfocdm[$index1]['listwinner'] = $listwinnercdm;
// dd($listwinner[$index]['nama']);
}
array_push($arrayinfoaccountcdm,['detailcdm'=>$detailscdm, 'detailsinfocdm'=>$detailsinfocdm, 'listwinnercdm'=>$listwinnercdm]);
}
//endpaparan untuk account page
return view('home',compact('all_lelong','lelongmutu', 'arrayinfomutu','arrayinfo','sag','semakCountArray','arrayinfomenang','arrayinfoaccount'));
return view('home',compact('all_lelong','lelongmutu', 'arrayinfomutu','arrayinfo','sag','semakCountArray','arrayinfomenang','arrayinfoaccount','arrayinfoaccountcdm'));
}
+3
View File
@@ -12,6 +12,9 @@ class FileResit extends Model
protected $table = 'fileresit';
protected $fillable = [
'user_id',
'lelong_id',
'payment_id',
'file_type',
'filename',
'deleted_at',
+168
View File
@@ -0,0 +1,168 @@
<?php
namespace App\Services;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
use App\Models\FileResit;
use App\Models\LelongBid;
use Exception;
use Buglinjo\LaravelWebp\Facades\Webp;
class ResitPhotoService
{
public function store(Request $request)
{
try {
$file_type = $request->gambarMarhun->getClientOriginalExtension();
} catch (Exception $exception) {
$file_type = 'PNG';
logger($exception);
}
$addfile = new FileResit();
$addfile->lelong_id = $request->lelong_id;
$addfile->file_type = $file_type;
if ($request->photo_type == 1) {
$addfile->photo_type = 1;
$addfile->save();
} elseif ($request->photo_type == 2) {
$addfile->photo_type = 2;
$addfile->lelong_id = $request->lelong_id;
$addfile->save();
}
$user_id = LelongBid::select('norujukan')->where('id', $request->lelongbid_id)->first()->norujukan;
$photo_type_name = $request->photo_type === '1' ? 'overall_photo' : 'by_marhun_photo';
$directory = "/{$user_id}/{$photo_type_name}/";
$imageExtension = $file_type;
$resitImageFileName = "overall";
if (!empty($request->lelongbidmarhun_id)) {
$resitImageFileName = "$request->lelongbidmarhun_id";
}
Storage::disk('resit')->putFileAs($directory, $request->gambarMarhun, "${resitImageFileName}.${imageExtension}");
$stored_path = Storage::disk('marhun')->path("{$directory}{$resitImageFileName}.${imageExtension}");
$this->optimizeImageToWebP($stored_path, $directory, $resitImageFileName);
Storage::disk('resit')->delete("{$directory}${resitImageFileName}.${imageExtension}");
$addfile->update([
'file_type' => 'webp',
]);
}
public function delete(Request $request)
{
$deleteFile = FileResit::where('id', '=', $request->fileresit_id)->first();
$user_id = User::select('user_id')->where('id', $request->lelongbid_id)->first()->norujukan;
$photo_type_name = $request->photo_type === '1' ? 'overall_photo' : 'by_marhun_photo';
$directory = "/{$user_id}/{$photo_type_name}/";
$imageExtension = $deleteFile->file_type;
$resitImageFileName = "overall.{$imageExtension}";
$lelongbidmarhun_id = $deleteFile->lelongbidmarhun_id;
if (!empty($request->lelongbidmarhun_id)) {
$resitImageFileName = "$lelongbidmarhun_id.$imageExtension";
}
Storage::disk('marhun')->delete("{$directory}${resitImageFileName}");
$deleteFile->delete();
}
public function show($user_id, $resit)
{
$DS = DIRECTORY_SEPARATOR;
$lelong_id = $resit->lelong_id;
$fileresit_id = $resit->id;
// dd($fileresit_id);;
// $photo_type_name = $marhun->photo_type === 1 ? 'overall_photo' : 'by_marhun_photo';
$directory = $user_id.$DS.$lelong_id.$DS;
// dd($directory);
$imageExtension = $resit->file_type;
// dd($imageExtension);
// $resitImageFileName = "{$fileresit_id}.{$imageExtension}";
if (!empty($fileresit_id)) {
$resitImageFileName = "$fileresit_id.$imageExtension";
// dd($resitImageFileName);
}
$filePath = Storage::disk('resit')->path($directory.$resitImageFileName);
// $filePath = 'C:\laragon\www\lelong2\storage\app\resit\20\2\1.webp';
// dd($filePath);
// header('Content-Type: ' . mime_content_type($filePath));
header('Content-Disposition: inline; filename="' . basename($filePath) . '"');
readfile($filePath);
// dd($filePath);
}
public function get($user_id, $resit)
{
$lelong_id = $resit->lelong_id;
$fileresit_id = $resit->id;
// $photo_type_name = $marhun->photo_type === 1 ? 'overall_photo' : 'by_marhun_photo';
$directory = "/{$user_id}/{$lelong_id}/";
$imageExtension = $resit->file_type;
$resitImageFileName = "overall.{$imageExtension}";
if (!empty($fileresit_id)) {
$resitImageFileName = "overall.$imageExtension";
}
return Storage::disk('marhun')->get("{$directory}${resitImageFileName}");
}
private function getWebpCompilerByOS()
{
$DS = DIRECTORY_SEPARATOR;
$cwebp_compilers = [
'Windows' => 'binaries' . $DS . 'libwebp-1.2.4-windows-x64' . $DS . 'bin' . $DS . 'cwebp',
'Linux' => 'binaries' . $DS . 'libwebp-1.2.4-linux-x86-64' . $DS . 'bin' . $DS .'cwebp',
'Darwin' => [
'X86-64' => 'binaries' . $DS . 'libwebp-1.2.4-mac-X86-64' . $DS . 'bin' . $DS . 'cwebp',
'arm64' => 'binaries' . $DS . 'libwebp-1.2.4-mac-arm64' . $DS . 'bin' . $DS .'cwebp',
],
];
$server_operating_system = explode(' ', trim(php_uname()))[0];
$server_processor_architecture = trim(php_uname('m'));
if ($server_operating_system === 'Darwin') {
return resource_path($cwebp_compilers['Darwin'][$server_processor_architecture]);
}
if (in_array($server_operating_system, array_keys($cwebp_compilers))) {
return resource_path($cwebp_compilers[$server_operating_system]);
}
}
private function optimizeImageToWebP($originalFilePath, $directory, $lelongbidmarhun_id)
{
$convertedFilePath = config('filesystems.disks.resit.root') . '/' . "{$directory}{$lelongbidmarhun_id}.webp";
$webpCompiler = $this->getWebpCompilerByOS();
exec($webpCompiler . ' -preset photo ' . ' -resize 1280 720 ' . ' -mt ' . $originalFilePath . ' -o ' . $convertedFilePath);
}
}
+7
View File
@@ -42,6 +42,13 @@ return [
'visibility' => 'public',
],
'resit' => [
'driver' => 'local',
'root' => storage_path('app'.DIRECTORY_SEPARATOR.'resit'),
'url' => env('APP_URL').'/resit_photo',
'visibility' => 'public',
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
+233
View File
@@ -0,0 +1,233 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid">
{{-- @include('marhun.partials.camera_modals_per_marhun')
@include('marhun.partials.camera_modals') --}}
<div class="row ">
<div class="col mx-auto p-4">
<div class="card">
<div class="card-header header-style">
<a href="javascript:window.history.go(-1);" class="header-style-icon">
<i class="fas fa-arrow-left"></i>
</a>
<div class="header-style-title">
Pengesahan Bayaran Kaunter Bank/CDM
</div>
</div>
<div class="card-body">
@if ($message = Session::get('success'))
<div class="alert alert-success">
<p>{{ $message }}</p>
</div>
@endif
<div class="container">
<div class="row mb-2">
<div class="col-md-12 mx-auto card p-4" style="margin-top:2%; margin-bottom:2%;">
<p> <b>Nama Pembida : </b> {{ $userdetails['name'] }}</p>
<p> <b>No Kad Pengenalan : </b> {{ $userdetails['nokp'] }}</p>
<p> <b>No Telefon : </b> {{ $userdetails['notelbimbit'] }}</p>
{{-- <p> <b>No Resit: </b>{{ $noresit['reference_no'] }}</p> --}}
</div>
</div>
<form action="{{ route('account.sahbayaronline') }}" method="POST" id="formsahbayaronline">
@csrf
<input type="hidden" name="lelong_id" value="{{ $lelong_id }}" />
<input type="hidden" name="user_id" value="{{ $user_id }}" />
<input type="hidden" name="senarai_sag" value="{{ $senaraisag }}" />
<table class="table table-bordered text-center" style="width:100%">
{{-- <thead class="bg-primary text-white">
<tr>
<th>No</th>
<th>No Rujukan</th>
<th>Tarikh Lelong</th>
<th>Harga Asas (RM)</th>
<th>Harga Bida (RM)</th>
<th>Masa Bidaan</th>
<th>No Resit</th>
<th>Nota</th>
<th class="text-center">Status</th>
</tr>
</thead> --}}
{{-- <tbody>
@foreach($senaraisag as $sag)
<tr>
<td> {{ $loop->iteration }} </td>
<td>{{ $sag['norujukan'] }}</td>
<td>@php
$myDateTime = DateTime::createFromFormat('Y-m-d', $sag['t_lelong'] );
$t_lelong = $myDateTime->format('d-m-Y');
echo($t_lelong);
@endphp</td>
<td>{{ number_format($sag['hargaasas'], 2, '.', ',') }}</td>
<td>{{ number_format($sag['hargabida'], 2, '.', ',') }}</td>
<td>{{ $sag['masa_bidaan'] }}</td>
<td>{{ $sag['reference_no'] }}</td>
<td>
<button class="btn btn-outline-success btn-sm" disabled><b>{{ $sag['remark'] }}</b></button>
</td>
<td>
<span class="btn btn-success btn-sm hovernone-success" disabled>TELAH DIBAYAR</span>
</td>
</tr>
@endforeach
</tbody> --}}
{{-- <tr>
<td colspan="2"><b> No.Resit</b></td>
<td colspan="2"></td>
<td><b>{{ $noresit['reference_no'] }}</b></td>
<td></td>
<td></td>
<td></td>
</tr> --}}
<tr>
{{-- {{dd($senaraisag->sum('hargabida'))}} --}}
<td><b> Jumlah Bayaran</b></td>
<td><b>RM{{ number_format($senaraisag->sum('hargabida'), 2, '.', ',') }}</b></td>
<td>
<span class="btn btn-info btn-sm hovernone-info" disabled>TELAH DIBAYAR</span>
</td>
{{-- <td>
@if($getresit)
<button type="button" class="btn btn-outline-secondary" data-toggle="modal" data-target="#exampleModal">
Lihat Resit <i class="fas fa-file-alt"></i>
</button>
@else
@endif
</td> --}}
</tr>
</table>
<input type="hidden" name="photo_type" value="1">
<div class="row justify-content-center">
<div class="col-12">
<div class="card card-overall-marhun">
<div class="card-header">Bukti Pembayaran(Resit)</div>
@foreach ($fileresit as $item)
<div class="card-body pl-0 pr-0" style="align-self: center; justify-content: center;">
{{-- <button type="button" data-toggle="modal" onclick="kesulurahanMarhunData(this)" data-lelongid="{{$lelong_id}}" data-lelongbidid="" data-lelongbid_status_semak="" data-fileid="{{ $item->fileresit_id }}" data-target="#modaloverallphoto"> --}}
<img src="{{ route('account.showphotoresit', ['user_id' => $user_id, 'fileresit_id' => $item->fileresit_id]) }}" width="100%">
{{-- </button> --}}
</div>
@endforeach
</div>
</div>
</div>
<div style="margin-top:2%; align:center">
{{-- <a href="{{ route('account.listbayaranonline', [$lelong_id,$caw_code]) }}" class="btn btn-primary">Kembali</a> --}}
{{-- @foreach($senaraisag as $senarai) --}}
{{-- @if($sag['checking_payment'])
<button type="button" class="btn btn-success" disabled>Berjaya Disahkan</button>
@else --}}
<button type="button" class="btn btn-success" onclick="confirm()" >Sahkan</button>
{{-- @endif --}}
{{-- @endforeach --}}
</div>
</div>
</form>
</div>
</div>
</div>
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Resit Bayaran CDM</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body text-center" style="padding:3rem">
{{-- @foreach($getresit as $resit)
<div class=".col-6 .col-sm-4 form-check form-check-inline">
<img src="data:image/png;base64, {{ $resit['filename'] }}" alt="Image Preview" style="max-width:700px; maxheight:650px; border: 1px solid #dee2e6"/>
</div>
@endforeach --}}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Kembali</button>
</div>
</div>
</div>
</div>
<script>
function confirm() {
$.confirm({
title: 'Confirmation',
content: 'Anda pasti?',
type: 'orange',
typeAnimated: true,
buttons: {
Sahkan: {
btnClass: 'btn-warning',
action: function () {
$("#formsahbayaronline").submit();
}
},
Batal: {
btnClass: 'btn-default',
action: function () {}
}
}
});
}
var tablekaunter = $('#tablekaunter').DataTable({
"columnDefs": [
{
"targets": 0,
"orderable": false
},
{
"targets": 7,
"orderable": false
}
],
order: [[0, 'asc']],
"info": false,
"lengthChange": false,
"pageLength": 15,
dom: 'Bfrtip',
// buttons: [
// {
// className: 'btn btn-outline-success pl-4 pr-4 btn-sm addcaw',
// text: '<i class="fas fa-plus" id="test"></i>',
// titleAttr: 'Tambah Cawangan',
// action: function ( e, dt, node, config ) {
// // alert( 'Button activated' );
// // console.log('hye');
// $('#myModal').modal("show");
// $('#myModal').on('shown.bs.modal', function () {
// $('#rolename').trigger('focus')
// })
// }
// },
// {
// className: 'btn btn-outline-secondary pl-4 pr-4 btn-sm export',
// titleAttr: 'Export to CSV',
// text: '<i class="fas fa-download"></i>',
// action: function ( e, dt, node, config ) {
// $("#exportform").submit();
// }
// }
// ]
});
// $('.addcaw').tooltip();
// $('.export').tooltip();
// // $( '.dt-buttons').addClass('btn-group');
// $( '.addcaw').removeClass('dt-button');
// $( '.export').removeClass('dt-button');
</script>
@endsection
+11 -4
View File
@@ -4,10 +4,17 @@
<div class="container-fluid">
<div class="row ">
<div class="col-md-11 mx-auto card p-4">
<div class="nav nav-tabs" id="nav-tab" role="tablist">
<button type="button" class="btn btn-light" ><a href="javascript:window.history.go(-1);"><h3><i class="fas fa-arrow-alt-circle-left"></i></h3></a></button>
</div>
<div class="col mx-auto p-4">
<div class="card">
<div class="card-header header-style">
<a href="javascript:window.history.go(-1);" class="header-style-icon">
<i class="fas fa-arrow-left"></i>
</a>
<div class="header-style-title">
Pengesahan Bayaran Online
</div>
</div>
<div class="card-body">
@if ($message = Session::get('success'))
<div class="alert alert-success">
<p>{{ $message }}</p>
+45 -35
View File
@@ -469,46 +469,56 @@
@endforelse
@endforeach
</td>
{{-- <td align='left'>
@foreach($data['detailsinfo'] as $details)
@forelse($details['listwinner'] as $winner)
{{ number_format($winner['totalPay'], 2, '.', ',') }}
<td>
@if($data['detail']['sts_lelong'] == 3)
<button class="btn btn-success btn-sm" disabled>LELONG SELESAI</button>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
@endif
@if(count($arrayinfoaccountcdm)> 0)
<b>PENGESAHAN BAYARAN KAUNTER BANK/CDM</b>
<table class="table table-bordered table-xl text-center" id="senarailelongan" style="width:100%">
<thead class="bg-primary text-white">
<tr>
<th>No</th>
<th>Batch Lelong</th>
<th>Tarikh Lelong</th>
<th>Nama</th>
<th>Status Lelong</th>
</tr>
</thead>
<tbody>
@foreach($arrayinfoaccountcdm as $data)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ $data['detailcdm']['lelong_id']}}</td>
<td>@php
$myDateTime = DateTime::createFromFormat('Y-m-d', $data['detailcdm']['tarikh_lelong'] );
$t_lelong = $myDateTime->format('d-m-Y');
echo($t_lelong);
@endphp</td>
<td align='left'>
@foreach($data['detailsinfocdm'] as $details)
{{-- <a href=" {{ route('account.listbayaranonline', ['lelong_id'=>$data['detail']['lelong_id'], 'kodcaw'=>$details['caw_code']]) }} " data-toggle="tooltip" data-placement="top" title="Butiran Bidaan"><i class="far fa-edit"></i></a> --}}
<strong><span class="m-2">{{ $details['caw_name']}}</span></strong><br>
@forelse($details['listwinner'] as $winner)
<a href=" {{ route('account.sahsagcdm', ['lelong_id'=>$data['detailcdm']['lelong_id'],'user_id'=>$winner['user_id'], 'caw_code'=>$details['caw_code']]) }} " data-toggle="tooltip" data-placement="top" title="Pengesahan"><i class="far fa-edit"></i></a>
{{$winner['nama']}}<img src="{{ asset('img/new.gif') }}" alt="description of myimage"><br>
<br>
@empty
<br>
@endforelse
@endforelse
@endforeach
</td> --}}
{{-- <td align='left'>
@foreach($data['listwinner'] as $details)
<a href=" {{ route('account.sahsagonline', ['lelong_id'=>$data['detail']['lelong_id'],'user_id'=>$details['user_id'], 'caw_code'=>$details['caw_code']]) }} " data-toggle="tooltip" data-placement="top" title="Pengesahan"><i class="far fa-edit"></i></a>
<span class="m-2">{{ $details['caw_name']}}</span> {{$details['nama']}}<br>
@endforeach
</td> --}}
{{-- <td align='left'>
@foreach($data['detailsinfo'] as $details)
@forelse($details['listwinner'] as $winner)
@if($winner['jenisbayaran'] != NULL)
@if($winner['jenisbayaran']['status_payment_opt'] == 1)
TUNAI
@elseif($winner['jenisbayaran']['status_payment_opt'] == 2)
FPX
@elseif($winner['jenisbayaran']['status_payment_opt'] == 3)
KAUNTER BANK/CDM
@endif
@else
@endif
<br>
@empty
<br>
@endforelse
@endforeach
</td> --}}
</td>
<td>
@if($data['detail']['sts_lelong'] == 3)
@if($data['detailcdm']['sts_lelong'] == 3)
<button class="btn btn-success btn-sm" disabled>LELONG SELESAI</button>
@endif
</td>
+2 -2
View File
@@ -448,8 +448,8 @@ Route::group(['middleware' => ['permission:pengesahanbayaran'],'prefix'=>'accoun
Route::get('/listpengesahanakaun/{lelong_id}/{kodcaw}',['as'=>'account.listpengesahanakaun','uses'=>'AccountController@listpengesahanakaun']);
Route::get('/statuspembayaran',['as'=>'account.statuspembayaran','uses'=>'PembidaController@statuspembayaran']);
Route::get('/statuspembayaranbypembida',['as'=>'account.statuspembayaranbypembida','uses'=>'PembidaController@statuspembayaranbypembida']);
// Route::get('/sahsagcdm/{lelong_id}/{user_id}/{caw_code}', ['as'=>'account.sahsagcdm','uses'=>'AccountController@sahsagcdm']);
// Route::get('/showphotoresit',['as'=>'account.showphotoresit','uses'=>'AccountController@showPhotoResit']);
Route::get('/sahsagcdm/{lelong_id}/{user_id}/{caw_code}', ['as'=>'account.sahsagcdm','uses'=>'AccountController@sahsagcdm']);
Route::get('/showphotoresit',['as'=>'account.showphotoresit','uses'=>'AccountController@showPhotoResit']);
});
// Pengurus Cawangan