@extends('layouts.master')

@section('content')
@if (session()->has('message'))
<div class="row">
        <!-- left column -->
        <div class="col-md-2"></div>
<div class="col-md-4 alert alert-success alert-dismissible" style="font-size:18px;font-weight:bold;width:400px;margin-left:15px">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                {!! session('message') !!}
              </div>
              </div> 
@endif

<div class="row">
        <!-- left column -->
        <div class="col-md-2"></div>
        <div class="col-md-8">
          <!-- general form elements -->
          <div class="box box-primary">
            <div class="box-header with-border">
              <h3 class="box-title">Edit Customer  </h3>
            </div>
            <!-- /.box-header -->
            <!-- form start -->
            <form   role="form" method="POST" action="{{ url('/customer/edit') }}">
                        {{ csrf_field() }}
              <div class="box-body">
                
                
                 


                <div class="form-group">
                  <label for="exampleInputPassword1">Customer Name - الاسم</label>
                  <input type="text" name="name" value="{{$customer->name}}" class="form-control"  placeholder="Customer Name - الاسم " required>
                </div>

                <div class="form-group">
                  <label for="exampleInputPassword1">Customer Address - العنوان</label>
                  <input type="text" name="address" value="{{$customer->address}}" class="form-control"  placeholder="Customer Address - العنوان " required>
                </div>

                <div class="form-group">
                  <label for="exampleInputPassword1">Customer Phone - رقم الهاتف </label>
                  <input type="text" name="phone" value="{{$customer->phone}}" class="form-control"  placeholder="Customer Phone - رقم الهاتف " required>
                </div>

                <div class="form-group">
                  <label for="exampleInputPassword1">Customer Fax - الفاكس</label>
                  <input type="text" name="fax" value="{{$customer->fax}}" class="form-control"  placeholder="Customer Fax - الفاكس " required>
                </div>

                <div class="form-group">
                  <label for="exampleInputPassword1">Customer Email - الايميل</label>
                  <input type="text" name="email" value="{{$customer->email}}" class="form-control"  placeholder="Customer Email - الايميل " required>
                </div>





                <div class="form-group">
                  <label for="exampleInputPassword1">Responsable Name -  اسم المسؤل </label>
                  <input type="text" name="responsable_name" value="{{$customer->responsable_name}}" class="form-control"  placeholder="Environmental Response - المسؤل البيئي " required>
                </div>
                <div class="form-group">
                  <label for="exampleInputPassword1">Response Position - دور المسؤل</label>
                  <input type="text" name="responsable_position"  value="{{$customer->responsable_position}}" class="form-control"  placeholder="Response Position - دور المسؤل " required>
                </div>

                <div class="form-group">
                  <label for="exampleInputPassword1">Response Phone - رقم الهاتف المسؤل</label>
                  <input type="text" name="responsable_phone"  value="{{$customer->responsable_phone}}" class="form-control"  placeholder="Response Phone - رقم الهاتف المسؤل " required>
                </div>

                <div class="form-group">
                  <label for="exampleInputPassword1">Response Email - ايميل المسؤل</label>
                  <input type="text" name="responsable_email" value="{{$customer->responsable_email}}" class="form-control"  placeholder="Response Email - ايميل المسؤل " required>
                </div>


                <div class="form-group">
                  <label for="exampleInputPassword1">Commertial Registration No - رقم التسجيل التجاري</label>
                  <input type="text" name="commertial_registration_no" value="{{$customer->commertial_registration_no}}" class="form-control"  placeholder="Commertial Registration No - رقم التسجيل التجاري " required>
                </div>
                <div class="form-group">
                  <label for="exampleInputPassword1">Tax Card No - رقم الضريبي</label>
                  <input type="text" name="tax_card_no" value="{{$customer->tax_card_no}}" class="form-control"  placeholder="Tax Card No - رقم الضريبي " required>
                </div>
                <div class="form-group">
                  <label for="exampleInputPassword1">Operating Licence No - رخصة التشغيل</label>
                  <input type="text" name="operating_licence_no" value="{{$customer->operating_licence_no}}" class="form-control"  placeholder="Operating Licence No - رخصة التشغيل " required>
                </div>
                <div class="form-group">
                  <label for="exampleInputPassword1">Industrial Registration No - رقم التسجيل الصناعي</label>
                  <input type="text" name="industrial_registration_no" value="{{$customer->industrial_registration_no}}" class="form-control"  placeholder="Industrial Registration No - رقم التسجيل الصناعي " required>
                </div>

                
                <div class="form-group">
                  <label for="exampleInputPassword1">Activity - النشاط</label>
                  <input type="text" name="activity" value="{{$customer->activity}}" class="form-control"  placeholder="Activity - النشاط " required>
                </div>
                
                <div class="form-group">
                  <label for="exampleInputPassword1"> Environmental approve num - رقم الموافقة البيئي   </label>
                  <input type="text" name="env_approve_nom" value="{{$customer->env_approve_nom}}" class="form-control"  placeholder="Environmental approve num - رقم الموافقة البيئي" required>
                </div>

                <div class="form-group">
                <label>Industrial City - المدينة الصناعية</label>
                <select class="form-control select2" style="width: 100%;" name="industrial_city_id" id="industrial_city_id" required>
                  @foreach( $citys as $city ) 
                  <option value="{{ $city->id }}" {{ $customer->industrial_city_id == $city->id ? 'selected' : '' }}>{{$city->name}}</option>
                  @endforeach
                </select>
                </div>

               <input type="hidden" name="customer_id" value="{{$customer->id}}" class="form-control"  placeholder="اسم القطاع" required>
              </div>
              <!-- /.box-body -->

              <div class="box-footer">
                <button type="submit" class="btn btn-success">Save</button>
              </div>
            </form>
          </div>    
</div>
         
      </div>

@endsection