Commit 7a5e1c7e by Siti Aisah

add form registrasi kelompok

parent b0433d1a
......@@ -51,6 +51,36 @@ public function create(){
return view('form_registrasi', $data);
}
public function group_create(){
$dataUniv = json_decode($this->getDataUniv(), true);
foreach($dataUniv as $univ){
if($univ['id_wil'] != '999999'){
$universitas[] = [
'id_sp' => $univ['id_sp'],
'nm_lemb' => $univ['nm_lemb']
];
}
}
$data = [
'universitas' => $universitas
];
return view('form_registrasi_kelompok', $data);
}
public function group_kegiatan(Request $request){
$kegiatan = Kegiatan::orderBy('id')->get();
$konferensi = Konferensi::get();
$data = [
'kegiatan' => $kegiatan,
'konferensi' => $konferensi
];
return view('form_kegiatan_kelompok', $data);
}
public function preview(Request $request){
$rules = [
'nama' => 'required|string',
......@@ -293,6 +323,14 @@ public function addFormKegiatan(Request $request)
return view('form_kegiatan', $data);
}
public function addFormAnggota(Request $request)
{
$data['i'] = $request->i;
return view('form_anggota_kelompok', $data);
}
public function getDataRegis($va)
{
$registrasi = Registrasi::query()
......
<div class="col-12 col-md-8 col-lg-8" id="anggota-{{ $i }}">
<div class="card">
<div class="card-body" id="list-anggota">
<div class="row">
<div class="col-6 form-group" @if ($errors->has('nama')) has-error @endif>
<label>Nama</label>
<input type="text" id="nama" name="nama" class="form-control" required="" placeholder="" value="{{ old('nama')}}">
@if ($errors->has('nama'))
<label id="login-error" class="error" for="nama" style="color: red">{{$errors->first('nama')}}</label>
@endif
</div>
<div class="col-6 form-group" @if ($errors->has('nik')) has-error @endif>
<label>NIK</label>
<input type="text" id="nik" name="nik" class="form-control" required="" placeholder="" value="{{ old('nik')}}">
@if ($errors->has('nik'))
<label id="login-error" class="error" for="nik" style="color: red">{{$errors->first('nik')}}</label>
@endif
</div>
</div>
<div class="row">
<div class="col-6 form-group" @if ($errors->has('email')) has-error @endif>
<label>E-mail</label>
<div class="input-group">
<div class="input-group-prepend">
<div class="input-group-text">
<i class="fas fa-envelope"></i>
</div>
</div>
<input type="email" id="email" name="email" class="form-control email" required="" placeholder="" value="{{ old('email')}}">
</div>
@if ($errors->has('email'))
<label id="login-error" class="error" for="nama_depan" style="color: red">{{$errors->first('email')}}</label>
@endif
</div>
<div class="col-6 form-group" @if ($errors->has('telepon')) has-error @endif>
<label>Telepon</label>
<div class="input-group">
<div class="input-group-prepend">
<div class="input-group-text">
<i class="fas fa-phone"></i>
</div>
</div>
<input type="number" id="telepon" name="telepon" class="form-control number" required="true" placeholder="" value="{{ old('telepon')}}">
</div>
@if ($errors->has('telepon'))
<label id="login-error" class="error" for="telepon" style="color: red">{{$errors->first('telepon')}}</label>
@endif
</div>
</div>
</div>
</div>
<div>
<button type="button" class="btn btn-primary" onclick="tambahAnggota()" name="tambah-anggota" id="tambah-anggota">Tambah Anggota</button>
</div>
</div>
<div class="col-12 col-md-4 col-lg-4">
<div class="row" id="parent-kegiatan">
{{ view('form_kegiatan', [
'kegiatan' => $kegiatan,
'konferensi' => $konferensi,
'i' => 0
]) }}
</div>
<div>
<button type="button" class="btn btn-primary" onclick="tambahKegiatan()" name="tambah-kegiatan" id="tambah-kegiatan">Tambah kegiatan</button>
</div>
<hr>
</div>
</div>
<div class="card-footer text-right">
<button class="btn btn-primary mr-1" type="submit">Daftar</button>
<button class="btn btn-secondary" type="reset">Reset</button>
</div>
</div>
</form>
</section>
@endsection
@push('js')
<script>
$(document).ready(function () {
//change selectboxes to selectize mode to be searchable
$("#instansi").select2();
});
</script>
<script>
function cekKegiatan(id){
var value = document.getElementById(id).value;
if(value == '498633a9-082c-4a4a-9dbd-e20b678ec15e'){
$('#grup-konferensi').hide();
$('#tambah-kegiatan').hide();
var konferensi = document.getElementById("konferensi");
konferensi.required = false;
document.getElementById('konferensi').value = "";
} else {
$('#grup-konferensi').show();
$('#tambah-kegiatan').show();
var konferensi = document.getElementById("konferensi");
konferensi.required = true;
}
}
</script>
<script>
var i = 1;
function tambahKegiatan(){
let token = '{{ csrf_token() }}';
if (i === undefined) {
i = 1;
}
var request = $.ajax({
url: '{{ route('registrasi.form-kegiatan.add') }}',
type:'POST',
dataType: 'html',
data: {_token:token, i:i},
success: function (result) {
$('#parent-kegiatan').append(result);
},
error: function(error) {
alert('periksa koneksi anda');
}
});
i++;
}
function hapusKegiatan(id){
$('#'+id).remove();
}
</script>
<script>
var i = 1;
function tambahAnggota(){
let token = '{{ csrf_token() }}';
if (i === undefined) {
i = 1;
}
var request = $.ajax({
url: '{{ route('registrasi.form-anggota.add') }}',
type:'POST',
dataType: 'html',
data: {_token:token, i:i},
success: function (result) {
$('#parent-anggota').append(result);
},
error: function(error) {
alert('periksa koneksi anda');
}
});
i++;
}
function hapusKegiatan(id){
$('#'+id).remove();
}
</script>
@endpush
@extends('layouts.app')
@section('title','Registrasi')
@section('content')
<section class="section">
<div class="section-header">
<h1>Tambah Anggota dan Kegiatan</h1>
<div class="section-header-breadcrumb">
</div>
</div>
<form class="needs-validation" novalidate="" method="POST" action="{{ route('user.preview')}}" enctype="multipart/form-data">
<div class="section-body">
@csrf
<div class="row">
<div class="col-12 col-md-8 col-lg-8">
<div class="card">
<div class="card-body" id="parent-anggota">
<div class="row">
<div class="col-6 form-group" @if ($errors->has('nama')) has-error @endif>
<label>Nama</label>
<input type="text" id="nama" name="nama" class="form-control" required="" placeholder="" value="{{ old('nama')}}">
@if ($errors->has('nama'))
<label id="login-error" class="error" for="nama" style="color: red">{{$errors->first('nama')}}</label>
@endif
</div>
<div class="col-6 form-group" @if ($errors->has('nik')) has-error @endif>
<label>NIK</label>
<input type="text" id="nik" name="nik" class="form-control" required="" placeholder="" value="{{ old('nik')}}">
@if ($errors->has('nik'))
<label id="login-error" class="error" for="nik" style="color: red">{{$errors->first('nik')}}</label>
@endif
</div>
</div>
<div class="row">
<div class="col-6 form-group" @if ($errors->has('email')) has-error @endif>
<label>E-mail</label>
<div class="input-group">
<div class="input-group-prepend">
<div class="input-group-text">
<i class="fas fa-envelope"></i>
</div>
</div>
<input type="email" id="email" name="email" class="form-control email" required="" placeholder="" value="{{ old('email')}}">
</div>
@if ($errors->has('email'))
<label id="login-error" class="error" for="nama_depan" style="color: red">{{$errors->first('email')}}</label>
@endif
</div>
<div class="col-6 form-group" @if ($errors->has('telepon')) has-error @endif>
<label>Telepon</label>
<div class="input-group">
<div class="input-group-prepend">
<div class="input-group-text">
<i class="fas fa-phone"></i>
</div>
</div>
<input type="number" id="telepon" name="telepon" class="form-control number" required="true" placeholder="" value="{{ old('telepon')}}">
</div>
@if ($errors->has('telepon'))
<label id="login-error" class="error" for="telepon" style="color: red">{{$errors->first('telepon')}}</label>
@endif
</div>
</div>
</div>
</div>
<div>
<button type="button" class="btn btn-primary" onclick="tambahAnggota()" name="tambah-anggota" id="tambah-anggota">Tambah Anggota</button>
</div>
</div>
<div class="col-12 col-md-4 col-lg-4">
<div class="row" id="parent-kegiatan">
{{ view('form_kegiatan', [
'kegiatan' => $kegiatan,
'konferensi' => $konferensi,
'i' => 0
]) }}
</div>
<div>
<button type="button" class="btn btn-primary" onclick="tambahKegiatan()" name="tambah-kegiatan" id="tambah-kegiatan">Tambah kegiatan</button>
</div>
<hr>
</div>
</div>
<div class="card-footer text-right">
<button class="btn btn-primary mr-1" type="submit">Daftar</button>
<button class="btn btn-secondary" type="reset">Reset</button>
</div>
</div>
</form>
</section>
@endsection
@push('js')
<script>
$(document).ready(function () {
//change selectboxes to selectize mode to be searchable
$("#instansi").select2();
});
</script>
<script>
function cekKegiatan(id){
var value = document.getElementById(id).value;
if(value == '498633a9-082c-4a4a-9dbd-e20b678ec15e'){
$('#grup-konferensi').hide();
$('#tambah-kegiatan').hide();
var konferensi = document.getElementById("konferensi");
konferensi.required = false;
document.getElementById('konferensi').value = "";
} else {
$('#grup-konferensi').show();
$('#tambah-kegiatan').show();
var konferensi = document.getElementById("konferensi");
konferensi.required = true;
}
}
</script>
<script>
var i = 1;
function tambahKegiatan(){
let token = '{{ csrf_token() }}';
if (i === undefined) {
i = 1;
}
var request = $.ajax({
url: '{{ route('registrasi.form-kegiatan.add') }}',
type:'POST',
dataType: 'html',
data: {_token:token, i:i},
success: function (result) {
$('#parent-kegiatan').append(result);
},
error: function(error) {
alert('periksa koneksi anda');
}
});
i++;
}
function hapusKegiatan(id){
$('#'+id).remove();
}
</script>
<script>
var i = 1;
function tambahAnggota(){
let token = '{{ csrf_token() }}';
if (i === undefined) {
i = 1;
}
var request = $.ajax({
url: '{{ route('registrasi.form-anggota.add') }}',
type:'POST',
dataType: 'html',
data: {_token:token, i:i},
success: function (result) {
$('#parent-anggota').append(result);
},
error: function(error) {
alert('periksa koneksi anda');
}
});
i++;
}
function hapusKegiatan(id){
$('#'+id).remove();
}
</script>
@endpush
......@@ -3,7 +3,7 @@
@section('content')
<section class="section">
<div class="section-header">
<h1>Registrasi</h1>
<h1>Registrasi Individu</h1>
<div class="section-header-breadcrumb">
</div>
</div>
......
......@@ -23,7 +23,7 @@
</li>
@else
<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('pre-register')}}"><i class="fas fa-file-pen"></i><span>Registrasi</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{url('/login')}}"><i class="fa fa-sign-in"></i><span>Login</span></a>
......
@extends('layouts.app')
@section('title','Registrasi')
@section('content')
<section class="section">
<div class="section-header">
<h1>Registrasi</h1>
<div class="section-header-breadcrumb">
<div class="breadcrumb-item"><a href="/">Dashboard</a></div>
<div class="breadcrumb-item active">Registrasi</div>
</div>
</div>
@csrf
<div class="section-body">
<div class="invoice">
<div class="invoice-print">
<div class="row">
<div class="col-lg-12">
<div class="invoice-title">
<h3>Pilih Jenis Registrasi</h3>
</div>
<hr>
<div class="row" style="font-size: 12pt">
<div class="col-md-6">
<div class="card" style="background-color:aliceblue">
<div class="card-body">
<h5 class="card-title">Registrasi Individu</h5>
<p class="card-text">Registrasi untuk individu/mandiri.</p>
<a href="{{ route('user.create') }}" class="btn btn-primary">Daftar</a>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card" style="background-color:aliceblue">
<div class="card-body">
<h5 class="card-title">Registrasi Kelompok</h5>
<p class="card-text">Registrasi untuk kelompok dengan 1 perwakilan.</p>
<a href="{{ route('group.create') }}" class="btn btn-primary">Daftar</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<hr>
<div class="text-md-right">
{{-- <a href="{{route('user.create')}}" class="btn btn-danger btn-icon icon-left"><i class="fas fa-times"></i>Close</a> --}}
</div>
</div>
</div>
</section>
@endsection
......@@ -16,10 +16,17 @@
|
*/
Route::get('/', [RegistrasiController::class,'create'])->name('user.create');
Route::get('/individu', [RegistrasiController::class,'create'])->name('user.create');
Route::get('/kelompok', [RegistrasiController::class,'group_create'])->name('group.create');
// Route::get('/', function(Request $request){
// return view('penutupan');
// });
Route::get('/', function(Request $request){
return view('pre-register');
})->name('pre-register');
Route::post('/kegiatan-kelompok', [RegistrasiController::class,'group_kegiatan'])->name('group.kegiatan');
Route::post('/store', [RegistrasiController::class,'store'])->name('user.store');
Route::post('/preview', [RegistrasiController::class,'preview'])->name('user.preview');
......@@ -45,6 +52,7 @@
Route::get('/delete_peserta/{id}', [AdminController::class, 'delete_peserta'])->name('admin.delete_peserta');
Route::post('/add-kegiatan', [RegistrasiController::class, 'addFormKegiatan'])->name('registrasi.form-kegiatan.add');
Route::post('/add-anggota', [RegistrasiController::class, 'addFormAnggota'])->name('registrasi.form-anggota.add');
Route::get('check-invoice', function(Request $request){
return view('email.invoice');
});
......
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