@extends('layouts')

@section('title')
    Sample File
@endsection

@section('content')

    <section class="content-header">
    </section>
    <!-- Small boxes (Stat box) -->
    <section class="content">

        <div class="box box-warning">
            <div class="box-header">
                <h3 class="box-title">AMR: Sample File</h3>
            </div>
            <div class="box-body">

            
                <div class="row">
                    <form method="GET" action="{{ route('sample_file') }}">
                        <div class="col-sm-4 col-md-2">
                            <div class="form-group has-feedback">
                                <label>Gender:</label>
                                <select class="form-control" name="gender">
                                    <option {{ ($sex == "All")? 'selected' : '' }} value="all">All</option>
                                    <option {{ ($sex == 'M')? 'selected' : '' }} value="M">Male</option>
                                    <option {{ ($sex == 'F')? 'selected' : '' }} value="F">Female</option>
                                    <option {{ ($sex == 'UNK')? 'selected' : '' }} value="UNK">Unknown</option>
                                </select>
            
                                @if ($errors->has('gender'))
                                    <span class="text-danger">
                                        <strong>{{ $errors->first('gender') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>
                        <div class="col-sm-4 col-md-2">
                            <div class="form-group has-feedback">
                                <label>Year:</label>
                                <select class="form-control" name="date">
                                    <option value="all">All</option>
                                    @foreach ($data as $item)
                                    <option {{ ($item->year == $date)? 'selected' : '' }}>{{ $item->year }}</option>
                                    @endforeach
                                </select>
            
                                @if ($errors->has('username'))
                                    <span class="text-danger">
                                        <strong>{{ $errors->first('username') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>                        
                        <!-- /.col -->
                        <div class="col-sm-2 col-md-1" style="margin-top: 23px">
                            <button type="submit" class="btn btn-primary btn-block btn-flat">Search</button>
                        </div>
                        <!-- /.col -->
                    </form>
                    </div>

                <div style="overflow-x:auto;">
                <table id="example1" class="table table-bordered table-striped table-responsive">
                    <thead>
                    <tr>
                        <th>COUNTRY</th>
                        <th>YEAR</th>
                        <th>SPECIMEN</th>
                        <th>GENDER</th>
                        <th>ORIGIN</th>
                        <th>AGEGROUP</th>
                        <th>NUMSAMPLEDPATIENTS</th>
                        <th>BATCHID</th>
                    </tr>
                    </thead>
                    <tbody>
                        @foreach($sample_file as $sample_file )
                            <tr>
                                <td> NP </td>
                                <td>{{ $sample_file->year }}</td>
                                <td>{{ $sample_file->specimen }}</td>
                                <td>{{ $sample_file->sex }} </td>
                                <td> UNK </td>
                                <td>{{ $sample_file->age }}</td>
                                <td>{{ $sample_file->value }}</td>
                                <td> DS1 </td>
                            </tr>
                        @endforeach
                    </tbody>
                </table>
                </div>
            </div>
            <!-- /.box-body -->
        </div>

    </section>
@endsection