<div class="container community-invoice-container">	 
	 <div class="box">	 
		<div class="box-title">
        	 {!! Theme::section('user.purchase.menu',['page'=>'products']) !!}	
        </div>
		
		<div class="box-content">
			
			{!! Theme::section('theme/user.purchase.purchase-sub-menu',['subpage'=>'myreceived']) !!}
			
			<div class="invoice-lists-box">
			   	@if(count($invoices)>0)
					<div class="invoice-lists-tbl">
					 <table class="table table-bordered">
						<thead>
							<tr>
								<th style="width: 10%">Invoice No.</th>
								<th style="width: 10%">User</th>
								<th style="width: 10%">Invoice date</th>
								<th style="width: 10%">Due Date</th>
								<th style="width: 10%">Amount</th>
								<th style="width: 10%">Status</th>								
								<!--<th style="width: 10%">Action</th>-->
							</tr>
						</thead>
						<tbody>							
							@foreach($invoices as $invoice)
								<tr>
									<td><a class="view-invoice-link" href="{{URL::route('community-invoice-view',['slug'=>0,'id'=>$invoice->id])}}">{{$invoice->invoice_number}}</a></td>
									<td>
										@if($invoice->from_user)
											<?php
												$user=$invoice->from_user;
											?>
											   <div class="invoice-user-dtls-box">	
												   <a href="{{$user->present()->url()}}" data-ajaxify="true">
														<img src="{{$user->present()->getAvatar(100)}}" class="invoice-user-img"/>											  
														<p class="invoice-user-dtls">{!! $user->fullname !!}</p>
												   </a>
											   </div> 	   
										@endif
									</td>
									<td>{{date("M j, Y",strtotime($invoice->invoice_date))}}</td>
									<td>{{date("M j, Y",strtotime($invoice->due_date))}}</td>
									<td>${{number_format($invoice->total_amount, 2, '.', ',')}}</td>
									<td>
										@if($invoice->status==0) 
											<a class="brand-colored-texts" href="{{URL::route('community-invoice-view',['slug'=>0,'id'=>$invoice->id])}}">Pay Now</a> 
										@else 
											Paid 
										@endif
									</td>
									<!--<td></td>-->
								</tr>
							@endforeach
						</tbody>
					</table>
				   
					{!! $invoices->appends(request()->except('page'))->render() !!}
			      </div>
				@else
					<div class="no-invoice-found">No invoice received found.</div>
				@endif
			</div>	
		</div>	
	 </div>
</div>	

