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

<div class="row">
    <div class="col-sm-3">
        <?php echo $__env->make('side_menu', \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="/circular/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($selectedCircular != null): ?>
                            <input type="hidden" id="selected_circular" name="selected_circular" value="<?php echo e($selectedCircular->src_circular_id); ?>" />
                            <?php endif; ?>
                            <div class="col-sm-9">
                                <div class="form-group">
                                    <label for="subject">Subject</label>
                                    <input type="text" class="form-control <?php $__errorArgs = ['subject'];
$__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="subject" name="subject" placeholder="Subject" value="<?php if($selectedCircular != null): ?><?php echo e($selectedCircular->subject); ?><?php else: ?><?php echo e(old('subject')); ?><?php endif; ?>">
                                    <?php $__errorArgs = ['subject'];
$__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="ref_no">Reference Number</label>
                                    <input type="text" class="form-control <?php $__errorArgs = ['ref_no'];
$__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="ref_no" name="ref_no" placeholder="Reference Number" value="<?php if($selectedCircular != null): ?><?php echo e($selectedCircular->ref_no); ?><?php else: ?><?php echo e(old('ref_no')); ?><?php endif; ?>">
                                    <?php $__errorArgs = ['ref_no'];
$__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="ref_no">Date Issued</label>
                                    <input type="text" class="form-control <?php $__errorArgs = ['date_issued'];
$__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="date_issued" name="date_issued" placeholder="Date Issued" value="<?php if($selectedCircular != null): ?><?php echo e($selectedCircular->date_issued); ?><?php else: ?><?php echo e(old('date_issued')); ?><?php endif; ?>">
                                    <?php $__errorArgs = ['date_issued'];
$__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="searchCirculars()">Search</button>
                        <input type="text" class="form-control float-right search-txt" id="search-circular" name="search-circular" placeholder="Search" />
                    </div>
                </div>
                <div class="row t-header">
                    <div class="col-4">Subject</div>
                    <div class="col-4">Ref No.</div>
                    <div class="col-2">Date Issued</div>
                    <div class="col-2"></div>
                </div>
                <div id="circulars-data">
                    <?php $__currentLoopData = $circulars; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $circular): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="row t-content">
                        <div class="col-4">
                            <?php echo $circular->subject; ?>

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

                        </div>
                        <div class="col-2">
                            <?php echo e(date("d-m-Y", strtotime($circular->date_issued))); ?>

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

    <!-- Modal -->
    <div class="modal fade" id="circularsModal" tabindex="-1" role="dialog" aria-labelledby="circularsModalLabel" aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="circularsModalLabel">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 circular?
                </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="/circular/del" method="post">
                                <?php echo csrf_field(); ?>
                                <input type="hidden" id="del-circular" name="deletecircular" />
                                <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/src_circular.blade.php ENDPATH**/ ?>