@extends('layouts.main')
@section('content')
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h1>Post Mortem Report upload</h1>
          </div>
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item"><a href="#">Home</a></li>
              <li class="breadcrumb-item active">Post Mortem Report upload</li>
            </ol>
          </div>
        </div>
      </div><!-- /.container-fluid -->
    </section>
    <!-- Main content -->
    <section class="content">
      <div class="container-fluid">
        <div class="row">
          <div class="col-md-6">
            <div class="card">
              <div class="card-header">
                <h3 class="card-title">Post Mortem Report Upload </h3>
              </div>
              <!-- /.card-header -->
              <div class="card-body">
            
              @if ($message = Session::get('success'))

        <div class="alert alert-success alert-block">

            <button type="button" class="close" data-dismiss="alert">×</button>

                <strong>{{ $message }}</strong>

        </div>

        <img src="images/{{ Session::get('image') }}">

        @endif

        <form action="{{ route('image_store') }}" method="POST" enctype="multipart/form-data">

            @csrf
            
            <div class = "mb-3">

                <label class = "form-label" for = "inputImage">UD CASE :</label>

                <select  name = "case_no" class="form-control" id="case_no" required>
                
                    <option value =  ""  > Select UD CASE  </option>
                    
                    @foreach($form_5371 as $value2)
                    
                    <option value =  "{{$value2['ud_case_no']}}"  > {{$value2['ud_case_no']}} </option>
                    
                    @endforeach  
                
                </select>    

            </div>
            
            <div class = "mb-3" >

                <label class = "form-label" for = "inputImage" > Status :</label>

                <select  name = "status" class="form-control" id = "status" required>
                
                     <option value =  ""  > Select status </option>
                     <option value =  "1"   >  PM Done                 </option>
                     <!--<option value =  "2"  >  PM Done / Special Cases Started  </option>
                    -->
                </select>    

            </div>
            
              <div class = "mb-3" >

                <label class = "form-label" for = "inputImage" > Remarks :</label>

                 <textarea  name = "remarks" class="form-control" value = "" cols="50"></textarea>

            </div>
            
            
            <div class = "mb-3">

                <label class="form-label" for="inputImage">Image (Supported image types: jpeg,png,jpg,gif,svg):</label>

                <input 

                    type="file" 

                    name="image" 

                    id="inputImage"

                    class="form-control @error('image') is-invalid @enderror" required >

                @error('image')

                    <span class="text-danger">{{ $message }}</span>

                @enderror

            </div>
            
            <div class="mb-3">

                <button type="submit" class="btn btn-success">Submit</button>

            </div>
        
        </form>
        
              </div>
              <!-- /.card-body -->
              
            </div>
            <!-- /.card -->

           
            <!-- /.card -->
          </div>
          <!-- /.col -->
        
          <!-- /.col -->
        </div>
        <!-- /.row -->
       
        <!-- /.row -->
        <!-- /.row -->
        <!-- /.row -->
        <!-- /.row -->
      </div><!-- /.container-fluid -->
    </section>
    <!-- /.content -->
  </div>
@endsection