<button type="button" class="btn btn-info btn-md" data-toggle="modal" data-target="#open_request_pro_{{ $row->request_id }}"> 
<span class="glyphicon glyphicon-list-alt" aria-hidden="true"></span> Open </button>

<!-- Modal -->
<div id="open_request_pro_{{ $row->request_id }}" class="modal fade" 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">Select User Access Options </h4>
</div>
<div class="modal-body">

		@if($row->organization_type == 'Consortia')
			{{ Form::open(array('url' => 'admin/useraccess/add')) }}

			@csrf()

			<input type="hidden" name="request_id" value="{{encrypt($row->request_id)}}"/>
			<input type="hidden" name="organization_type" value="{{$row->organization_type}}"/>
			<button type="submit" name="btn_add" value ="true" class="btn btn-primary btn-md" style="background-color:#009688;">
			<span class="glyphicon glyphicon-user" aria-hidden="true"></span> <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
			</button> Add User Access ({{$row->organization_type}}) <i>( Trial / Corporate / Token )</i>

			{{ Form::close() }}		
		@endif

											 
		{{ Form::open(array('url' => 'admin/useraccess/add')) }}

		@csrf()

		<input type="hidden" name="request_id" value="{{encrypt($row->request_id)}}"/>
		<button type="submit" name="btn_add" value ="true" class="btn btn-primary btn-md">
		<span class="glyphicon glyphicon-user" aria-hidden="true"></span> <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
		</button> Add User Access <i>( Trial / Corporate / Token / Disease )</i>


		{{ Form::close() }}		


		{{ Form::open(array('url' => 'admin/useraccess/view')) }}

		@csrf()

		<input type="hidden" name="request_id" value="{{encrypt($row->request_id)}}"/>
		<input type="hidden" name="org_name" value="{{$row->organization_name}}"/>

		<button type="submit" name="btn_view" value ="true" class="btn btn-danger btn-md" title="View User Access">
		<span class="glyphicon glyphicon-user" aria-hidden="true"></span> <span class="glyphicon glyphicon-trash" aria-hidden="true"></span>  
		</button> View/Delete User Access <i>( Trial / Corporate / Token / Disease )</i>
		{{ Form::close() }}		

		{{ Form::open(array('url' => 'admin/useraccess/edit')) }}

		@csrf()

		<input type="hidden" name="request_id" value="{{encrypt($row->request_id)}}"/>
		<input type="hidden" name="org_name" value="{{$row->organization_name}}"/>

		<button type="submit" name="btn_view_token" value ="true" class="btn btn-warning btn-md" title="Edit Token Access">
		<span class="glyphicon glyphicon-user" aria-hidden="true"></span> <span class="glyphicon glyphicon-time" aria-hidden="true"></span>  
		</button> Edit Token User Access 
		{{ Form::close() }}		
		
		{{ Form::open(array('url' => 'admin/useraccess/user_access_date')) }}

		@csrf()

		<input type="hidden" name="request_id" value="{{encrypt($row->request_id)}}"/>
		<input type="hidden" name="org_name" value="{{$row->organization_name}}"/>

		<button type="submit" name="btn_view_date" value ="true" class="btn btn-warning btn-md" title="Edit Access Date" style="background-color:#00bcd4;">
		<span class="glyphicon glyphicon-user" aria-hidden="true"></span> <span class="glyphicon glyphicon-edit" aria-hidden="true"></span>  
		</button> Edit User Access Date
		{{ Form::close() }}	
		
		<hr>
		<h4 class="modal-title">Select Request Options </h4>
		<hr>


	@if($deletePermission)
		<button type="button" class="btn btn-raised btn-danger btn-md" data-toggle="modal" data-target="#delete{{ $row->request_id }}" title="Revert Request">
		<span class="glyphicon glyphicon-file" aria-hidden="true"></span> <i class="livicon" data-name="undo" data-loop="true" data-color="#fff" data-hovercolor="white" data-size="16"></i> 
		</button> Revert Request back In Pending
		<!-- Modal -->
		<div class="modal fade" id="delete{{ $row->request_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>
			  <h3 class="modal-title text-danger">Confirmation</h3>
			</div>
			<div class="modal-body">
			  <p><strong>Are you sure you want to revert this record?</strong></p>
			</div>
			<div class="modal-footer">                                                    
			 {{ Form::open([ 'method'  => 'delete', 'route' => [ 'user_access.destroy', encrypt($row->request_id),'section=access_request_form','action=revert']]) }}
				{{ Form::submit('Yes', ['class' => 'btn btn-danger']) }}
				<button type="button" class="btn btn-primary" data-dismiss="modal">No</button>
			{{ Form::close() }} 
			</div>
		  </div>
		  
		</div>
		</div>
	@endif  
		
		<br><br>

		@if($editPermission)

		<button type="button" class="btn btn-raised btn-success btn-md" data-toggle="modal" data-target="#complete{{ $row->request_id }}"  title="Mark Complete">
		<span class="glyphicon glyphicon-file" aria-hidden="true"></span> <span class="glyphicon glyphicon-check" aria-hidden="true"></span>  
		</button> Mark Request as Completed

		<!-- Modal -->
		<div class="modal fade" id="complete{{ $row->request_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>
			  <h3 class="modal-title text-success">Confirmation</h3>
			</div>
			<div class="modal-body">
			  <p><strong>Are you sure you want mark this request completed?</strong></p>
			</div>
			<div class="modal-footer">                                                    
			 {{ Form::open([ 'method'  => 'delete', 'route' => [ 'user_access.destroy', encrypt($row->request_id),'section=access_request_form','action=complete']]) }}
				{{ Form::submit('Yes', ['class' => 'btn btn-danger']) }}
				<button type="button" class="btn btn-primary" data-dismiss="modal">No</button>
			{{ Form::close() }} 
			</div>
		  </div>
		  
		</div>
		</div>                                                

		@endif 

</div>

<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>

</div>
</div>
