Commit 017ac8ee by Siti Aisah

fix data peserta

parent ed9c1b88
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
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 +290,8 @@ public function delete_konferensi($id) { ...@@ -289,7 +290,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
]; ];
...@@ -314,4 +316,13 @@ public function delete_peserta($id) { ...@@ -314,4 +316,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);
}
} }
<?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 = [];
}
<?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>
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<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