Commit b31d21f7 by Triyah Fatmawati

Add fitur data pembayaran konaspi

parent 43c47728
......@@ -11,6 +11,7 @@
use App\Models\Registrasi;
use App\Models\User;
use App\Models\VRegistrasi;
use Carbon\Carbon;
use Exception;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
......@@ -332,4 +333,42 @@ public function download_peserta()
return view('admin.peserta.excel', $data);
}
public function index_pembayaran(){
$pembayaranVa = DB::connection('va')->table('neosidata.v_pembayaran_konaspi')->orderBy('va')->get();
foreach ($pembayaranVa as $key => $value) {
$nomorVa[] = $value->va;
$konaspi = Registrasi::where('nomor_va', $value->va)->first();
$date = Carbon::createFromFormat('dmy', $value->tgl)->format('Y-m-d');
$data[$key] = [
'konaspi' => $konaspi,
'va' => $value,
'tglbayar' => $date
];
}
return view('admin.pembayaran.index', compact('data'));
}
public function download_data_pembayaran()
{
date_default_timezone_set("Asia/Jakarta");
$pembayaranVa = DB::connection('va')->table('neosidata.v_pembayaran_konaspi')->orderBy('va')->get();
foreach ($pembayaranVa as $key => $value) {
$nomorVa[] = $value->va;
$konaspi = Registrasi::where('nomor_va', $value->va)->first();
$date = Carbon::createFromFormat('dmy', $value->tgl)->format('Y-m-d');
$data[$key] = [
'konaspi' => $konaspi,
'va' => $value,
'tglbayar' => $date
];
}
return view('admin.pembayaran.excel', compact('data'));
}
}
......@@ -78,6 +78,21 @@
'sslmode' => 'prefer',
],
'va' => [
'driver' => 'pgsql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST_VA', '127.0.0.1'),
'port' => env('DB_PORT_VA', '5432'),
'database' => env('DB_DATABASE_VA', 'forge'),
'username' => env('DB_USERNAME_VA', 'forge'),
'password' => env('DB_PASSWORD_VA', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
'search_path' => 'public',
'sslmode' => 'prefer',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'url' => env('DATABASE_URL'),
......
<?php
$nama_file = 'Data Pembayaran Konaspi';
header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=$nama_file.xls");
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Data Pembayaran KONASPI 2024</title>
<style type="text/css">
body{
background-color: #FFF;
}
.num {
mso-number-format:"\@";
}
.title-sm{
/*font-family: 'myriadproregular'; */
font-size: 15pt; font-weight: bold;
}
.title-lg{
/*font-family: 'myriadproregular'; */
font-size: 24pt; font-weight: bold;
}
body{ font-size: 11pt;
/*font-family: 'myriadproregular'; */
}
.title-jurusan{
/*font-family: 'myriadproregular'; */
font-size: 20pt; font-weight: bold;
}
#head-title{
/*font-family: MyriadPro-Regular; */
src: url("{{ asset('assets/font/MyriadPro-Regular.otf') }}");
font-family:MyriadPro-Regular;
font-weight:bold;
}
#head-big{
/*font-family:MyriadPro-Cond; */
font-weight:bold;
font-size:22pt;
}
#container td{
/*font-family:MyriadPro-Regular;*/
}
.page-break {
page-break-after: always;
}
div.ui-menu li {
list-style:none;
background-image:none;
background-repeat:none;
background-position:0;
}
ul{
list-style-type:none;
padding:0px;
margin:0px;
}
li{
background-image:url(sqpurple.gif);
background-repeat:no-repeat;
background-position:0px 5px;
padding-left:14px;
}
.responsive {
width: 100%;
height: auto;
}
.kotak {
border: 1px solid #000;
width: 15px;
height: 15px;
font-weight: bold;
font-size:9pt
}
</style>
<style> .str{ mso-number-format:\@; } </style>
<center>
DATA PEMBAYARAN KONASPI 2024
</center>
<table>
<thead>
<tr style="text-align: center;">
<th style="text-align: center;">No.</th>
<th style="text-align: center;">Kode Registrasi</th>
<th style="text-align: center;">Nama</th>
<th style="text-align: center;">Instansi</th>
<th style="text-align: center;">No. VA</th>
<th style="text-align: center;">Tagihan</th>
<th style="text-align: center;">Jumlah Pembayaran</th>
<th style="text-align: center;">Tanggal Pembayaran</th>
</tr>
</thead>
<tbody>
@php
$no = 1;
$total_tagihan = 0;
$total_pembayaran = 0;
@endphp
@foreach ($data as $val)
<tr style="text-align: center">
<td>{{$no}}</td>
<td>{{$val['konaspi']->kode_registrasi}}</td>
<td style="text-align: left">{{$val['konaspi']->nama}}</td>
<td style="text-align: left">{{$val['konaspi']->instansi}}</td>
<td>{{"'".$val['va']->va}}</td>
<td style="text-align: right">{{ number_format($val['va']->tagihan, 2, ',', '.') }}</td>
<td style="text-align: right">{{ number_format($val['va']->terbayar, 2, ',', '.') }}</td>
<td>{{$val['tglbayar']}}</td>
</tr>
@php
$no++;
$total_tagihan += $val['va']->tagihan;
$total_pembayaran += $val['va']->terbayar;
@endphp
@endforeach
<tr>
<td colspan="5" style="text-align: center"><b>Total</b></td>
<td>{{ number_format($total_tagihan, 2, ',', '.') }}</td>
<td>{{ number_format($total_pembayaran, 2, ',', '.') }}</td>
</tr>
</tbody>
</table>
@extends('layouts.app')
@section('title','Participant Data')
@section('content')
<section class="section">
<div class="section-header">
<h1>Participant Data</h1>
<div class="section-header-breadcrumb">
<div class="breadcrumb-item">
<a href="">Home</a>
</div>
<div class="breadcrumb-item active">Data Peserta</div>
</div>
</div>
<div class="section-body">
<div class="row mt-4 active" id="tab-semuapeserta" data-tab-group="mygroup-tab">
<div class="col-12">
<div class="card">
<div class="card-body">
<a href="{{route('admin.download_pembayaran')}}" class="btn btn-primary">Download Data</a>
<div class="clearfix mb-3"></div>
<div class="table-responsive">
<table class="display" id="table-1">
<thead>
<tr>
<th style="text-align: center;">No.</th>
<th style="text-align: center;">Kode Registrasi</th>
<th style="text-align: center;">Nama</th>
<th style="text-align: center;">Instansi</th>
<th style="text-align: center;">No. VA</th>
<th style="text-align: center;">Tagihan</th>
<th style="text-align: center;">Jumlah Pembayaran</th>
<th style="text-align: center;">Tanggal Pembayaran</th>
</tr>
</thead>
<tbody>
@php
$no = 1;
@endphp
@foreach ($data as $val)
<tr style="text-align: center">
<td>{{$no}}</td>
<td>{{$val['konaspi']->kode_registrasi}}</td>
<td style="text-align: left">{{$val['konaspi']->nama}}</td>
<td style="text-align: left">{{$val['konaspi']->instansi}}</td>
<td>{{$val['va']->va}}</td>
<td style="text-align: right">{{ number_format($val['va']->tagihan, 2, ',', '.') }}</td>
<td style="text-align: right">{{ number_format($val['va']->terbayar, 2, ',', '.') }}</td>
<td>{{$val['tglbayar']}}</td>
</tr>
@php
$no++;
@endphp
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
@endsection
......@@ -16,6 +16,9 @@
<a class="nav-link" href="{{route('admin.index_peserta')}}"><i class="fa fa-users"></i><span>Data Peserta</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{route('admin.index_pembayaran')}}"><i class="fa fa-money"></i><span>Data Pembayaran</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{route('admin.index_kegiatan')}}"><i class="fa fa-suitcase"></i><span>Master Kegiatan</span></a>
</li>
<li class="nav-item">
......
......@@ -38,6 +38,9 @@
Route::put('/updateuser/{id}', [AdminController::class, 'update_user'])->name('admin.update_user');
Route::get('/deleteuser/{id}', [AdminController::class, 'delete_user'])->name('admin.delete_user');
Route::get('/pembayaran', [AdminController::class, 'index_pembayaran'])->name('admin.index_pembayaran');
Route::get('/download_pembayaran', [AdminController::class, 'download_data_pembayaran'])->name('admin.download_pembayaran');
Route::get('/kegiatan', [AdminController::class, 'index_kegiatan'])->name('admin.index_kegiatan');
Route::post('/createkegiatan', [AdminController::class, 'store_kegiatan'])->name('admin.create_kegiatan');
Route::put('/updatekegiatan/{id}', [AdminController::class, 'update_kegiatan'])->name('admin.update_kegiatan');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment