<?php $__env->startSection('content'); ?>
<div class="panel panel-default">
    <div class="panel-heading">Domains</div>
    

    <div class="panel-body">
    	
       	<form method="post" action="<?php echo e(route('domains.search')); ?>"  >
	    <input type="hidden" value="<?php echo e(csrf_token()); ?>" name="_token" />
	        <div class="form-group">
	            <label for="title">Search domain by name or customer:</label>
	            <input type="text" class="form-control" name="search" v/>
	        </div>
	         <button type="submit" class="btn btn-primary">search</button>
	     </form>

        <table class="table">
        <thead>
        	<tr>
        		<th>Domain</th>
        		<th>Registry</th>
        		<th>Expired</th>
        		<th>customer</th>
        		<th></th>
        	</tr>
        </thead>
			<?php $__currentLoopData = $domains; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $domain): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
				<tr <?php if( $domain->deleted_at != null ): ?> style="background-color: #f8d7da;"  <?php endif; ?>>
					
					<td>
						<a  href="<?php echo e(route('domains.show',$domain->id)); ?>"><?php echo e($domain->domain); ?></a>
					</td>
					<td>
						<?php echo e($domain->registry); ?>

					</td>
					<td>
						<?php echo e($domain->expiry_date); ?>

					</td>
					<td>
						<?php if( $domain->customer_id == 0 ): ?>
						<div style="color: red">Not linked to customer</div>
						<?php else: ?>
						<div style="color: green"><?php echo e($domain->customer->xero_name); ?></div>
						<?php endif; ?>
					</td>
					<td>
						<a  class="btn btn-primary" href="<?php echo e(route('domains.edit',$domain->id)); ?>">Edit</a>
					</td>
					
				</tr>
			<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
		</table>

		<?php echo $domains->render(); ?>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Users/joraleqyan/PhpstormProjects/xero/resources/views/domains/index.blade.php ENDPATH**/ ?>