@extends('layouts.layout')

@section('content')


<div class="form-group row add">
  <div class="container">
      @if(Session::has('success'))
        <div class="alert-box success">
          <h2>{!! Session::get('success') !!}</h2>
        </div>
      @endif
      <div class="form-group">
        <h2>Submit Ide Mahasiswa</h2>
        {!! Form::open(array('url'=>'laporanPegawai/uploadFiles','method'=>'POST', 'files'=>true)) !!}
        {!! Form::file('images[]', array('multiple'=>true)) !!}
          <p>{!!$errors->first('images')!!}</p>
          @if(Session::has('error'))
            <p>{!! Session::get('error') !!}</p>
          @endif
        {!! Form::submit('Submit', array('class'=>'btn btn-lg btn-primary col-md-4')) !!}
        {!! Form::close() !!}
      </div>
    </div>



    <br><br><br>
     
    <table class="table">
    <tr class="success">
    <th>No.</th>
    <th>Original FileName</th>
    <th>Actions</th>
    </tr>

    

    <?php $no=1; ?>

    @foreach($uploadp as $laporanPegawai)

    <tr>
    <td>{{$no++}}</td>
    <td>{{$laporanPegawai->original_filename}}</td>
   

    <td>
    <form class="" action="{{route('laporanPegawai.destroy', $laporanPegawai)}}" method="post">
    <input class="w3-btn" type="hidden" name="_method" value="delete">
    <input class="w3-btn" type="hidden" name="_token" value="{{ csrf_token() }}">
  

  
  
     
          
            
            <a href="uploadp/{{$laporanPegawai->original_filename}}" download="{{$laporanPegawai->original_filename}}">
              <button type="button" class="btn btn-primary"><span class="glyphicon glyphicon-user"></span>
                Download
              </i></button> 
            </a>
            
          
          
    
    

    <input type="submit" class="btn btn-danger" onclick="return confirm('Are you sure to delete this data');" name="name" value="delete">
    </form>
    </td>

    </tr>

    @endforeach

    </table>
   
    </div>



  @endsection