@extends('layouts.master')

@section('title')
    Publikasi Jurnal
@endsection

@section('header')
<div class="page-title">
    <h3>Publikasi Jurnal</h3>
</div>
@endsection

@section('contents')
@php
 $menu = 'dashboard';
@endphp
    <div class="account-settings-container layout-top-spacing">
        <form action="{{ $edit ? route('publikasijurnal.update', ['publikasijurnal' => encrypt($data->id)]) : route('publikasijurnal.store') }}" method="POST">
            @if ($edit)
                {{ method_field('PUT') }}
            @endif
            @csrf
        <div class="account-content">
            <div class="scrollspy-example" data-spy="scroll" data-target="#account-settings-scroll" data-offset="-100">
                <div class="row">

                    <div class="col-xl-12 col-lg-12 col-md-12 layout-spacing">
                            <div class="info">
                                <h5 class="">Data Publikasi Jurnal Internasional</h5>
                                <div class="row">
                                    <div class="col-md-11 mx-auto">
                                        <div class="row">
                                            <div class="col-md-12">
                                                <div class="form-group">
                                                    <label>Judul</label>
                                                    <textarea class="form-control" id="judul" placeholder="Judul" name="judul" rows="3">{{ $edit ? $data->judul : old('judul') }}</textarea>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label>Nama Jurnal</label>
                                                    <input type="text" class="form-control mb-4" id="nama" name="nama_jurnal" placeholder="Nama Jurnal" value="{{ $edit ? $data->nama_jurnal : old('nama_jurnal') }}">
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label>ISSN</label>
                                                    <input type="text" class="form-control mb-4" id="issn" placeholder="ISSN" name="issn" value="{{ $edit ? $data->issn : old('issn') }}">
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label>Volume</label>
                                                    <input type="text" class="form-control mb-4" id="volume" placeholder="Volume" name="volume" value="{{ $edit ? $data->volume : old('volume') }}">
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label>Nomor</label>
                                                    <input type="text" class="form-control mb-4" id="nomor" placeholder="Nomor" name="nomor" value="{{ $edit ? $data->nomor : old('nomor') }}">
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <label for="date">Halaman</label>
                                                 <div class="row">
                                                    <div class="col-xl-5">
                                                        <div class="form-group">
                                                            <input type="number" min="0" class="form-control mb-4" id="halaman1" name="halaman1" value="{{ $edit ? explode('-', $data->halaman)[0] : old('halaman1') }}" required>
                                                        </div>
                                                    </div>
                                                    <div class="col-xl-1">
                                                        <div class="form-group">
                                                            <label>s/d</label>
                                                        </div>
                                                    </div>
                                                    <div class="col-xl-5">
                                                        <div class="form-group">
                                                            <input type="number" min="0" class="form-control mb-4" id="halaman2" name="halaman2" value="{{ $edit ? explode('-', $data->halaman)[1] : old('halaman2') }}" required>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label>Url Artikel</label>
                                                    <input type="text" class="form-control mb-4" id="tempat" name="url" placeholder="URL Artikel" value="{{ $edit ? $data->url : old('url') }}" required>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                    </div>



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

        <div class="account-settings-footer">
            <div class="as-footer-container">
                <a href="{{ route('publikasijurnal.index') }}" id="multiple-reset" class="btn btn-warning">Batal</a>
                <button id="multiple-messages" class="btn btn-primary">Simpan</button>
            </div>
        </div>
        </form>
    </div>

@endsection

@section('js')
    <script src="{{ url('theme/plugins/apex/apexcharts.min.js') }} "></script>
    <script src="{{ url('theme/assets/js/dashboard/dash_2.js') }} "></script>
@endsection
