<?php $__env->startSection('content'); ?>
<style>
label.error{
	color:red;
}
</style>
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
<div class="common-content">
    <div class="page-content">
         <?php if(count($departmentadminlist) !=0): ?>
              
           <div class="tableBox wraper mt-4">
                	<table id="example" class="display table dataTable" cellspacing="0" width="100%">
                    <thead>
                        <tr>
                            <th>No:</th>
                            <th>First Name</th>
                            <th>Last Name</th>
                            <th>Phone Number</th>
                            <th>Email Id</th>
                            <th>Role</th>
                            <th>Username</th>
							<th>Password</th>
                        </tr>
                    </thead>
                <tbody>
                <?php $i=1;?>
                <?php $__currentLoopData = $departmentadminlist; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $departmentadminlists): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td><?php echo e($i); ?></td>
                        <td><?php echo e(ucfirst($departmentadminlists->first_name)); ?></td>
                        <td><?php echo e(ucfirst($departmentadminlists->last_name)); ?></td>
                        <td><?php echo e($departmentadminlists->phone); ?></td>
                        <td><?php echo e($departmentadminlists->email); ?></td>
                       
                        <td><?php if($departmentadminlists->role=='user'): ?> Department User <?php else: ?> Department Admin <?php endif; ?></td>
                        <td><?php echo e($departmentadminlists->user_name); ?></td>
                        <td><?php echo e($departmentadminlists->original_password); ?></td>
                    </tr>
                    <?php $i++;?>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>
        </div>
            <div class="row">
                <div class="col-12">
                   <div class="green-button">
                       <button class="product-submit text-" fdprocessedid="meu28h"><a class="text-light" href="<?php echo e(url('buyers/create_department')); ?>">Back</a></button>
                    </div> 
                </div>
             </div>
       
	<?php else: ?>

    <span>No Data found</span>

    <?php endif; ?>
	</div>

<!-- Modal -->

    <div class="modal fade" id="myModalaction" role="dialog"  >
		<div class="modal-dialog modal-dialog-centered">
        <!-- Modal content-->
			<div class="modal-content">
			    <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel">Create New</h5>
                    <button type="button" class="close close_message" data-dismiss="modal" aria-label="Close">
                      <span aria-hidden="true">&times;</span>
                    </button>
                </div>
				<div class="modal-body">
   	                <div class="col-sm-12 col-xs-12">
					<div class="dashboard-cnts">
				    <form method="POST" action="<?php echo e(url('buyers/add_department')); ?>" id="create_departmentnew">
					  <?php echo csrf_field(); ?>
						<input type="hidden" name="type" id="type" value="new">
                    <div class="row createSpace">
                        <div class="col-lg-6 col-md-6 col-sm-12" style="margin-bottom: 20px;">
                            <div class="form-group">
								<label>Department</label>
								<input type="text" name="name" id="type" class="form-control">
							 </div>
                          </div>
						<div class="col-lg-6 col-md-6 col-sm-12">
							<button type="submit" class="btn btn-primary">
								<?php echo e(__('Create')); ?>

							</button>
						</div>
					</div>

                   </form>
				
                </div>      
                    
      	            </div>
	                       
				</div>

			</div>

		</div>
	</div>
<!-- Modal -->

<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
<script>
$(function () {
  $(".invoiceselect").select2();
  
});

$(document).ready(function() {
    $('#example').DataTable();
	 $('#example1').DataTable();
} );

<?php if(Session::has('message')): ?>
      swal({
        title: "",
        text: "<?php echo e(Session::get('message')); ?>",
        type: "success",
        showCancelButton: false,
        dangerMode: false,
        confirmButtonText: 'OK',

    });
<?php endif; ?>
<?php if(Session::has('errormessage')): ?>
      swal({
        title: "",
        text: "<?php echo e(Session::get('errormessage')); ?>",
        type: "error",
        showCancelButton: false,
        dangerMode: true,
        confirmButtonText: 'OK',

    });
<?php endif; ?>

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

<?php echo $__env->make('layouts.main_assetmanage', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/meddbot/public_html/resources/views/buyers/department_adminlist.blade.php ENDPATH**/ ?>