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) {
try{
$data = [
'nama' => $request->nama,
'nama' => strip_tags($request->nama),
'harga' => $request->harga
];
Kegiatan::query()->create($data);
......@@ -217,7 +217,8 @@ public function index_konferensi() {
public function store_konferensi(Request $request) {
$rules = [
'nama' => 'required|string'
'nama' => 'required|string',
'harga' => 'required|numeric'
];
$request->validate($rules, ValidationRule::getErrorMessage($rules));
......@@ -226,7 +227,8 @@ public function store_konferensi(Request $request) {
try{
$data = [
'nama' => strip_tags($request->nama)
'nama' => strip_tags($request->nama),
'harga' => $request->harga
];
Konferensi::query()->create($data);
DB::commit();
......@@ -245,7 +247,8 @@ public function store_konferensi(Request $request) {
public function update_konferensi($id, Request $request) {
$rules = [
'nama' => 'required|string'
'nama' => 'required|string',
'harga' => 'required|numeric'
];
$request->validate($rules, ValidationRule::getErrorMessage($rules));
......@@ -254,7 +257,8 @@ public function update_konferensi($id, Request $request) {
try{
$data = [
'nama' => $request->nama
'nama' => $request->nama,
'harga' => $request->harga
];
Konferensi::query()->where('id', $id)->update($data);
......
......@@ -303,6 +303,7 @@ public function getDataRegis($va)
$konvensi = Kegiatan::query()->find('498633a9-082c-4a4a-9dbd-e20b678ec15e');
$konv = $konvensi->toArray();
$totalHarga = $totalHarga = (int) $konvensi->harga;
$kegPeserta = [];
foreach($registrasi->pkRegistrasiPeserta as $item){
......@@ -342,21 +343,31 @@ public function updatePembayaran(Request $request, $va)
], 200);
}
$registrasi = Registrasi::query()
->with('pkKegiatan', 'pkRegistrasiPeserta.rKegiatanPeserta', 'pkRegistrasiPeserta.rKonferensiPeserta')
->where('nomor_va', $va)
->update([
'tanggal_bayar' => Carbon::now()
]);
try{
$registrasi = Registrasi::query()
->with('pkKegiatan', 'pkRegistrasiPeserta.rKegiatanPeserta', 'pkRegistrasiPeserta.rKonferensiPeserta')
->where('nomor_va', $va)
->update([
'tanggal_bayar' => Carbon::now()
]);
$data = $this->getDataRegis($va);
$data = $this->getDataRegis($va);
// SendMail::dispatch($data, 'email.selesai_pembayaran', $data['registrasi']->email, 'registrasi', 'email_pembayaran_sent_at');
return response([
'status' => 200,
'message' => 'success'
], 200);
return response([
'status' => 200,
'message' => 'success'
], 200);
}
catch(Exception $ex){
Log::error($ex);
return response([
'status' => 404,
'message' => 'gagal mengupdate data'
], 200);
}
}
public function testEmail(Request $request)
......
......@@ -17,7 +17,8 @@ class Konferensi extends Model
protected $fillable = [
'id',
'nama'
'nama',
'harga'
];
public function rKonferensi() {
......
......@@ -26,6 +26,7 @@
<tr style="text-align: center;">
<th>No.</th>
<th>Konferensi</th>
<th>Harga</th>
<th>Aksi</th>
</tr>
</thead>
......@@ -37,6 +38,7 @@
<tr style="text-align: center;">
<td>{{ $no }}</td>
<td>{{ $tr->nama}}</td>
<td>{{ $tr->harga }}</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-danger" data-toggle="modal" data-target="#delete-modal{{$tr->id}}">Hapus</button>
......@@ -51,14 +53,21 @@
<form method="POST" action="{{ route('admin.create_konferensi', ['id' => $tr->id ]) }}" enctype="multipart/form-data">
@csrf
<div class="modal-body" @if ($errors->has('nama')) has-error @endif>
<div class="modal-body">
<div class="form-group" style="text-align: left">
<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'))
<label id="login-error" class="error" for="nama" style="color: red">{{$errors->first('nama')}}</label>
@endif
</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 class="modal-footer">
<button type="submit" class="btn btn-primary ml-1">Simpan</button>
......@@ -81,14 +90,21 @@
<form method="POST" action="{{ route('admin.update_konferensi', ['id' => $tr->id ]) }}" enctype="multipart/form-data">
@csrf
@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">
<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'))
<label id="login-error" class="error" for="nama" style="color: red">{{$errors->first('nama')}}</label>
@endif
</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 class="modal-footer">
<button type="submit" class="btn btn-primary ml-1">Simpan</button>
......
......@@ -7,7 +7,7 @@
<div class="invoice-print">
<div class="row">
<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">
<h2>Invoice</h2>
<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