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

<div class="row">
    <div class="col-sm-3">
        <?php echo $__env->make('sidebar', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    </div>
    <div class="col-sm-9">
        <div class="row">
            <div class="col-sm-12 add-container">
                <form action="/countyassembly/save" method="post" class="add-form">
                    <div class="container">
                        <div class="row">
                            <?php echo csrf_field(); ?>
                            <?php if($errors->any()): ?>
                            <div class="alert alert-danger" role="alert">
                                Please fix the following errors
                            </div>
                            <?php endif; ?>
                            <?php if($selectedCountyassembly != null): ?>
                            <input type="hidden" id="selected_countyassembly" name="selected_countyassembly" value="<?php echo e($selectedCountyassembly->county_assembly_id); ?>" />
                            <?php endif; ?>
                            <div class="col-sm-9">
                                <div class="form-group">
                                    <label for="county_assembly_name">County Assembly Name</label>
                                    <input type="text" class="form-control <?php $__errorArgs = ['county_assembly_name'];
$__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); ?>" id="county_assembly_name" name="county_assembly_name" placeholder="Name" value="<?php if($selectedCountyassembly != null): ?><?php echo e($selectedCountyassembly->county_assembly_name); ?><?php else: ?><?php echo e(old('county_assembly_name')); ?><?php endif; ?>">
                                    <?php $__errorArgs = ['county_assembly_name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="invalid-feedback"><?php echo e($message); ?></div>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="col-sm-9">
                                <div class="form-group">
                                    <label for="county_assembly_code">County Assembly Code</label>
                                    <input type="text" class="form-control <?php $__errorArgs = ['county_assembly_code'];
$__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); ?>" id="county_assembly_code" name="county_assembly_code" placeholder="County Assembly Code" value="<?php if($selectedCountyassembly != null): ?><?php echo e($selectedCountyassembly->county_assembly_code); ?><?php else: ?><?php echo e(old('county_assembly_code')); ?><?php endif; ?>">
                                    <?php $__errorArgs = ['countyassembly_code'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="invalid-feedback"><?php echo e($message); ?></div>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="col-sm-9">
                                <div class="form-group">
                                    <label for="county">County</label>
                                    <select class="form-control <?php $__errorArgs = ['county'];
$__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); ?>" id="county_id" name="county_id">
                                        <option value="">Select County</option>
                                        <?php $__currentLoopData = $counties; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $county): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <?php if($selectedCountyassembly != null): ?>
                                            <option <?php if($selectedCountyassembly->county_id == $county->county_id): ?> selected <?php endif; ?> value="<?php echo e($county->county_id); ?>"><?php echo e($county->county_name); ?></option>
                                        <?php else: ?>
                                            <option value="<?php echo e($county->county_id); ?>"><?php echo e($county->county_name); ?></option>
                                        <?php endif; ?>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                    <?php $__errorArgs = ['title'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                        <div class="invalid-feedback"><?php echo e($message); ?></div>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="col-sm-9">
                                <button type="submit" class="btn btn-primary bt-margin">Save</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="container">
                <div class="row search-mg">
                    <div class="col-md-12 search-col">
                        <button class="btn float-right search-bt" onclick="searchCountyAssemblies()">Search</button>
                        <input type="text" class="form-control float-right search-txt" id="search-countyassembly" name="search-countyassembly" placeholder="Search" />
                    </div>
                </div>
                <div class="row t-header">
                    <div class="col-3">County Assembly Code</div>
                    <div class="col-4">County Assembly Name</div>
                    <div class="col-3">County</div>
                    <div class="col-2"></div>
                </div>
                <div id="countyassemblies-data">
                    <?php $__currentLoopData = $countyassemblies; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $countyassembly): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="row t-content">
                        <div class="col-3">
                            <?php echo e($countyassembly->county_assembly_code); ?>

                        </div>
                        <div class="col-4">
                            <?php echo e($countyassembly->county_assembly_name); ?>

                        </div>
                        <div class="col-3">
                            <?php echo e($countyassembly->county->county_name); ?>

                        </div>
                        <div class="col-2 edit-butts">
                            <span>
                                <a href="/countyassembly/edit/<?php echo e($countyassembly->county_assembly_id); ?>">
                                    <img src="/images/edit.png" width="20px" alt="Edit" />
                                </a>
                                <button rel="<?php echo e($countyassembly->county_assembly_id); ?>" class="btn delcountyassembly" data-toggle="modal" data-target="#countyassembliesModal">
                                    <img src="/images/delete.png" width="20px" alt="Delete" />
                                </button>
                            </span>
                        </div>
                    </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
            </div>
        </div>
    </div>

    <!-- Modal -->
    <div class="modal fade" id="countyassembliesModal" tabindex="-1" role="dialog" aria-labelledby="countyassembliesModalLabel" aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="countyassembliesModalLabel">Confirm Delete</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    Are you sure you would like to delete the selected county assembly?
                </div>
                <div class="modal-footer">
                    <div class="row" style="width:100%">
                        <div class="col-8">
                            <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
                        </div>
                        <div class="col-4">
                            <form action="/countyassembly/del" method="post">
                                <?php echo csrf_field(); ?>
                                <input type="hidden" id="del-countyassembly" name="deletecountyassembly" />
                                <button type="submit" class="btn btn-primary">Confirm</button>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\src-compliance\resources\views/src/county_assemblies.blade.php ENDPATH**/ ?>