@extends('adminlte::page')
@section('title','Importer')

@section('content_header')
<div class="container">
<h3 align="center" class="m-0 text-white" id="importer">Importer proizvoda iz Excel fajlova</h3>
<br>
@if(count($errors) > 0)
    <div class="alert alert-danger">
        Greška!<br><br>
        <ul>
            @foreach($errors->all() as $error)
                <li>{{ $error }}</li>
            @endforeach
        </ul>
    </div>
@endif
@if($message = Session::get('success'))
    <div class="alert alert-success alert-block">
        <button type="button" class="close" data-dismiss="alert">X</button>
        <strong>{{ $message }}</strong>
    </div>
@endif

{{-- <form method="post" enctype="mltipart/form-data" action="{{ url('admin/importer/import')}}">
    {{ csrf_field() }}
    <div class="form-group">
        <table class="table">
            <tr>
                <td width="40%" align="right">
                    <label>Select file for upload</label>
                </td>
                <td>
                    <input type="file" name="select_file" />
                </td>
                <td width="30%" align="left">
                    <input type="submit" name="upload" class="btn btn-primary" value="Upload" />
                </td>
            </tr>
            <tr>
                <td width="40%" align="right"></td>
                <td width="30%">
                    <span class="text-muted">.xls, .xslx</span>
                </td>
                <td width="30%" align="left"></td>
            </tr>
        </table>
    </div>
</form> --}}

{!! Form::open(array(
    'url' => "/admin/importer/import",
    'method' => 'post',
    'class' => 'form-horizontal',
    'id' =>'categories-form',
    'role'=>'form',
    'files'=>'true',
    )) !!}

    {{ csrf_field() }}
    <div class="form-group">
        <table class="table">
            <tr>
                <td width="40%" align="right">
                    {!! Form::label( 'Opload file') !!}
                </td>
                <td>
                    {!! Form::file( 'select_file') !!}
                </td>
                <td width="30%" align="left">
                    {!! Form::submit(Lang::get('Upload'), array('class' => 'btn btn-success')) !!}
                    {!!Form::close()!!}
                </td>
            </tr>
            <tr>
                <td width="30%" align="right"></td>
                <td width="30%">
                    <span class="text-muted">podržani formati: .xls, .xslx</span>
                </td>
                <td width="30%" align="left"></td>
            </tr>
        </table>
    </div>




</div>
<style>
    #importer{
        background: #1ca3e7;
        padding: 10px;
    }
</style>


@stop