<?php $__env->startSection('title','Branches & Franchise'); ?>
<?php $__env->startSection('content'); ?>
<div class="page-head"><div><h1 class="page-title">Branches & Franchise</h1><div class="page-subtitle">Multiple branch setup, HO control and branch users</div></div></div>

<form method="POST" action="<?php echo e(route('admin.branches.store')); ?>" class="card panel-tight grid-3"><?php echo csrf_field(); ?>
<div><label>Name</label><input name="name" required></div><div><label>Code</label><input name="code" required></div><div><label>Type</label><select name="type"><option>Head Office</option><option>Branch</option><option>Franchise</option><option>Central Warehouse</option></select></div>
<div><label>Address</label><input name="address"></div><div><label>Phone</label><input name="phone"></div><div><label>Email</label><input name="email"></div>
<div><label>Manager</label><input name="manager_name"></div><div><label>Invoice Prefix</label><input name="invoice_prefix"></div><div><label>Status</label><select name="status"><option>Active</option><option>Inactive</option></select></div>
<div><label><input type="checkbox" name="is_head_office" value="1"> Head Office Control</label></div><div><label><input type="checkbox" name="is_central_warehouse" value="1"> Central Warehouse</label></div>
<div class="form-actions" style="grid-column:1/-1"><button class="btn primary">Save Branch</button><a href="<?php echo e(route('admin.branches.stocks')); ?>" class="btn">Branch Stock</a><a href="<?php echo e(route('admin.branches.performance')); ?>" class="btn">Branch Performance</a></div>
</form>
<div class="card panel-tight table-wrap"><table class="table"><thead><tr><th>Name</th><th>Code</th><th>Type</th><th>Invoice Prefix</th><th>Status</th><th>Action</th></tr></thead><tbody><?php $__empty_1 = true; $__currentLoopData = $branches; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $branch): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?><tr><td><?php echo e($branch->name); ?></td><td><?php echo e($branch->code); ?></td><td><?php echo e($branch->type); ?></td><td><?php echo e($branch->invoice_prefix ?: '—'); ?></td><td><?php echo e($branch->status); ?></td><td><details><summary class="btn">Edit</summary><form method="POST" action="<?php echo e(route('admin.branches.update',$branch)); ?>" class="grid-3" style="margin-top:10px"><?php echo csrf_field(); ?> <?php echo method_field('PUT'); ?><div><label>Name</label><input name="name" value="<?php echo e($branch->name); ?>"></div><div><label>Code</label><input name="code" value="<?php echo e($branch->code); ?>"></div><div><label>Type</label><input name="type" value="<?php echo e($branch->type); ?>"></div><div><label>Address</label><input name="address" value="<?php echo e($branch->address); ?>"></div><div><label>Phone</label><input name="phone" value="<?php echo e($branch->phone); ?>"></div><div><label>Email</label><input name="email" value="<?php echo e($branch->email); ?>"></div><div><label>Manager</label><input name="manager_name" value="<?php echo e($branch->manager_name); ?>"></div><div><label>Invoice Prefix</label><input name="invoice_prefix" value="<?php echo e($branch->invoice_prefix); ?>"></div><div><label>Status</label><select name="status"><option value="Active" <?php if($branch->status==='Active'): echo 'selected'; endif; ?>>Active</option><option value="Inactive" <?php if($branch->status==='Inactive'): echo 'selected'; endif; ?>>Inactive</option></select></div><div><label><input type="checkbox" name="is_head_office" value="1" <?php if($branch->is_head_office): echo 'checked'; endif; ?>> Head Office</label></div><div><label><input type="checkbox" name="is_central_warehouse" value="1" <?php if($branch->is_central_warehouse): echo 'checked'; endif; ?>> Central Warehouse</label></div><div class="form-actions" style="grid-column:1/-1"><button class="btn primary">Update</button></div></form><form method="POST" action="<?php echo e(route('admin.branches.destroy',$branch)); ?>" style="margin-top:8px"><?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?><button class="btn btn-danger" onclick="return confirm('Delete this branch?')">Delete</button></form></details></td></tr><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?><tr><td colspan="6">No branches found.</td></tr><?php endif; ?></tbody></table><?php echo e($branches->links()); ?></div>

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

<?php echo $__env->make('admin.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH J:\xampp\htdocs\pos\resources\views/admin/branches/index.blade.php ENDPATH**/ ?>