
<?php $__env->startSection('content'); ?>
<style>
    table {
      width: 100%;
      height: 50px; /* set a height so vertical centering is visible */
      border-collapse: collapse;
    }
    td {
      text-align: center;
      vertical-align: middle;
      border: 1px solid #ccc;
    }
  </style>
<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card">
                <div class="card-header">
					<div class="d-flex justify-content-between align-items-center">
						<div>
							<?php echo e(__('Configs')); ?>

						</div>
						<div>
							<a style="text-decoration:none;" href="<?php echo e(route('configs.create')); ?>">Add</a>
						</div>
					</div>
				</div>

                <div class="card-body">
					<input class="pull-right mb-3" type="text" id="myInput" onkeyup="myFunction()" placeholder="Search for names.." title="Type in a name">
                    <table class="table table-bordered table-striped">
					<thead class="table-light">
					<th>Title</th>
					<th class="text-center">File</th>
					<th class="text-center">Action</th>
					</thead>
					<tbody id="myTable">
						<?php $__currentLoopData = $configs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $config): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
						<tr>
							<td style="text-align:left">
							<?php if($currentLocale=='en'): ?>
								<?php echo e($config->content_en); ?>

							<?php else: ?>
								<?php echo e($config->content_mr); ?>	
							<?php endif; ?>
							</td>							
							<td class="text-center">
							<?php if($currentLocale=='en'): ?>
								<img src="<?php echo e(asset('storage/' . $config->banner)); ?>" alt="Image" style="width:40px;height:40px">
							<?php endif; ?>
							</td>
							<td><a href="<?php echo e(route('configs.edit', $config)); ?>"><i class="fa-regular fa-edit"></i></a> 
							
							<form action="<?php echo e(route('configs.destroy', $config)); ?>" method="POST" style="display:inline;">
								<?php echo csrf_field(); ?>
								<!-- <?php echo method_field('DELETE'); ?> -->
								<button style="border:none" type="submit" ><i class="fa fa-trash-o text-danger"></i></button>
							</form>
							</td>
						</tr>
						<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
					</tbody>
					</table>
					
                </div>
            </div>
        </div>
    </div>
</div>
<script>
function myFunction() {
  var input, filter, table, tr, td, i, txtValue;
  input = document.getElementById("myInput");
  filter = input.value.toUpperCase();
  table = document.getElementById("myTable");
  tr = table.getElementsByTagName("tr");
  for (i = 0; i < tr.length; i++) {
    td = tr[i].getElementsByTagName("td")[0];
    if (td) {
      txtValue = td.textContent || td.innerText;
      if (txtValue.toUpperCase().indexOf(filter) > -1) {
        tr[i].style.display = "";
      } else {
        tr[i].style.display = "none";
      }
    }       
  }
}
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\nmc-elections\resources\views/configs/index.blade.php ENDPATH**/ ?>