File: /var/www/html/hrms-production/resources/views/admin/all-city.blade.php
@extends('admin.include.master')
@section('content')
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>All City</h1>
</div>
<div class="col-sm-6 text-right">
<button type="button" class="btn btn-sm btn-outline-info mx-1" data-toggle="modal"
data-target="#AddCity">Add New</button>
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<!-- Main content -->
<section class="content">
<div class="container-fluid">
{{-- Country List --}}
<div class="row">
<div class="col-12">
<form action="" method="post" id="">
@csrf
<div class="card">
<div class="card-header">
List of Cities
</div>
<!-- /.card-header -->
<div class="card-body">
<table id="emplaoyeeTable" class="table table-bordered table-striped table-sm">
<thead>
<tr>
<th>S.No.</th>
<th>City Name</th>
<th>District Name</th>
<th>State Name</th>
{{-- <th>Country Name</th> --}}
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@foreach ($AllCity as $city)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ $city->city_name }}</td>
<td>{{ $city->district }}</td>
<td>{{ $city->state }}</td>
{{-- <td>{{ $city->country }}</td> --}}
<td>
@if ($city->status == '1')
<span class="btn btn-success btn-flat bg-success btn-xs"
data-toggle="tooltip" data-placement="top"
title="Click to De-activate" data-id="{{ $city->id }}"
onclick="deactivateCityStatus('{{ $city->id }}')">Active</span>
@else
<span class="btn btn-danger btn-flat bg-danger btn-xs"
data-toggle="tooltip" data-placement="top"
title="Click to De-activate" data-id="{{ $city->id }}"
onclick="activateCityStatus('{{ $city->id }}')">In-Active</span>
@endif
</td>
<td>
<button class="btn btn-xs btn-info" data-toggle="tooltip"
data-placement="top" title="Edit" id="{{ $city->id }}"><i
class="fas fa-edit"></i></button>
<button class="btn btn-xs btn-danger" data-toggle="tooltip"
data-placement="top" title="Delete" id="{{ $city->id }}"><i
class="fas fa-trash"></i></button>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<!-- /.card-body -->
</div>
<!-- /.card -->
</form>
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
</section>
<!-- /.content -->
</div>
{{-- JS Start Here --}}
<script>
$(function() {
$("#emplaoyeeTable").DataTable({
"responsive": true,
"lengthChange": true,
"autoWidth": false,
"lengthMenu": [10, 20, 50, 100, 250, 500],
//"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
}).buttons().container().appendTo('#userTable_wrapper .col-md-6:eq(0)');
});
</script>
<!-- /.content-wrapper -->
@endsection