@extends('queuesharedhost::backend.layouts.app')   
@section('content')
 
 
<h2>Queue for Shared Hosting</h2>
<p>
	Laravel queue requires
	<code>queue:work</code>
	to run as daemon. But on shared hosting environment, you cannot do that
	easily. This app set schedule to execute
	<code>queue:work --sansdaemon</code>
	to deliver queue jobs. That means queue jobs will not run immediatly
	but will be delayed until scheduled time.
</p>
<p>
	If you are able to SSH to server and run
	<code>queue:work</code>
	as daemon, you can disable QueueSharedHost on Manage apps.
</p>

<h2>Pending Jobs</h2>

 <table class="table table-bordered" id="items-table">
	<thead>
		<tr>
			<th>queue</th>
			<th>payload</th>
			<th>attempts</th>
			<th>reserved_at</th>
		</tr>
	</thead>

	<tbody> 
		@if (isset($jobs)) 
    		@foreach ($jobs as $job)
    		<tr id="tr_{{ $job->id }}">
    			<td class="item_queue_name">{{ $job->queue }}</td>
    			<td class="item_queue_xx">{{ $job->payload }}</td>
    			<td>{{$job->attempts}}</td>
    			<td>{{$job->reserved_at}}</td>
    		</tr> 
    		@endforeach 
		@endif
	</tbody>
</table>

<!-- Create Item Modal -->
<div id="createItemModal" class="uk-modal" aria-hidden="true"
	style="display: none; overflow-y: scroll;">
	<div class="uk-modal-dialog">
		<button type="button" class="uk-modal-close uk-close"></button>
		<div class="uk-modal-header">
			<h2>CREATE Item (AJAX)</h2>
			@include('includes.partials.ajax_messages')

			<div id="create-item-raise-message">

				<div class="alert alert-danger">
					<button type="button" class="close" data-dismiss="alert"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					error msg

				</div>

				<div class="alert alert-success">
					<button type="button" class="close" data-dismiss="alert"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					success msg
				</div>

			</div>



		</div>
		<p>{!! Form::open(['route' =>
			['admin.queuesharedhost.queuesharedhost.store'], 'id' =>
			'create_item_form', 'method' => 'post']) !!}
			@include('queuesharedhost::backend.queuesharedhost.includes.formmodel')
		</p>
		<div class="uk-modal-footer uk-text-right">
			<button type="button" class="uk-button uk-modal-close">Cancel</button>
			<button type="button" id="crud-submit-create-btn"
				class="uk-button uk-button-primary crud-submit-create">Save</button>
		</div>
		{!! Form::close() !!}
	</div>
</div>

<!-- Edit Item Modal -->
<div id="editItemModal" class="uk-modal" aria-hidden="true"
	style="display: none; overflow-y: scroll;">
	<div class="uk-modal-dialog">
		<button type="button" class="uk-modal-close uk-close"></button>
		<div class="uk-modal-header">
			<h2>Update Item (AJAX)</h2>
			@include('includes.partials.ajax_messages')

			<div id="create-item-raise-message">

				<div class="alert alert-danger">
					<button type="button" class="close" data-dismiss="alert"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					error msg

				</div>

				<div class="alert alert-success">
					<button type="button" class="close" data-dismiss="alert"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					success msg
				</div>

			</div>

		</div>
		<p>{!! Form::open(['route' =>
			['admin.queuesharedhost.queuesharedhost.update','itemid'],'id' =>
			'update_item_form', 'method' => 'post']) !!}
			@include('queuesharedhost::backend.queuesharedhost.includes.formmodel')
		</p>
		<div class="uk-modal-footer uk-text-right">
			<button type="button" class="uk-button uk-modal-close">Cancel</button>
			<button type="button" id="crud-submit-update-btn"
				class="uk-button uk-button-primary crud-submit-update">Update</button>
		</div>
		{!! Form::close() !!}
	</div>
</div>

@endsection
