@extends('backend.layouts.app')

@section('content')
<div class="row page-titles">
   <div class="col-md-5 align-self-center">
      <h4 class="text-themecolor">View City</h4>
   </div>
   <div class="col-md-7 align-self-center text-right">
      <div class="d-flex justify-content-end align-items-center">
         <ol class="breadcrumb">
            <li class="breadcrumb-item"><a href="{{route('dashboard')}}">Dashboard</a></li>
            <li class="breadcrumb-item "><a href="{{ route('country')}}">Country </a></li>

<li class="breadcrumb-item "><a href="{{ url()->previous() }}">State</a></li>
            <li class="breadcrumb-item "><a href="{{ url()->previous() }}">City</a></li>

            <li class="breadcrumb-item active">View City</li>
         </ol>
         @can('City-edit')  
         <a href="{{ route('city.edit',['id' => $city->id] + request()->query()) }}"> <button type="button" class="btn btn-info d-none d-lg-block m-l-15"><i class="fa fa-edit"></i> Edit</button></a>
      @endcan
        </div>
   </div>
</div>
<div class="container-fluid">
    <section class="content">
            <div class="row">
                <div class="col-12">
                    <div class="card">    
                        <div class="card-body">
                        <div class="card-title" style="width:100%;display: inline-block;">
                                   <span class="caption-subject font-green bold uppercase">View City</span>
                                   <a href="{{ url()->previous() }}"> 
                                        <button type="button" class="btn btn-primary btn-sm float-right">
                                            <i class="fa fa-arrow-left"></i> Back
                                        </button>
                                    </a>


                                </div>
                            <table id="city" class="table table-bordered table-striped">
                                <tbody>
                                    <tr>
                                    <th style="width:230px">Short Code</th>
                                        <td>{{ $city->short_code }}</td>
                                    </tr>
                                    <tr>
                                        <th>State</th>
                                        <td>{{ $city->state->name ?? '-' }}</td>
                                    </tr>

                                    <tr>
                                        <th>City Name</th>
                                        <td>{{ $city->name ?? '-'}}</td>
                                    </tr>
                                    <tr>
                                        <th>Latitude</th>
                                        <td>{{ $city->latitude ?? '-'}}</td>
                                    </tr>
                                    <tr>
                                        <th>Longitude</th>
                                        <td>{{ $city->longitude ?? '-'}}</td>
                                    </tr>
                                    <tr>
                                        <th>Language</th>
                                        <td>
                                            @foreach ($city->cityLangs as $cityLang)
                                                {{ $cityLang->name ?? '-'}} <br>
                                            @endforeach
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>Created At</th>
                                        <td>{{ $city->created_at->format(config('GET.admin_date_time_format') ?? 'Y-m-d H:i:s') }}</td>
                                    </tr>
                                    <tr>
                                        <th>Updated At</th>
                                        <td>{{ $city->updated_at->format(config('GET.admin_date_time_format') ?? 'Y-m-d H:i:s') }}</td>
                                    </tr>
                                    <tr>
                                        <th>Status</th>
                                        <td>
                                            @if ($city->status == 1) 
                                                <span class="label label-success label-rounded">Active</span> 
                                            @else 
                                                <span class="label label-danger label-rounded">Inactive</span>
                                            @endif
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                           
                        </div>
                    </div>
                </div>
            </div>
    </section>
</div>
@stop
