
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css">
    <title>Share</title>

    <!-- Bootstrap -->
    
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.2/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>

    <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'=>'upload/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>
     <a href="{{route('admin')}}">Back</a><br>
    <table class="table table-striped">
    <tr>
    <th>No.</th>
    <th>Original FileName</th>
    <th>Actions</th>
    </tr>

    

    <?php $no=1; ?>

    @foreach($uploads as $upload)

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

    <td>
    <form class="" action="{{route('upload.destroy', $upload->id)}}" 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="uploads/{{$upload->original_filename}}" download="{{$upload->filename}}">
              <button type="button" class="btn btn-primary"><i class="glyphicon glyphicon-download">
                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>
   

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
  </body>
</html>
