@extends('admin.admin-master') 
@section('content')
<div>&nbsp; </div>
@if (Session::has('message'))
<span class="alert {{Session::get('class')}}">
    {{Session::get('message')}}
</span>
@endif
<div>&nbsp; </div>
<h3><i class="fa fa-file-image-o"></i> Media Manager </h3>
<div>&nbsp; </div>
<div class="col-md-12">
    <div class="row">
        <div class="col-md-6">
            <!-- Form Name -->
            {{Form::open(array('url'=>'/admin/save-media-files',
                    'class'=>'form-horizontal',
                    'id'=>'add_media_form',
                    'method'=>'POST',
                    'enctype'=>'multipart/form-data'
                    ))}}
            <div class="control-group">
                <label class="control-label" for="textinput"> Upload files  :  </label>
                {{Form::file('file',array('class'=>'filestyle','data-buttonText'=>'Find file','data-size'=>'sm'))}}
            </div>
            <div class="clearfix">&nbsp;</div>
            <div class="clearfix">&nbsp;</div>
            <!-- Button -->
            {{Form::button('Reset',array('type'=>'reset','class'=>'btn btn-sm btn-default'))}}
            {{Form::button('<i class="fa fa-cloud-upload"></i> Upload ',array('type'=>'button','class'=>'btn btn-sm btn-info','id'=>'save_file'))}}
            <span id="page_loader"></span>
            {{Form::close()}}
            <!--//  End form -->
        </div>
        <div class="col-md-6">
            <div>&nbsp;</div>
        </div>
    </div>
</div>

<div>&nbsp;</div>
<div class="visible-sm visible-xs clearfix">&nbsp;</div>
<div class="hidden-sm hidden-xs">&nbsp;</div>
<div class="col-md-12">
    <h3>File List</h3>
    <table class="table table-responsive table-condensed">
        <tr>
            <th nowrap> File name </th>
            <th nowrap class="hidden-sm hidden-xs"> File type </th>
            <th nowrap class="hidden-sm hidden-xs"> Uploaded at </th>
            <th nowrap> Action </th>
        </tr>
        @foreach($files as $f)
        <tr>
            <td> <img style="cursor: pointer;" class="img-responsive img-gal" src="{{url()}}/public/media/{{$f->file_name}}" width="12%">  </td>
            <td class="hidden-sm hidden-xs"> {{$f->file_type}}  </td>
            <td class="hidden-sm hidden-xs"> {{$f->uploaded_at}}  </td>
            <td> <button class="btn btn-danger btn-sm delete-file" id="delete-file" file_name="{{$f->file_name}}" data-toggle="tooltip" data-placement="bottom" title="Delete file" type="button"><i class="fa fa-close"></i></button> </th>
        </tr>
        @endforeach
    </table>
    <center>{{$files->links()}}</center>
</div>
<div class="hidden-sm hidden-xs">&nbsp;</div>
<hr>

@stop
