@extends('layouts.web')

@section('content')
    <div class="container-fluid pt-3">
        <div class="row">
            <div class="col-12">
                <div class="card card-outline card-success">
                    <div class="card-header">
                        <h3 class="card-title">ข้อมูลสาขา</h3>
                    </div>

                    <div class="card-body">
                        <div class="row">
                            <div class="col-sm-3 col-md-2">
                                <p class="showTitle">รหัสสาขา</p>
                            </div>
                            <div class="col-sm-9 col-md-10">
                                <p><i class="fas fa-angle-right mr-3"></i> {{ $branch->code }}</p>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-3 col-md-2">
                                <p class="showTitle">ชื่อสาขา</p>
                            </div>
                            <div class="col-sm-9 col-md-10">
                                <p ><i class="fas fa-angle-right mr-3"></i> {{ $branch->name }}</p>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-3 col-md-2">
                                <p class="showTitle">ที่ตั้ง</p>
                            </div>
                            <div class="col-sm-9 col-md-10">
                                <p ><i class="fas fa-angle-right mr-3"></i> {{ $branch->address }}</p>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-3 col-md-2">
                                <p class="showTitle">จังหวัด</p>
                            </div>
                            <div class="ol-sm-9 col-md-10">
                                <p><i class="fas fa-angle-right mr-3"></i> {{ $branch->province }}</p>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-3 col-md-2">
                                <p class="showTitle">หมายเลขโทรศัพท์</p>
                            </div>
                            <div class="col-sm-9 col-md-10">
                                <p><i class="fas fa-angle-right mr-3"></i> {{ $branch->phone_1 }} @if($branch->phone_2 != null) {{ " , ".$branch->phone_2 }} @endif</p>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-3 col-md-2">
                                <p class="showTitle">เวลาเปิด - ปิด</p>
                            </div>
                            <div class="col-sm-9 col-md-10">
                                <p><i class="fas fa-angle-right mr-3"></i> {{ formatTimeFromDB($branch->open) . " - " .formatTimeFromDB($branch->close) }} น.</p>
                            </div>
                        </div>
                    </div>  <!-- div card body -->


                </div>
                <div class="row mt-3">
                    <div class="col-12">
                        <div style="float:left">
                            <a href="{{ route('branch.index') }}" class="btn btn-outline-secondary"><i class="fas fa-chevron-left"></i> ย้อนกลับ</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
