@extends('layouts.master')
@section('content')
<style type="text/css">
       
        #profileImgField2 #profileImgInput2 {
            visibility: hidden;
            display: none;
        }
        #profileImgField2 {
            position: relative;
            background: #fff;
            padding: 13px;
            border-radius: 3px;
            box-shadow: 0px 0px 4px #e3e3e3;
            width: 100%;
            height: 150px;
        }
        #profileImgField2 img {
            max-width: 300px;
            max-height: 80px;
            overflow: hidden;
            cursor: pointer;
        }
        #profileImgField2 i {
            position: absolute;
            color: #3abaf4;
            bottom: 6px;
            right: 6px;
            font-size: 49px;
            z-index: 15;
            opacity: .5;
            cursor: pointer;
        }
    </style>

<div class="row">
        <div class="col-xl-12 col-xxl-12 m-auto">
            @if ($errors->any())
                <div class="alert alert-danger">
                    <ul>
                        @foreach ($errors->all() as $error)
                            <li>{{ $error }}</li>
                        @endforeach
                    </ul>
                </div>
            @endif

            <div class="card mt-4">
                <div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
                    <h6 class="m-0 table__top__txt">Admission Setting</h6>
                    <div class="m-0 float-right">
                    </div>
                </div>
                <form action="{{ route('admission-setting.update', $settings->id) }}" method="POST" enctype="multipart/form-data">
                    @csrf
                    <div class="row">
                        <div class="col-md-3">
                            <div class="form-group">
                                <label for="session">Session <span class="text-danger">*</span></label>
                                <input type="text" class="form-control" name="session" id="session" value="{{ old('session', $settings->session ?? '')}}" placeholder="Enter Session" required>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <label for="institute_name">Institute Name <span class="text-danger">*</span></label>
                                <input type="text" class="form-control" name="institute_name" id="institute_name" value="{{ old('institute_name', $settings->institute_name ?? '')}}" placeholder="Enter Institute Name" >
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <label for="status">Status</label>
                                <select name="status" id="status" class="form-control">
                                    <option value="1" {{ old('status', $settings->status ?? '') == '1' ? 'selected' : '' }}>Active</option>
                                    <option value="0" {{ old('status', $settings->status ?? '') == '0' ? 'selected' : '' }}>Inactive</option>
                                </select>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <div id="profileImgField2">
                                    <label class="d-block">Institute Logo</label>
                                    <label for="profileImgInput2">
                                        <img class="profileImgShow2"
                                            src="{{  $settings->institute_logo ? asset($settings->institute_logo) : asset('default/default.png') }}">
                                        <i class="fas fa-cloud-upload-alt"></i>
                                    </label>
                                    <input class="form-control profile-img-input2" id="profileImgInput2"
                                        name="institute_logo" type="file">
                                    <div id="signatureError" class="text-danger"></div>
                                </div>
                            </div>
                        </div>

                        <div class="col-md-12">
                            <div class="form-group">
                                <div class="mt-3 flex justify-content-end">
                                    <a href="{{ route('admission-setting.index') }}" type="button" class="btn btn-default mr-3">Discard</a>
                                    <button class="btn btn-submit">Update</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
@stop
