<?php $__env->startSection('content'); ?>
<?php Fun::lang() ?>
<div class="title-add">
    <div class="page-bar">
        <ul class="page-breadcrumb">
            <li> <a class="ng-binding" href="#"><i class="fa fa-dashboard"></i> Dashboard</a> </li>
            <li><a href="#">Manage User</a></li>
            <li><a href="#">Branchs Infomation</a></li>
        </ul>
    </div>
</div>
<div class="page">
    <div class="top-content">
        <div class="row">
            <div class="col-sm-12 col-xs-12">
                <div class="title-add">
                    <div class="pull-left">
                        <h3>Branch Infomation</h3>
                        <p><span class="text-danger"><strong>NOTE</strong><sup>*</sup> you have to buyed <strong><?php echo e($buyed); ?></strong> Branches</span></p>
                    </div>
                </div>
                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Branch-Create')): ?>
                    <div class="pull-right">
                        <a href="<?php echo e(route('branches.create')); ?>" class="button_primary button_sm"><span class="fa fa-plus"></span> Create New</a>
                    </div>
                <?php endif; ?>
            </div>
        </div>
    </div>
    <div class="form-wrapper">
        <table id="datatable" class="table  table-bordered table-hover nowrap">
            <thead>
                <tr>
                    <th>No</th>
                    <th>Branch EN</th>
                    <th>Branch KM</th>
                    <th>Logo</th>
                    <th>Type</th>
                    <th>Phone</th>
                    <th>Email / Website</th>
                    <th>Address</th>

                    <th>Action</th>
                </tr>
            </thead>
            <tbody>
                <?php $__currentLoopData = $branches; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr>
                    <td><?php echo e($key+1); ?></td>
                    <td><?php echo e($value->branch_en); ?></td>
                    <td><?php echo e($value->branch_kh); ?></td>
                    <td><img src='<?php echo e(asset("assets/images/resize")); ?>/<?php echo e($value->branch_img); ?>' width="80px"></td>
                    <td><?php if($value->key_code != ''): ?> <strong class="text-success">
                            <i class="fa fa-university" aria-hidden="true"></i>
                            Company</strong> <?php else: ?> <strong class="text-success">
                            <i class="fa fa-home" aria-hidden="true"></i>
                            Branch</strong> <?php endif; ?></td>
                    <td><?php echo e($value->branch_phone); ?></td>
                    <td><?php echo e($value->branch_email); ?></td>
                    <td><?php echo e($value->branch_address); ?></td>
                    <td>
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Branch-Edit')): ?>
                            <a data-toggle="tooltip" data-placement="top" title="Edit Branch" href="<?php echo e(route("branches.edit", Crypt::encrypt($value->id))); ?>"> <span class="button_success fa fa-edit" </span> </a> 
                        <?php endif; ?> 
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Branch-View-Info')): ?> 
                            <a data-toggle="tooltip" data-placement="top" title="Show Branch" href="<?php echo e(route("branches.show", Crypt::encrypt($value->id))); ?>"> <span class="button_info fa fa-eye"></span> </a>
                        <?php endif; ?>
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Branch-Assign-Branch')): ?>
                            <?php if($value->status == 1): ?>
                                <a data-toggle="tooltip" data-placement="top" title="Assign Branch" href="<?php echo e(route("assign.branch", Crypt::encrypt($value->id))); ?>"> <span class="button_primary btn-sm fa fa-plus"></span> </a>
                            <?php endif; ?>
                        <?php endif; ?>
                    </td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </tbody>
        </table>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('adminlte::page', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>