@extends('admin/layouts/default')
{{-- Page title --}}
@section('title')
Full Issue Purchase List
@parent
@stop
{{-- page level styles --}}
@section('header_styles')
<!--page level css -->
<link href="{{ asset('assets/css/pages/tables.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('assets/vendors/select2/css/select2.min.css') }}" type="text/css" rel="stylesheet">
<link href="{{ asset('assets/vendors/select2/css/select2-bootstrap.css') }}" rel="stylesheet">
<!--end of page level css-->
@stop
{{-- Page content --}}
@section('content')
<section class="content-header">
    <!--section starts-->
    <h1>Full Issue Purchase List</h1>
    <ol class="breadcrumb">
        <li>
            <a href="{{ route('admin.dashboard') }}">
            <i class="livicon" data-name="home" data-size="18" data-loop="true"></i>
            Dashboard
            </a>
        </li>
        <li class="active">Full Issue Purchase List</li>
    </ol>
</section>
<!--section ends-->
<section class="content">
    <div class="row">
        <div class="col-md-12">

            <!-- BEGIN SAMPLE TABLE PORTLET-->
            <div class="portlet box primary">
                <div class="portlet-title">
                    <div class="caption">
                        <i class="livicon" data-name="responsive" data-size="16" data-loop="true" data-c="#fff" data-hc="white"></i>
                        Issue Purchase List 
                    </div>
                </div>
                <div class="portlet-body table-responsive">
        {{ Form::open(array('url' => 'admin/web_form_report/issuepurchase')) }}
            <input type="hidden" name="_token" value="{{csrf_token()}}">
				   
                        <div class="col-md-6">
						@include('search.journal_search')
                        </div>
                        <div class="form-group col-md-3">
						@include('search.volume_search')
                        </div>
                        <div class="form-group col-md-3">
                        @include('search.issue_search')
                        </div>
                        <div class="form-group col-md-3">
                        <label class="control-label" for="select21">User Email:</label>
                        <input type="text" name="user_email" class="form-control" value="{{ old('user_email') }}" />
                        </div>

                        <div class="form-group col-md-3">
                        <label class="control-label" for="select21">Status:</label>
                            <select name="status" class="form-control">
                                <option title="All" value="" selected="selected">All</option>
                                <option title="Completed" value="C" @if(old('status') == "C" || request('status') == "C") {{ 'selected' }} @endif>Completed</option>
                                <option title="Fail" value="F" @if(old('status') == "F" || request('status') == "F") {{ 'selected' }} @endif>Cancel</option>
                                <option title="In Process" value="P" @if(old('status') == "I" || request('status') == "I") {{ 'selected' }} @endif>In-Process</option>
                            </select>
                        </div>

						<div class="form-group col-md-6">
                        <label class="control-label" for="select21">Action:</label><br />
							<button type="submit" class="btn btn-primary" name="frm_search" value ="true">
								<span class="glyphicon glyphicon-search"></span>  Search
							</button>
							<a href="{{ URL::to('admin/web_form_report/issuepurchase') }}"  id="btn_reset" class="btn btn-default">Reset</a>
						</div>
                        
						
                    {{ Form::close() }}
                    <br>
                    <table class="table table-striped table-bordered" id="article_table">
                        <thead>
                            <tr>
                                <th>Order ID</th>
                                <th>Journal</th>
                                <th>Volume</th>
                                <th>Issue</th>
                                <th>User Email</th>
                                <th>Price</th>
                                <th>Status</th>
                            </tr>
                        </thead>
                        <tbody>
                            @if (count($issue_order) > 0)
                            @foreach($issue_order as $key => $value)
                            <tr>
                                <td>{{ $value->inquiry_id }}</td>
                                <td>{!! $value->title !!}</td>
                                <td>{{ $value->volume }}</td>
                                <td>{{ $value->issue }}</td>
                                <td>{{ $value->email }}</td>
                                <td>{{ $value->amount }}</td>
                                <td>
                                    @if($value->status == "C") Completed @endif
                                    @if($value->status == "F" || $value->status == "X") Cancel @endif
                                    @if($value->status == "P") In-Process @endif
                                </td>
                            </tr>
                            @endforeach
                            @else
                            <tr>
                                <td colspan="7">
                                    <center>Empty</center>
                                </td>
                            </tr>
                            @endif
                        </tbody>
                    </table>
                    @if (count($issue_order) > 0)
                    <center>{{ $issue_order->appends(request()->input())->links() }}</center>
                    @endif
                </div>
            </div>
            <!-- END SAMPLE TABLE PORTLET-->
        </div>
    </div>
</section>
@stop

{{-- page level scripts --}}
@section('footer_scripts')
<script src="{!! asset('assets/vendors/select2/js/select2.js') !!}"></script>    
<script src="{!! asset('js/filter.js') !!}"></script>
<script>

$(document).ready(function(){
    
    $('#journal_id').removeAttr('required');
    $('#volume_id').removeAttr('required');
    $('#issue_id').removeAttr('required');

    $("#journal_id").select2({
        theme:"bootstrap",
        placeholder:"Select Journal",
        width: '100%',
        height: '50px'
    });
    $("#volume_id").select2({
    	theme:"bootstrap",
    	placeholder:"Select Volume",
    	width: '100%',
    	height: '50px'
    });    		
    $("#issue_id").select2({
        theme:"bootstrap",
        placeholder:"Select Issue",
        width: '100%',
        height: '50px'
    });     
});    
</script>
@stop