Commit 4c552eb4 by Muhammad Iskandar Java

Merge branch 'master' of http://git.unesa.ac.id/aisah/konaspi2024

parents 8fd72e77 78c1c32f
...@@ -6,9 +6,11 @@ ...@@ -6,9 +6,11 @@
use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Hash;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Models\Kegiatan; use App\Models\Kegiatan;
use App\Models\KegiatanPeserta;
use App\Models\Konferensi; use App\Models\Konferensi;
use App\Models\Registrasi; use App\Models\Registrasi;
use App\Models\User; use App\Models\User;
use App\Models\VRegistrasi;
use Exception; use Exception;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
...@@ -289,7 +291,8 @@ public function delete_konferensi($id) { ...@@ -289,7 +291,8 @@ public function delete_konferensi($id) {
} }
public function index_peserta(){ public function index_peserta(){
$peserta = Registrasi::with('pkKegiatan', 'pkKonferensi')->get(); // $peserta = Registrasi::whereHas('pkRegistrasiPeserta')->get();
$peserta = VRegistrasi::orderby('created_at', 'DESC')->get();
$data = [ $data = [
'peserta' => $peserta 'peserta' => $peserta
]; ];
...@@ -300,7 +303,9 @@ public function index_peserta(){ ...@@ -300,7 +303,9 @@ public function index_peserta(){
public function delete_peserta($id) { public function delete_peserta($id) {
DB::beginTransaction(); DB::beginTransaction();
try{ try{
Registrasi::find($id)->delete(); KegiatanPeserta::where('id_registrasi',$id)->delete();
Registrasi::where('id',$id)->delete();
DB::commit(); DB::commit();
return redirect()->back() return redirect()->back()
...@@ -314,4 +319,13 @@ public function delete_peserta($id) { ...@@ -314,4 +319,13 @@ public function delete_peserta($id) {
->with('error', 'Data failed to delete'); ->with('error', 'Data failed to delete');
} }
} }
public function download_peserta()
{
date_default_timezone_set("Asia/Jakarta");
$data['peserta'] = VRegistrasi::orderby('created_at','DESC')->get();
$data['nama_file'] = 'daftar peserta konaspi'." ".date('Y-m-d');
return view('admin.peserta.excel', $data);
}
} }
...@@ -23,6 +23,11 @@ public function create(){ ...@@ -23,6 +23,11 @@ public function create(){
$kegiatan = Kegiatan::orderBy('id')->get(); $kegiatan = Kegiatan::orderBy('id')->get();
$konferensi = Konferensi::get(); $konferensi = Konferensi::get();
$date = Date('Y-m-d'); $date = Date('Y-m-d');
$universitas = DB::connection('siakadu')->table('satuan_pendidikan')
->where('soft_delete', 0)
->whereNotNull('nm_lemb')
->orderBy('id_sp')
->get();
// $lastKode = Registrasi::query()->whereDate('created_at', $date)->max('kode_registrasi'); // $lastKode = Registrasi::query()->whereDate('created_at', $date)->max('kode_registrasi');
// $nourut = sprintf("%05s", ((int) substr($lastKode, -5))+1); // $nourut = sprintf("%05s", ((int) substr($lastKode, -5))+1);
// $tgldaftar = Carbon::now()->format('d-m-Y'); // $tgldaftar = Carbon::now()->format('d-m-Y');
...@@ -32,6 +37,7 @@ public function create(){ ...@@ -32,6 +37,7 @@ public function create(){
$data = [ $data = [
'kegiatan' => $kegiatan, 'kegiatan' => $kegiatan,
'konferensi' => $konferensi, 'konferensi' => $konferensi,
'universitas' => $universitas
// 'kode_registrasi' => $kode_registrasi // 'kode_registrasi' => $kode_registrasi
]; ];
...@@ -134,7 +140,7 @@ public function preview(Request $request){ ...@@ -134,7 +140,7 @@ public function preview(Request $request){
Log::error($e); Log::error($e);
DB::rollBack(); DB::rollBack();
return redirect()->back() return redirect()->route('user.create')
->with('error', 'Data failed to save'); ->with('error', 'Data failed to save');
} }
} }
...@@ -196,6 +202,7 @@ public function store(Request $request) { ...@@ -196,6 +202,7 @@ public function store(Request $request) {
$arrResponse = json_decode($generatedVa, true); $arrResponse = json_decode($generatedVa, true);
$registrasi->status_va = $arrResponse['BTNresponse']; $registrasi->status_va = $arrResponse['BTNresponse'];
$registrasi->tagihan = $totalHarga; $registrasi->tagihan = $totalHarga;
$registrasi->nomor_va = $arrResponse['BTNVirtualAccount'];
$registrasi->save(); $registrasi->save();
...@@ -207,7 +214,7 @@ public function store(Request $request) { ...@@ -207,7 +214,7 @@ public function store(Request $request) {
Log::error($arrResponse['BTNresponse']); Log::error($arrResponse['BTNresponse']);
Log::error('---'); Log::error('---');
return redirect()->back() return redirect()->route('user.create')
->with('error', 'Data failed to save'); ->with('error', 'Data failed to save');
} }
...@@ -268,7 +275,7 @@ public function getDataRegis($va) ...@@ -268,7 +275,7 @@ public function getDataRegis($va)
{ {
$registrasi = Registrasi::query() $registrasi = Registrasi::query()
->with('pkKegiatan', 'pkRegistrasiPeserta.rKegiatanPeserta', 'pkRegistrasiPeserta.rKonferensiPeserta') ->with('pkKegiatan', 'pkRegistrasiPeserta.rKegiatanPeserta', 'pkRegistrasiPeserta.rKonferensiPeserta')
->where('kode_registrasi', $va) ->where('nomor_va', $va)
->first(); ->first();
$konvensi = Kegiatan::query()->find('498633a9-082c-4a4a-9dbd-e20b678ec15e'); $konvensi = Kegiatan::query()->find('498633a9-082c-4a4a-9dbd-e20b678ec15e');
...@@ -315,7 +322,7 @@ public function updatePembayaran(Request $request, $va) ...@@ -315,7 +322,7 @@ public function updatePembayaran(Request $request, $va)
$registrasi = Registrasi::query() $registrasi = Registrasi::query()
->with('pkKegiatan', 'pkRegistrasiPeserta.rKegiatanPeserta', 'pkRegistrasiPeserta.rKonferensiPeserta') ->with('pkKegiatan', 'pkRegistrasiPeserta.rKegiatanPeserta', 'pkRegistrasiPeserta.rKonferensiPeserta')
->where('kode_registrasi', $va) ->where('nomor_va', $va)
->update([ ->update([
'tanggal_bayar' => Carbon::now() 'tanggal_bayar' => Carbon::now()
]); ]);
......
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class VKegiatan extends Model
{
public $incrementing = false;
protected $table = 'v_kegiatan';
protected $guarded = [];
}
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class VRegistrasi extends Model
{
public $incrementing = false;
protected $table = 'v_registrasi';
protected $guarded = [];
}
...@@ -93,6 +93,18 @@ ...@@ -93,6 +93,18 @@
// 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'), // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
], ],
'siakadu' => [
'driver' => 'pgsql',
'host' => '192.168.0.204',
'port' => '5432',
'database' => 'siakadu3',
'username' => 'postgres',
'password' => 'dB5i@kADUunes@@@!!',
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
],
], ],
/* /*
......
<?php
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>Peserta 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>
DAFTAR PESERTA KONASPI 2024
</center>
<table>
<thead>
<tr style="text-align: center;">
<th>No.</th>
<th>Kode Registrasi</th>
<th>Nama</th>
<th>Email</th>
<th>Telepon</th>
<th>Instansi</th>
<th>Jabatan</th>
<th>Alamat</th>
<th>Kode Pos</th>
<th>Kota</th>
<th>Virtual Account</th>
<th>Tagihan</th>
<th>Kegiatan</th>
<th>Konferensi</th>
<th>Tanggal Daftar</th>
<th>Tanggal Bayar</th>
</tr>
</thead>
<tbody>
@php
$no = 1;
@endphp
@foreach ($peserta as $p)
<tr style="text-align: center;">
<td>{{ $no }}</td>
<td>{{ $p->kode_registrasi }}</td>
<td>{{ $p->nama}}</td>
<td>{{ $p->email}}</td>
<td>'{{ $p->telepon }}</td>
<td>{{ $p->instansi}}</td>
<td>{{ $p->jabatan }}</td>
<td>{{ $p->alamat }}</td>
<td>{{ $p->kode_pos }}</td>
<td>{{ $p->kota }}</td>
<td>'{{ $p->nomor_va }}</td>
<td>{{ $p->tagihan }}</td>
@php
$keg = DB::table('v_kegiatan')->where('id_registrasi', $p->id)->get();
@endphp
<td align="left">
@foreach($keg as $k)
{{ $k->kegiatan.";" }}<br>
@endforeach
</td>
<td align="left">
@foreach($keg as $k)
{{ $k->konferensi.";" }}<br>
@endforeach
</td>
<td>{{ $p->created_at }}</td>
<td>{{ $p->tanggal_bayar }}</td>
</tr>
@php
$no++;
@endphp
@endforeach
</tbody>
</table>
\ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<div class="breadcrumb-item"> <div class="breadcrumb-item">
<a href="">Home</a> <a href="">Home</a>
</div> </div>
<div class="breadcrumb-item active">Participant Data</div> <div class="breadcrumb-item active">Data Peserta</div>
</div> </div>
</div> </div>
...@@ -24,8 +24,9 @@ ...@@ -24,8 +24,9 @@
<thead> <thead>
<tr style="text-align: center;"> <tr style="text-align: center;">
<th>No.</th> <th>No.</th>
<th>Kode Registrasi</th>
<th>Nama</th> <th>Nama</th>
<th>Email</th> {{-- <th>Email</th> --}}
<th>Instansi</th> <th>Instansi</th>
<th>Kegiatan</th> <th>Kegiatan</th>
<th>Konferensi</th> <th>Konferensi</th>
...@@ -37,16 +38,25 @@ ...@@ -37,16 +38,25 @@
$no = 1; $no = 1;
@endphp @endphp
@foreach ($peserta as $p) @foreach ($peserta as $p)
@php
$status = DB::table('registrasi')->where('id',$p->id)->first();
@endphp
<tr style="text-align: center;"> <tr style="text-align: center;">
<td>{{ $no }}</td> <td>{{ $no }}</td>
<td>{{ $p->kode_registrasi }}</td>
<td>{{ $p->nama}}</td> <td>{{ $p->nama}}</td>
<td>{{ $p->email}}</td> {{-- <td>{{ $p->email}}</td> --}}
<td>{{ $p->instansi}}</td> <td>{{ $p->instansi}}</td>
<td>{{ $p->pkKegiatan->nama }}</td> @php
<td>{{ $p->pkKonferensi->nama }}</td> $keg = DB::table('v_kegiatan')->where('id_registrasi', $p->id)->get();
@endphp
<td align="left">
@foreach($keg as $k)
{{ $k->kegiatan.";" }}<br>
@endforeach
</td>
<td align="left">
@foreach($keg as $k)
{{ $k->konferensi.";" }}<br>
@endforeach
</td>
<td> <td>
{{-- <button type="button" class="btn btn-info" data-toggle="modal" data-target="#update-modal{{$p->id}}"><i class="fa fa-check" aria-hidden="true"></i></button> --}} {{-- <button type="button" class="btn btn-info" data-toggle="modal" data-target="#update-modal{{$p->id}}"><i class="fa fa-check" aria-hidden="true"></i></button> --}}
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#detail-modal{{$p->id}}"><i class="fa fa-search" aria-hidden="true"></i></button> <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#detail-modal{{$p->id}}"><i class="fa fa-search" aria-hidden="true"></i></button>
...@@ -148,14 +158,21 @@ ...@@ -148,14 +158,21 @@
<input type="text" class="form-control" id="kota" name="kota" value="{{$p->kota}}"> <input type="text" class="form-control" id="kota" name="kota" value="{{$p->kota}}">
</div> </div>
</div> </div>
<label for="kegiatan">Kegiatan</label> <label for="kegiatan">Virtual Account</label>
<input type="text" class="form-control" id="kegiatan" name="kegiatan" value="{{ $p->pkKegiatan->nama }}"> <input type="text" class="form-control" id="kegiatan" name="kegiatan" value="{{ $p->nomor_va }}">
<label for="konferensi">Konferensi</label> <label for="konferensi">Tagihan</label>
<input type="text" class="form-control" id="konferensi" name="konferensi" value="{{ $p->pkKonferensi->nama }}"> <input type="text" class="form-control" id="konferensi" name="konferensi" value="{{ $p->tagihan }}">
<label for="tglregistasi">Tanggal Registrasi</label> <label for="tglregistasi">Tanggal Registrasi</label>
<input type="text" class="form-control" id="tglregistasi" name="tglregistasi" value="{{ $p->created_at }}"> <input type="text" class="form-control" id="tglregistasi" name="tglregistasi" value="{{ $p->created_at }}">
<label for="tglregistasi">Tanggal Bayar</label>
@if($p->tanggal_bayar)
<input type="text" class="form-control" id="tglregistasi" name="tglregistasi" value="{{ $p->tanggal_bayar }}">
@else
<input type="text" class="form-control" id="tglregistasi" name="tglregistasi" value="Belum Terbayar">
@endif
</div> </div>
{{-- <div class="table-responsive form-group" style="text-align: left"> {{-- <div class="table-responsive form-group" style="text-align: left">
<label for="">Daftar Dokumen</label> <label for="">Daftar Dokumen</label>
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<div class="col-md-6"> <div class="col-md-6">
<address> <address>
<strong>Metode Pembayaran:</strong><br> <strong>Metode Pembayaran:</strong><br>
Virtual Account : {{$registrasi['kode_registrasi'] ?? 'param' }}<br> Virtual Account : {{$registrasi['nomor_va'] ?? 'param' }}<br>
{{-- {{$registrasi['email'] ?? 'param' }} --}} {{-- {{$registrasi['email'] ?? 'param' }} --}}
</address> </address>
</div> </div>
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<div class="col-md-6"> <div class="col-md-6">
<address> <address>
<strong>Metode Pembayaran:</strong><br> <strong>Metode Pembayaran:</strong><br>
Virtual Account : {{$registrasi['kode_registrasi'] ?? 'param' }}<br> Virtual Account : {{$registrasi['nomor_va'] ?? 'param' }}<br>
{{-- {{$registrasi['email'] ?? 'param' }} --}} {{-- {{$registrasi['email'] ?? 'param' }} --}}
</address> </address>
</div> </div>
......
...@@ -57,7 +57,13 @@ ...@@ -57,7 +57,13 @@
<div class="form-group" @if ($errors->has('instansi')) has-error @endif> <div class="form-group" @if ($errors->has('instansi')) has-error @endif>
<label>Instansi</label> <label>Instansi</label>
<div class="input-group"> <div class="input-group">
<input type="text" id="instansi" name="instansi" class="form-control number" required="true" placeholder="" value="{{ old('instansi')}}"> {{-- <input type="text" id="instansi" name="instansi" class="form-control number" required="true" placeholder="" value="{{ old('instansi')}}"> --}}
<select class="form-control select" id="instansi" name="instansi"placeholder="">
<option value="" selected>- Pilih -</option>
@foreach ($universitas as $univ)
<option value="{{ $univ->nm_lemb }}">{{ $univ->nm_lemb }}</option>
@endforeach
</select>
</div> </div>
@if ($errors->has('instansi')) @if ($errors->has('instansi'))
<label id="login-error" class="error" for="instansi" style="color: red">{{$errors->first('instansi')}}</label> <label id="login-error" class="error" for="instansi" style="color: red">{{$errors->first('instansi')}}</label>
...@@ -150,6 +156,13 @@ ...@@ -150,6 +156,13 @@
@push('js') @push('js')
<script> <script>
$(document).ready(function () {
//change selectboxes to selectize mode to be searchable
$("#instansi").select2();
});
</script>
<script>
function cekKegiatan(id){ function cekKegiatan(id){
var value = document.getElementById(id).value; var value = document.getElementById(id).value;
if(value == '498633a9-082c-4a4a-9dbd-e20b678ec15e'){ if(value == '498633a9-082c-4a4a-9dbd-e20b678ec15e'){
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<div class="col-md-6"> <div class="col-md-6">
<address> <address>
<strong>Metode Pembayaran:</strong><br> <strong>Metode Pembayaran:</strong><br>
Virtual Account : {{$registrasi['kode_registrasi']}}<br> Virtual Account : {{$registrasi['nomor_va']}}<br>
{{-- {{$registrasi['email']}} --}} {{-- {{$registrasi['email']}} --}}
</address> </address>
</div> </div>
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
<input type="hidden" id="totalHarga" name="totalHarga" value="{{ json_encode($totalHarga) }}"> --}} <input type="hidden" id="totalHarga" name="totalHarga" value="{{ json_encode($totalHarga) }}"> --}}
{{-- <button type="submit" class="btn btn-primary btn-icon icon-left"><i class="fas fa-credit-card"></i> Bayar</button> --}} {{-- <button type="submit" class="btn btn-primary btn-icon icon-left"><i class="fas fa-credit-card"></i> Bayar</button> --}}
{{-- <a href="{{route('user.create')}}" class="btn btn-primary btn-icon icon-left"><i class="fas fa-credit-card"></i> Bayar</a> --}} {{-- <a href="{{route('user.create')}}" class="btn btn-primary btn-icon icon-left"><i class="fas fa-credit-card"></i> Bayar</a> --}}
<button class="btn btn-danger btn-icon icon-left"><i class="fas fa-times"></i> Close</button> <a href="{{route('user.create')}}" class="btn btn-danger btn-icon icon-left"><i class="fas fa-times"></i>Close</a>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -32,6 +32,11 @@ ...@@ -32,6 +32,11 @@
<!-- Sweet Alert --> <!-- Sweet Alert -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/6.6.9/sweetalert2.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/6.6.9/sweetalert2.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/6.6.9/sweetalert2.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/6.6.9/sweetalert2.min.js"></script>
<!-- Load jQuery (required for Select2) -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<!-- Load Select2 CSS -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/css/select2.min.css" rel="stylesheet" />
</head> </head>
<body> <body>
...@@ -95,6 +100,9 @@ ...@@ -95,6 +100,9 @@
<script src="{{asset('assets/js/page/modules-toastr.js')}}"></script> <script src="{{asset('assets/js/page/modules-toastr.js')}}"></script>
<script src="{{asset('assets/js/page/modules-datatables.js')}}"></script> <script src="{{asset('assets/js/page/modules-datatables.js')}}"></script>
<!-- Load Select2 JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js"></script>
<script> <script>
function logout() function logout()
{ {
......
...@@ -13,20 +13,20 @@ ...@@ -13,20 +13,20 @@
<a class="nav-link" href=""><i class="fas fa-home"></i><span>Home</span></a> <a class="nav-link" href=""><i class="fas fa-home"></i><span>Home</span></a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href=""><i class="fa fa-users"></i><span>Data Peserta</span></a> <a class="nav-link" href="{{route('admin.index_peserta')}}"><i class="fa fa-users"></i><span>Data Peserta</span></a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href=""><i class="fa fa-suitcase"></i><span>Master Kegiatan</span></a> <a class="nav-link" href="{{route('admin.index_kegiatan')}}"><i class="fa fa-suitcase"></i><span>Master Kegiatan</span></a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href=""><i class="fa fa-user-circle"></i><span>Master Konferensi</span></a> <a class="nav-link" href="{{route('admin.index_konferensi')}}"><i class="fa fa-user-circle"></i><span>Master Konferensi</span></a>
</li> </li>
@else @else
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="{{route('user.create')}}"><i class="fas fa-file-pen"></i><span>Registrasi</span></a> <a class="nav-link" href="{{route('user.create')}}"><i class="fas fa-file-pen"></i><span>Registrasi</span></a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href=""><i class="fa fa-sign-in"></i><span>Login</span></a> <a class="nav-link" href="{{route('login')}}><i class="fa fa-sign-in"></i><span>Login</span></a>
</li> </li>
@endif @endif
</ul> </ul>
......
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