 <?php $__env->startSection('content'); ?>
<div class="modal fade bs-modal-lg" id="form-modal-create-zone" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-dm modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                <h3>Create House Number</h3>
            </div>
            <br />
            <form class="form-horizontal" role="form" action="<?php echo e(route('construction.store_house_number')); ?>" method="post">
                <?php echo csrf_field(); ?>
                <div class="row col-sm-12">
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="col-sm-2 required control-label">Name</label>
                            <div class="col-sm-9">
                                <?php echo Form::text('name',null,array('placeholder'=>'Name','class'=>'form-control','required')); ?>

                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" data-dismiss="modal" class="button_danger"><i class="fa fa-close"></i> No</button>
                    <button type="submit" class="button_success" data-toggle="modal"><i class="fa fa-save"></i> Save</button>
                </div>
            </form>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<style>
    .modal-lg {
        width: 800px;
    }
</style>
<div class="modal fade bs-modal-lg" id="form-modal-edit-zone" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-dm modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                <h3>Edit House Number</h3>
            </div>
            <br />
            <form class="form-horizontal" role="form" action="<?php echo e(route('construction.update_house_number')); ?>" method="POST">
                <?php echo csrf_field(); ?>
                <div class="row col-sm-12">
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="col-sm-2 required control-label">Name</label>
                            <div class="col-sm-9">
                                <input type="hidden" name="id" id="zone-id">
                                <?php echo Form::text('name',null,array('placeholder'=>'Name','class'=>'form-control','required','id'=>"zone-name")); ?>

                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" data-dismiss="modal" class="button_danger"><i class="fa fa-close"></i> No</button>
                    <button type="submit" class="button_success" data-toggle="modal"><i class="fa fa-save"></i> Save</button>
                </div>
            </form>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<style>
    .modal-lg {
        width: 800px;
    }
</style>
<?php Fun::lang()?>
<div class="title-page">
    <div class="page-bar">
        <ul class="page-breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> Dashboard</a></li>
            <li><a href="#">Construction</a></li>
            <li><a href="#">Set Up Information</a></li>
            <li><a href="#">House Number</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-page">
                        <div class="pull-left">
                            <h3>House Number List</h3>
                        </div>
                    </div>
                    <div class="pull-right">
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Construction-Zone-Create')): ?>
                        <a class="button_sm button_primary" href="#form-modal-create-zone" data-toggle="modal"><span class="fa fa-plus"></span>  Create New</a>
                        <?php endif; ?>
                    </div>
                </div>
            </div>
        </div>
        <div class="box-body table-responsive">
                        
            <table id="datatable_warehouse" width="100%" class="table table-striped table-bordered table-hover nowrap">
                <thead>
                    <tr>
                        <th>NO</th>
                        <th>Name</th>
                        <th>Action</th>
                    </tr>
                </thead>
                <tbody>
                   <?php $__currentLoopData = $data; $__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->name); ?></td>
                        <td>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Construction-Zone-Edit')): ?>
                            <button class="btn btn-sm btn-primary" onclick="edit(<?php echo e($value->id); ?>,'<?php echo e($value->name); ?>')"><span class="fa fa-edit"></span></button>
                            <?php endif; ?>
                        </td>
                    </tr>
                   <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>

        </div>
    </div>
    <?php $__env->stopSection(); ?>
    <?php $__env->startSection('js'); ?>
    <script type="text/javascript">
            function edit(id,name)
            {
                $("#form-modal-edit-zone").modal('show');
                $("#zone-id").val(id);
                $("#zone-name").val(name);
            }
            $(document).ready(function() {
                var table = $('#datatable_warehouse').DataTable();

                $.fn.dataTable.ext.errMode = 'throw';
            });
    </script>
    
    <?php $__env->stopSection(); ?>
<?php echo $__env->make('adminlte::page', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>