Commit 5982af92 by Triyah Fatmawati

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

parents b9fbe579 896ed11a
...@@ -139,7 +139,7 @@ public function store_kegiatan(Request $request) { ...@@ -139,7 +139,7 @@ public function store_kegiatan(Request $request) {
try{ try{
$data = [ $data = [
'nama' => $request->nama, 'nama' => strip_tags($request->nama),
'harga' => $request->harga 'harga' => $request->harga
]; ];
Kegiatan::query()->create($data); Kegiatan::query()->create($data);
...@@ -217,7 +217,8 @@ public function index_konferensi() { ...@@ -217,7 +217,8 @@ public function index_konferensi() {
public function store_konferensi(Request $request) { public function store_konferensi(Request $request) {
$rules = [ $rules = [
'nama' => 'required|string' 'nama' => 'required|string',
'harga' => 'required|numeric'
]; ];
$request->validate($rules, ValidationRule::getErrorMessage($rules)); $request->validate($rules, ValidationRule::getErrorMessage($rules));
...@@ -226,7 +227,8 @@ public function store_konferensi(Request $request) { ...@@ -226,7 +227,8 @@ public function store_konferensi(Request $request) {
try{ try{
$data = [ $data = [
'nama' => strip_tags($request->nama) 'nama' => strip_tags($request->nama),
'harga' => $request->harga
]; ];
Konferensi::query()->create($data); Konferensi::query()->create($data);
DB::commit(); DB::commit();
...@@ -245,7 +247,8 @@ public function store_konferensi(Request $request) { ...@@ -245,7 +247,8 @@ public function store_konferensi(Request $request) {
public function update_konferensi($id, Request $request) { public function update_konferensi($id, Request $request) {
$rules = [ $rules = [
'nama' => 'required|string' 'nama' => 'required|string',
'harga' => 'required|numeric'
]; ];
$request->validate($rules, ValidationRule::getErrorMessage($rules)); $request->validate($rules, ValidationRule::getErrorMessage($rules));
...@@ -254,7 +257,8 @@ public function update_konferensi($id, Request $request) { ...@@ -254,7 +257,8 @@ public function update_konferensi($id, Request $request) {
try{ try{
$data = [ $data = [
'nama' => $request->nama 'nama' => $request->nama,
'harga' => $request->harga
]; ];
Konferensi::query()->where('id', $id)->update($data); Konferensi::query()->where('id', $id)->update($data);
......
...@@ -303,6 +303,7 @@ public function getDataRegis($va) ...@@ -303,6 +303,7 @@ public function getDataRegis($va)
$konvensi = Kegiatan::query()->find('498633a9-082c-4a4a-9dbd-e20b678ec15e'); $konvensi = Kegiatan::query()->find('498633a9-082c-4a4a-9dbd-e20b678ec15e');
$konv = $konvensi->toArray(); $konv = $konvensi->toArray();
$totalHarga = $totalHarga = (int) $konvensi->harga; $totalHarga = $totalHarga = (int) $konvensi->harga;
$kegPeserta = [];
foreach($registrasi->pkRegistrasiPeserta as $item){ foreach($registrasi->pkRegistrasiPeserta as $item){
...@@ -342,6 +343,7 @@ public function updatePembayaran(Request $request, $va) ...@@ -342,6 +343,7 @@ public function updatePembayaran(Request $request, $va)
], 200); ], 200);
} }
try{
$registrasi = Registrasi::query() $registrasi = Registrasi::query()
->with('pkKegiatan', 'pkRegistrasiPeserta.rKegiatanPeserta', 'pkRegistrasiPeserta.rKonferensiPeserta') ->with('pkKegiatan', 'pkRegistrasiPeserta.rKegiatanPeserta', 'pkRegistrasiPeserta.rKonferensiPeserta')
->where('nomor_va', $va) ->where('nomor_va', $va)
...@@ -358,6 +360,15 @@ public function updatePembayaran(Request $request, $va) ...@@ -358,6 +360,15 @@ public function updatePembayaran(Request $request, $va)
'message' => 'success' 'message' => 'success'
], 200); ], 200);
} }
catch(Exception $ex){
Log::error($ex);
return response([
'status' => 404,
'message' => 'gagal mengupdate data'
], 200);
}
}
public function testEmail(Request $request) public function testEmail(Request $request)
{ {
......
...@@ -17,7 +17,8 @@ class Konferensi extends Model ...@@ -17,7 +17,8 @@ class Konferensi extends Model
protected $fillable = [ protected $fillable = [
'id', 'id',
'nama' 'nama',
'harga'
]; ];
public function rKonferensi() { public function rKonferensi() {
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
<tr style="text-align: center;"> <tr style="text-align: center;">
<th>No.</th> <th>No.</th>
<th>Konferensi</th> <th>Konferensi</th>
<th>Harga</th>
<th>Aksi</th> <th>Aksi</th>
</tr> </tr>
</thead> </thead>
...@@ -37,6 +38,7 @@ ...@@ -37,6 +38,7 @@
<tr style="text-align: center;"> <tr style="text-align: center;">
<td>{{ $no }}</td> <td>{{ $no }}</td>
<td>{{ $tr->nama}}</td> <td>{{ $tr->nama}}</td>
<td>{{ $tr->harga }}</td>
<td> <td>
<button type="button" class="btn btn-info" data-toggle="modal" data-target="#update-modal{{$tr->id}}">Ubah</button> <button type="button" class="btn btn-info" data-toggle="modal" data-target="#update-modal{{$tr->id}}">Ubah</button>
<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#delete-modal{{$tr->id}}">Hapus</button> <button type="button" class="btn btn-danger" data-toggle="modal" data-target="#delete-modal{{$tr->id}}">Hapus</button>
...@@ -51,14 +53,21 @@ ...@@ -51,14 +53,21 @@
<form method="POST" action="{{ route('admin.create_konferensi', ['id' => $tr->id ]) }}" enctype="multipart/form-data"> <form method="POST" action="{{ route('admin.create_konferensi', ['id' => $tr->id ]) }}" enctype="multipart/form-data">
@csrf @csrf
<div class="modal-body" @if ($errors->has('nama')) has-error @endif> <div class="modal-body">
<div class="form-group" style="text-align: left"> <div class="form-group" style="text-align: left">
<label for="nama">Nama Konferensi</label> <label for="nama">Nama Konferensi</label>
<input type="text" class="form-control" id="nama" name="nama" required> <input type="text" class="form-control" id="nama" name="nama" required @if($errors->has('nama')) has-error @endif>
@if ($errors->has('nama')) @if ($errors->has('nama'))
<label id="login-error" class="error" for="nama" style="color: red">{{$errors->first('nama')}}</label> <label id="login-error" class="error" for="nama" style="color: red">{{$errors->first('nama')}}</label>
@endif @endif
</div> </div>
<div class="form-group" style="text-align: left">
<label for="harga">Harga</label>
<input type="number" class="form-control" id="harga" name="harga" required @if($errors->has('harga')) has-error @endif>
@if($errors->has('harga'))
<label id="login-error" class="error" for="harga" style="color: red">{{$errors->first('harga')}}</label>
@endif
</div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="submit" class="btn btn-primary ml-1">Simpan</button> <button type="submit" class="btn btn-primary ml-1">Simpan</button>
...@@ -81,14 +90,21 @@ ...@@ -81,14 +90,21 @@
<form method="POST" action="{{ route('admin.update_konferensi', ['id' => $tr->id ]) }}" enctype="multipart/form-data"> <form method="POST" action="{{ route('admin.update_konferensi', ['id' => $tr->id ]) }}" enctype="multipart/form-data">
@csrf @csrf
@method('put') @method('put')
<div class="modal-body" @if ($errors->has('nama')) has-error @endif> <div class="modal-body">
<div class="form-group" style="text-align: left"> <div class="form-group" style="text-align: left">
<label for="nama">Nama Konferensi</label> <label for="nama">Nama Konferensi</label>
<input type="text" class="form-control" id="nama" name="nama" value="{{ $tr->nama }}" required> <input type="text" class="form-control" id="nama" name="nama" value="{{ $tr->nama }}" required @if($errors->has('nama')) has-error @endif>
@if ($errors->has('nama')) @if ($errors->has('nama'))
<label id="login-error" class="error" for="nama" style="color: red">{{$errors->first('nama')}}</label> <label id="login-error" class="error" for="nama" style="color: red">{{$errors->first('nama')}}</label>
@endif @endif
</div> </div>
<div class="form-group" style="text-align: left">
<label for="harga">Harga</label>
<input type="text" class="form-control" id="harga" name="harga" value="{{ $tr->harga }}" required @if($errors->has('harga')) has-error @endif>
@if($errors->has('harga'))
<label id="login-error" class="error" for="harga" style="color: red">{{$errors->first('harga')}}</label>
@endif
</div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="submit" class="btn btn-primary ml-1">Simpan</button> <button type="submit" class="btn btn-primary ml-1">Simpan</button>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<div class="invoice-print"> <div class="invoice-print">
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
<p class="section-lead" style="font-size: 12pt">Terimakasih telah mendaftar KONASPI XI 2024. ({{ !is_null($registrasi->tanggal_bayar) ? 'LUNAS' : 'Menunggu Pembayaran' }})</p> <p class="section-lead" style="font-size: 12pt">Terimakasih telah mendaftar KONASPI XI 2024. {{ !is_null($registrasi->tanggal_bayar) ? 'Kami ingin menginformasikan bahwa kami telah menerima pembayaran yang Anda kirimkan. Berikut adalah rincian terkait pembayaran yang telah diterima:' : 'Berikut adalah rincian terkait pembayaran yang harus dibayar:' }}</p>
<div class="invoice-title"> <div class="invoice-title">
<h2>Invoice</h2> <h2>Invoice</h2>
<div class="invoice-number">No. Transaksi #{{$registrasi['kode_registrasi'] ?? 'param' }}</div> <div class="invoice-number">No. Transaksi #{{$registrasi['kode_registrasi'] ?? 'param' }}</div>
......
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