
<?php $__env->startSection('styles'); ?>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('title'); ?>
    Domain Authorization
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>

<!-- Begin Page Content -->
<div class="container">
    
    <div class="d-flex align-items-center p-3 my-3 text-white bg-primary rounded shadow-sm">
        <svg class="bd-placeholder-img flex-shrink-0 me-2 rounded" width="32" height="32" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: 32x32" preserveAspectRatio="xMidYMid slice" focusable="false"><title>Placeholder</title><rect width="100%" height="100%" fill="var(--white)"></rect><text x="50%" y="50%" fill="var(--white)" dy=".3em">32x32</text></svg>

        <div class="ml-2">
          <h1 class="h6 mb-0 text-white lh-1">Domain Authorization</h1>
          <small><a class="text-white" href="<?php echo e(url('admin/dashboard')); ?>">dashboard</a> > <a class="text-white" href="<?php echo e(url($prefix.'manage')); ?>">manage users</a> > domain authorization</small>
        </div>
    </div>
    <!-- Content Row -->
    <div class="row">
            <div class="col-sm-12">
                <div class="card mb-4 shadow">
                    <div class="card-body">
                        <div class="row">
                            <div class="col-sm-3"></div>
                            <div class="col-sm-6">
                                <div class="row">
                                    <div class="col-sm-12 mt-2 mb-4">
                                        <span>Domain Name : <a href="<?php echo e($data['link']); ?>"><?php echo e($data['link']); ?></a></span>
                                        <br>
                                        <h6>Authorized Users</h6>
                                        <?php $__currentLoopData = $data['authorization']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <?php if($item['authorization'] != 0): ?>
                                                <span class="badge badge-primary p-2 rounded"><a href="<?php echo e(url('admin/users/view?id=')); ?><?php echo e($item['authorized_user']['id']); ?>" class="text-white"><?php echo e($item['authorized_user']['name']); ?></a></span>&nbsp;
                                            <?php endif; ?>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </div>
                                </div>
                                <form action="<?php echo e(url($prefix.'authorization')); ?>" method="post"> 
                                    <?php echo csrf_field(); ?>
                                    <input type="hidden" name="domain_id" value="<?php echo e($data->id); ?>">
                                    <div class="form-group">
                                        <label class="small">User <span class="text-danger">*</span></label>
                                        <select name="user_id" class="form-control <?php $__errorArgs = ["user_id"];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>">
                                            <option value="">select user</option>
                                            <?php $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($user->id); ?>"><?php echo e($user->name); ?></option> 
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>
                                        <?php $__errorArgs = ['user_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="text-danger small"><?php echo e($message); ?></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?> 
                                    </div>
                                    <div class="form-group mt-3">
                                        <label class="small">Authorization <span class="text-danger">*</span></label>
                                        <select name="authorization" class="form-control <?php $__errorArgs = ["authorization"];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>">
                                            <option value="">select authorization</option>
                                            <option value="1">Authorized</option>
                                            <option value="0">Unauthorized</option>
                                        </select>
                                        <?php $__errorArgs = ['authorization'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="text-danger small"><?php echo e($message); ?></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?> 
                                    </div>
                                    <div class="text-right">
                                        <a class="btn btn-secondary text-uppercase font-weight-bold rounded pl-4 pr-4" href="<?php echo e(url($prefix.'manage')); ?>">Cancel</a>
                                        <button class="btn btn-primary text-uppercase font-weight-bold rounded pl-4 pr-4" type="submit">Update</button>
                                    </div>
                                </form>
                            </div>
                            <div class="col-sm-3"></div>
                        </div>
                    </div>
                </div>
                
            </div>
        </div>
        <small class="d-block text-end mt-3">
          
        </small>
      </div>
</div>

<?php $__env->stopSection(); ?>


<?php echo $__env->make('components.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/iserverkit/iservernew/resources/views/admin/domains/domain_authorization.blade.php ENDPATH**/ ?>