
<?php $__env->startSection('content'); ?>
    <div class="az-content-breadcrumb">
        <span>Department list</span>
        <span>Edit Department</span>
        
        
    </div>
    <h2 class="az-content-title" style="display: inline">Edit Department <span><a href="<?php echo e(url('departments')); ?>"
                class="btn btn-az-primary" style="float: right">Department List</a></span></h2>
    


    
    <div class="row">
        <div class="offset-3 col-md-6 col-lg-6 col-xl-6">
            <div class="card card-body pd-40">
                <h5 class="card-title mg-b-20">Edit Department Details</h5>
                <form method="POST"
                    action="<?php echo e(url('departments/update/' . \Crypt::encrypt($edit_department->id_departments))); ?>"
                    enctype="multipart/form-data">
                    <?php if(count($errors) > 0): ?>
                        <div class="p-1">
                            <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <div class="alert alert-warning alert-danger fade show" role="alert"><?php echo e($error); ?>

                                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                        <span aria-hidden="true">&times;</span>
                                    </button>
                                </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                    <?php endif; ?>
                    <div class="row ">
                        <div class="row row-sm mg-b-20">
                            <div class="col-md-12">
                                <div class="form-group">
                                    <label class="az-content-label tx-11 tx-medium tx-gray-600">Department Name</label>
                                    <input type="text" name="department_name" value="<?php echo e($edit_department->department_name); ?>" class="form-control" required />
                                </div>
                            </div>
                        </div>
                        <div class="row row-sm mg-b-20">
                            <div class="col-md-12">
                                <div class="form-group">
                                    <label class="az-content-label tx-11 tx-medium tx-gray-600">Department Type</label>
                                    <input type="text" name="department_type" value="<?php echo e($edit_department->department_type); ?>" class="form-control" required />
                                </div>
                            </div>
                        </div>
                        <!-- form-group -->

                        <!-- form-group -->
                        <?php echo csrf_field(); ?>
                        <div class="row row-sm mg-b-20">
                            <div class="form-group">
                                <label class="az-content-label tx-11 tx-medium tx-gray-600">Department Status</label>
                                <select class="form-control " name="department_status">
                                    <option <?= $edit_department->status == 1 ? 'selected' : '' ?> value="1">Active
                                    </option>
                                    <option <?= $edit_department->status == 0 ? 'selected' : '' ?> value="0">In-active
                                    </option>

                                </select>
                            </div>
                        </div>
                    </div>


                    <button type="button" onclick="history.back()" class="btn btn-danger btn-block mt-2">
                        Back
                    </button>
                    <button type="submit" class="btn btn-az-primary btn-block mt-2" style="float: right">
                        Update
                    </button>
                </form>
            </div>
            <!-- card -->
        </div>
        <!-- col -->
    </div>






    
<?php $__env->stopSection(); ?>
<?php $__env->startPush('scripts'); ?>
    <script>
        $(document).ready(function() {
            $('.select2').select2();

            $('#services').on('change', function() {
                var val = $(this).val();
                $.ajax({
                    url: "<?php echo e(url('get_sub_services')); ?>/" + val,
                    type: "GET",
                    success: function(data) {
                        $('#sub_services').html(data);
                    }
                });
            });
        });
    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\wamp64\www\mds-scm\resources\views/departments/edit.blade.php ENDPATH**/ ?>