@extends('layouts.app')

@section('content')


<!-- Content wrapper scroll start -->
<div class="content-wrapper-scroll">

    <!-- Content wrapper start -->
    <div class="content-wrapper">


<!-- Breadcrumb container start -->
<div class="breadcrumb-container">

<!-- Row start -->
<div class="row gutters">
    <div class="col-xl-6 col-lg-6 col-md-6 col-sm-6 col-12">
        <nav aria-label="breadcrumb">
            <ol class="breadcrumb">
              <li class="breadcrumb-item"><a href="/">Home</a></li>
              <li class="breadcrumb-item"><a href="#">Active Branch</a></li>
              <li class="breadcrumb-item active" aria-current="page">{{auth()->user()->branch}}</li>
            </ol>
        </nav>
    </div>
</div>
<!-- Row end -->

</div>
<!-- Breadcrumb container end -->


        <!-- Row start -->
        <div class="row gutters">
            <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">

                <!-- Card start -->
                <div class="card">
                    <div class="card-header-lg">
                        <h4>Create Invoice</h4>
                        <div class="text-end">
                            <a href="javascript:void(0)" class="btn btn-light">Customer Information</a>
                        </div>
                    </div>
                    <div class="card-body">
                        <form action="{{route('customer')}}" method="post">
                            @csrf

                        <input type="text" value="1" name="create_inv" hidden readonly>
                        <!-- Row start -->
                        <div class="row justify-content-between">

                            <div class="col-xl-5 col-lg-5 col-md-5 col-sm-5 col-12">

                                <!-- Row start -->
                                <div class="row gutters">

                                    <div class="col-12">
                                        <div class="form-section-header light-bg">Customer Details</div>
                                    </div>
                                    <div class="col-12">
                                        <!-- Field wrapper start -->
                                        <div class="field-wrapper">
                                            <input class="form-control" type="text" readonly name="agency" required value="{{$agencys}}">
                                            <div class="field-placeholder">Agency Name <span class="text-danger">*</span></div>
                                        </div>
                                        <!-- Field wrapper end -->
                                    </div>
                                    <div class="col-12">
                                        <!-- Field wrapper start -->
                                        <div class="field-wrapper">
                                            <input type="text" name="customer_name">
                                            <div class="field-placeholder">Customer Name</div>
                                        </div>
                                        <!-- Field wrapper end -->
                                    </div>
                                    <div class="col-12">
                                        <!-- Field wrapper start -->
                                        <div class="field-wrapper">
                                            <input class="form-control" placeholder="0123456789"  type="tel" pattern="[0-9]{4}[0-9]{4}[0-9]{2}"  name="customer_phone" required>
                                            <div class="field-placeholder">Contact Number</div>
                                        </div>
                                        <!-- Field wrapper end -->
                                    </div>

                                </div>
                                <!-- Row end -->

                            </div>
                            <div class="col-xl-5 col-lg-5 col-md-7 col-sm-7 col-12">

                                <!-- Row start -->
                                <div class="row gutters">

                                    <div class="col-12">
                                        <div class="form-section-header light-bg">Other Information</div>
                                    </div>
                                    <div class="col-xl-6 col-lg-6 col-md-6 col-sm-6 col-12">
                                        <!-- Field wrapper start -->
                                        <div class="field-wrapper">
                                            <div class="input-group">
                                                <input type="text" name="customer_date" class="form-control datepicker">
                                                <span class="input-group-text">
                                                    <i class="icon-calendar1"></i>
                                                </span>
                                            </div>
                                            <div class="field-placeholder">Date</div>
                                        </div>
                                        <!-- Field wrapper end -->
                                    </div>
                                    <div class="col-xl-6 col-lg-6 col-md-6 col-sm-6 col-12">
                                        <!-- Field wrapper start -->
                                        <div class="field-wrapper">
                                            <input type="text" name="customer_eneteredby" readonly class="form-control" value="{{auth()->user()->name}}">
                                            <div class="field-placeholder">Entered by</div>
                                        </div>
                                        <!-- Field wrapper end -->
                                    </div>
    
                                    <div class="col-12">
                                        <!-- Field wrapper start -->
                                        <div class="field-wrapper">
                                            <textarea class="form-control" name="customer_note" rows="3"></textarea>
                                            <div class="field-placeholder">Notes</div>
                                        </div>
                                        <!-- Field wrapper end -->
                                    </div>

                                </div>
                                <!-- Row end -->

                            </div>

                        </div>
                        <!-- Row end -->

                        
                        <!-- Row start -->
                        <div class="row gutters">

                            <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                                <div class="form-actions-footer">
                                    <div class="text-end">
                                        <button class="btn btn-outline-primary ms-1">Continue to Invoice</button>
                                    </div>
                                </div>
                            </div>

                        </div>
                        <!-- Row end -->

                        </form>

                    </div>
                </div>
                <!-- Card end -->

            </div>
        </div>
        <!-- Row end -->

    </div>
    <!-- Content wrapper end -->


<script>
    function checkLenghth() {
        const value = document.getElementById('phone').value;
        if (value.length > 10) {
            Swal.fire(
            'Contact Number?',
            'Phone Number Shouldnt be more than 10 character',
            'warning'
            )
            document.getElementById('phone').value = "";
        }
    }
</script>

@endsection