@extends('layouts.layout-user')
@section('content')
<h2 style="display: inline-block; margin-right: 10px;">Update Informasi System</h2>
<div class="row">
    <div class="w-full">
        <div class="card shadow text-decoration-none" style="display: flex; grid-template-columns: 1fr 2fr;">
            <div class="card-body" style="padding: 20px;">
                <form class="form-horizontal" action="{{ route('informasi.adminUpdate', $informasis->id) }}" method="POST" enctype="multipart/form-data">
                    @csrf
                    @method('PUT')
                    <div class="container">
                        <div class="row">
                            <div class="col-lg-6">
                                <div style="width: 100%;">
                                    <div style="margin-bottom: 10px;">
                                        <label for="judul">Judul</label>
                                        <input type="text" class="form-control" name="judul" id="judul" placeholder="Masukkan judul" aria-describedby="defaultFormControlHelp" value="{{ $informasis->judul }}">
                                    </div>
                                    <div style="margin-bottom: 10px;">
                                        <label for="kategori">Kategori</label>
                                        <select class="form-select" name="kategori" aria-describedby="defaultFormControlHelp">
                                            <option value="{{ $informasis->kategori }}">{{ $informasis->kategori }}</option>
                                            <option value="Lingkungan">Lingkungan</option>
                                            <option value="Keselamatan">Keselamatan</option>
                                            <option value="Kesehatan">Kesehatan</option>
                                        </select>
                                    </div>
                                   <div>
                                        <span>Foto Informasi</span>
                                        <div class="input-group input-group-merge" style="max-width: 600px; margin-bottom: 10px;">
                                            <input type="file" class="form-control" name="foto">
                                        </div>
                                    </div>
                                </div>
                                <div style="text-align: left; margin-top: 5%; margin-bottom: 5%;">
                                    <a href="{{ route('informasi.adminIndex') }}" class="btn  btn-delete" style="display: inline-block; width: 100px; background-color: #ffffff; color: #4f60e0; border: 2px solid #4f60e0; border-radius: 4px; cursor: pointer; text-align: center;">Back</a>
                                    <button type="submit" name="submit" class="btn  btn-delete" style="background-color: #4f60e0; color: #fff; border: none; border-radius: 4px; cursor: pointer;">Update</button>
                                </div>
                            </div>
                            <div class="col-lg-6">
                                <div style="width: 100%;">
                                    <div style="display: flex; justify-content: left; align-items: left; flex-direction: column; max-width: 300px;">
                                        <span>Foto saat ini:</span>
                                        <img src="{{ asset('foto/' . $informasis->foto) }}" alt="Foto" style="max-width: 100%; object-fit: cover;">
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>

                </form>
            </div>
        </div>

    </div>
</div>



@endsection
