TIF_NGANJUK_E41220949/resources/views/admin/pengumuman/edit.blade.php

104 lines
4.9 KiB
PHP

@extends('admin.template')
@section('title', 'Edit Pengumuman')
@section('content')
<div class="content-wrapper">
<div class="row">
<div class="col-12 grid-margin stretch-card">
<div class="card">
<div class="card-body">
<h4 class="card-title">Edit Pengumuman</h4>
<p class="card-description">Form edit data pengumuman</p>
<form action="{{ route('admin.pengumuman.update', $pengumuman->id_pengumuman) }}"
method="POST"
enctype="multipart/form-data">
@csrf
@method('PUT')
{{-- JUDUL PENGUMUMAN --}}
<div class="form-group">
<label>Judul Pengumuman</label>
<input type="text"
name="judul_pengumuman"
class="form-control @error('judul_pengumuman') is-invalid @enderror"
value="{{ old('judul_pengumuman', $pengumuman->judul_pengumuman) }}"
required>
@error('judul_pengumuman')
<small class="text-danger">{{ $message }}</small>
@enderror
</div>
{{-- TANGGAL PENGUMUMAN --}}
<div class="form-group">
<label>Tanggal Pengumuman</label>
<input type="date"
name="tanggal_pengumuman"
class="form-control @error('tanggal_pengumuman') is-invalid @enderror"
value="{{ old('tanggal_pengumuman', $pengumuman->tanggal_pengumuman) }}"
required>
@error('tanggal_pengumuman')
<small class="text-danger">{{ $message }}</small>
@enderror
</div>
{{-- ISI PENGUMUMAN --}}
<div class="form-group">
<label>Isi Pengumuman</label>
<textarea name="isi_pengumuman"
rows="6"
class="form-control @error('isi_pengumuman') is-invalid @enderror"
placeholder="Isi Pengumuman">{{ old('isi_pengumuman', $pengumuman->isi_pengumuman) }}</textarea>
@error('isi_pengumuman')
<small class="text-danger">{{ $message }}</small>
@enderror
</div>
{{-- GAMBAR PENGUMUMAN --}}
<div class="form-group">
<label>Gambar Pengumuman</label>
<input type="file"
name="gambar_pengumuman"
id="gambar_pengumuman"
class="file-upload-default @error('gambar_pengumuman') is-invalid @enderror"
accept="image/*">
<div class="input-group col-xs-12">
<input type="text"
class="form-control file-upload-info"
disabled
placeholder="Upload Gambar">
<span class="input-group-append">
<button class="file-upload-browse btn btn-primary" type="button">
Upload
</button>
</span>
</div>
@error('gambar_pengumuman')
<small class="text-danger">{{ $message }}</small>
@enderror
{{-- PREVIEW GAMBAR LAMA --}}
@if ($pengumuman->gambar_pengumuman)
<div class="mt-2">
<img src="{{ asset('storage/' . $pengumuman->gambar_pengumuman) }}"
width="250"
class="img-thumbnail">
</div>
@endif
</div>
<button type="submit" class="btn btn-primary">Simpan</button>
<a href="{{ route('admin.pengumuman.index') }}" class="btn btn-light">Batal</a>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection