@extends('admin/layouts/default')

{{-- Page title --}}
@section('title')
articles
@parent
@stop

{{-- page level styles --}}
@section('header_styles')

    <!-- end of page level css-->
@stop

{{-- Page content --}}
@section('content')
<section class="content-header">
    <!--section starts-->
    <h1>article</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">article 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>
                                    article List 
                                </div>							<a class="btn btn-sm btn-default button-alignment pull-right mb-1" title="Add article" href="{{ URL::to('admin/articles/add') }}">
								<span class="glyphicon glyphicon-plus"></span> New</a>
                            </div>
                            <div class="portlet-body table-responsive">
                                <table class="table table-striped table-bordered" id="article_table">
                                    <thead>
                                        <tr>
                                            <th>Code</th>
											<th>title</th>																					
											<th>uploaded by</th>
                                            <th class="numeric">Abstract</th>											
                                            <th width="15%" class="numeric">Action</th>
                                        </tr>
                                    </thead>
                                    <tbody>
									@foreach($article as $key => $value)
                                        <tr>
                                            <td>{{ $value->article_id }}</td>										
                                            <td>{{ $value->title }}</td>											
											<td>{{ $value->is_uploaded }}</td>
											<td class="numeric">{{ $value->abstract }}</td>                                            
                                            <td class="numeric">
																								<a href="{{ URL::to('admin/articles/' . $value->article_id. '/edit') }}" class="btn default btn-xs purple">
                                                        <i class="livicon" data-name="pen" data-loop="true" data-color="#fff" data-hovercolor="White" data-size="14"></i>
                                                        Edit
                                                    </a>  
													
                                                    <!-- <a href="{{ URL::to('admin/article/' . $value->article_id. '/destroy') }}" class="btn btn-danger">
                                                    <i class="livicon" data-name="trash" data-loop="true" data-color="#000" data-hovercolor="black" data-size="14"></i>
                                                        Delete
                                                    </a> -->
													
													
													<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#{{ $value->article_id}}"><i class="livicon" data-name="trash" data-loop="true" data-color="#000" data-hovercolor="black" data-size="14"></i>DELETE</button>
														<!-- Modal -->
													  <div class="modal fade" id="{{ $value->article_id}}" role="dialog">
														<div class="modal-dialog">
														
														  <!-- Modal content-->
														  <div class="modal-content">
															<div class="modal-header">
															  <button type="button" class="close" data-dismiss="modal">&times;</button>
															  <h4 class="modal-title">Warning</h4>
															</div>
															<div class="modal-body">
															  <p>Do you really want to delete valume: {{ $value->article_id }}</p>
															</div>
															<div class="modal-footer">													  
															 <form method="POST" action="{{ route('article.destroy', $value->article_id) }}">
																@csrf
																<input name="_method" type="hidden" value="DELETE">
																<input name="id" type="hidden" value="{{$value->article_id}}">
																<input class="btn btn-danger" type="submit" value="Delete">
																<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
															</form> 
															
														
															
															</div>
														  </div>
														  
														</div>
													  </div>
											</td>
                                        </tr>
										@endforeach
										
                                    </tbody>
                                </table>
								<center>{{ $article->links() }}</center>
								

                            </div>
                        </div>
                        <!-- END SAMPLE TABLE PORTLET-->
                    </div>
                </div>
            </section>

@stop
{{-- page level scripts --}}
@section('footer_scripts')
@stop
