Commit e018b413 by Siti Aisah

fix form registrasi

parent 76735a02
......@@ -15,7 +15,8 @@
class RegistrasiController extends Controller
{
public function create(){
$kegiatan = Kegiatan::get();
$kegiatan = Kegiatan::where('is_foreach','1')->get();
$konvensi = Kegiatan::whereNull('is_foreach')->first();
$konferensi = Konferensi::get();
$jumlahPendaftar = Registrasi::count();
$nourut = sprintf("%05s", $jumlahPendaftar+1);
......@@ -25,6 +26,7 @@ public function create(){
$data = [
'kegiatan' => $kegiatan,
'konvensi' => $konvensi,
'konferensi' => $konferensi,
'kode_registrasi' => $koderegistrasi
];
......
......@@ -2,7 +2,7 @@
<div class="card">
<div class="card-body">
<div class="form-group" id = "list-kegiatan" @if ($errors->has('thematic_workshop')) has-error @endif>
<label>Kegiatan</label>
<label>Kegiatan tambahan</label>
@foreach ($kegiatan as $keg)
<div class="form-check">
<input class="form-check-input" type="radio" id="kegiatan" name="kegiatan{{ $i }}[]" value="{{ $keg->id }}">
......@@ -22,7 +22,9 @@
<label id="login-error" class="error" for="konferensi" style="color: red">{{$errors->first('konferensi')}}</label>
@endif
</div>
<div class="col-md-4 float-right">
<button class="btn btn-danger" type="button" onclick="hapusKegiatan('kegiatan-{{ $i }}')">Hapus</button>
</div>
</div>
<button class="btn btn-danger" type="button" onclick="hapusKegiatan('kegiatan-{{ $i }}')">hapus</button>
</div>
</div>
......@@ -108,6 +108,17 @@
</div>
</div>
<div class="col-12 col-md-4 col-lg-4">
<div class="card">
<div class="card-body">
<div class="form-group" id = "konvensi" @if ($errors->has('thematic_workshop')) has-error @endif>
<label>Kegiatan utama</label>
<div class="form-check">
<input class="form-check-input" type="radio" id="kegiatan-utama" name="kegiatan-utama" value="{{ $konvensi->id }}">
<label class="form-check-label" for="{{ $konvensi->nama }}">{{ $konvensi->nama }}</label>
</div>
</div>
</div>
</div>
<div class="row" id="parent-kegiatan">
{{ view('form_kegiatan', [
'kegiatan' => $kegiatan,
......@@ -116,7 +127,7 @@
]) }}
</div>
<div>
<button type="button" class="btn btn-primary" onclick="tambahKegiatan()">Tambah kegiatan</button>
<button type="button" class="btn btn-primary" onclick="tambahKegiatan()">+ Kegiatan Tambahan</button>
</div>
<div class="card">
<div class="card-body">
......@@ -186,6 +197,10 @@ function tambahKegiatan(){
data: {_token:token, i:i},
success: function (result) {
$('#parent-kegiatan').append(result);
},
error: function(error) {
alert('periksa koneksi anda');
}
});
......
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