MIF_E31210385/resources/views/admin/app/users/walimurid/edit.blade.php

79 lines
5.0 KiB
PHP

@include('components.theme.pages.header')
<section>
<!-- basic table -->
<div class="row mb-4">
<div class="col-12">
<div class="card">
<div class="card-header d-flex">
<h6 class="m-0 font-weight-bold text-primary">Perbarui Wali Murid</h6>
<p class="m-0 ml-auto small"><span class="text-danger">*</span> Wajib diisi</p>
</div>
<div class="card-body">
<form action="{{ app_url('wali-murid') . '/update/' . $data['records']['id'] }}" method="POST" enctype="multipart/form-data">
@csrf
@if(session()->has('success'))
<div class="alert alert-success">
{{ session()->get('success') }}
</div>
@else
@if(session()->has('error'))
<div class="alert alert-danger">
{{ session()->get('error') }}
</div>
@endif
@endif
<div class="row mb-3">
<div class="col">
<label>Email Address<sup class="text-danger">*</sup></label>
<input type="email" name="email" value="{{ $data['records']['email'] }}" autocomplete="off" class="form-control mt-1 {{ $errors->has('email') ? 'is-invalid' : '' }}" placeholder="Enter Email Address">
@error('email') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="col">
<label>Full Name<sup class="text-danger">*</sup></label>
<input type="text" name="name" value="{{ $data['records']['name'] }}" autocomplete="off" class="form-control mt-1 {{ $errors->has('name') ? 'is-invalid' : '' }}" placeholder="Enter Name">
@error('name') <small class="text-danger">{{ $message }}</small> @enderror
</div>
</div>
<div class="form-group mb-3" data-kt-password-meter="true">
<label>Password<sup class="text-danger">*</sup></label>
<input type="password" name="password" value="{{ old('password') }}" autocomplete="off" class="form-control mt-1 {{ $errors->has('password') ? 'is-invalid' : '' }}" placeholder="Enter Password">
@error('password') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="row mb-3">
<div class="col">
<label>Status Account<sup class="text-danger">*</sup></label>
<select name="status" class="form-control mt-2 {{ $errors->has('status') ? 'is-invalid' : '' }}">
@foreach ([1,2,3,4] as $roles)
@php $name = $roles == 1 ? 'Active' : ($roles == 2 ? 'Non Active' : ($roles == 3 ? 'Deactivated' : 'Not Verified')) @endphp
@php $selected = $data['records']['status'] == $roles ? 'selected' : '' @endphp
@php $selected_name = $data['records']['status'] == $roles ? '(selected)' : '' @endphp
<option value="{{ $roles }}" {{ $selected }}>{{ $name }} {{ $selected_name }}</option>
@endforeach
</select>
@error('status') <small class="text-danger">{{ $message }}</small> @enderror
</div>
</div>
<div class="form-group mb-3">
<label>Thumbnail</label>
<input class="form-control mt-1 mb-3 {{ $errors->has('thumbnail') ? 'is-invalid' : '' }}" type="file" name="images">
@if(!empty($data['records']['thumbnail']))
<small class="text-muted">Found in: <a href="{{ asset('storage/images/'.$data['records']['thumbnail']) }}" target="_blank">{{ asset('storage/images/'.$data['records']['thumbnail']) }}</a></small>
@else
<small class="text-muted">No image found</small>
@endif
</div>
<div class="form-group mb-0">
<button type="submit" class="btn btn-primary">Simpan</button>
<a href="{{ app_url('wali-murid') }}" class="btn btn-light btn-light">Kembali</a>
</div>
{{ Form::close() }}
</div>
</div>
</div>
</div>
</section>
@include('components.theme.pages.footer')