<?php $__env->startSection('content'); ?>
<?php
use App\Models\CustomersFiles;
use App\Models\Interviews;
use App\Models\Sales;
use App\Models\Addressses;
?>
     <title><?php echo e(trans('admin.Clients')); ?></title>

    <main id="js-page-content" role="main" class="page-content">
                    <ol class="breadcrumb page-breadcrumb">
                        <li class="breadcrumb-item"><a href="javascript:void(0);"><?php echo e(trans('admin.Sales')); ?> </a></li>
                        <li class="breadcrumb-item active"><?php echo e(trans('admin.Clients')); ?>  </li>
                        <li class="position-absolute pos-top pos-right d-none d-sm-block"><span
                                class="js-get-date"></span></li>
                    </ol>

                    <!-- Filter -->
                    <div class="row">
                        <div class="col-lg-12">
                            <div id="panel-2" class="panel first-color">
                                <div class="panel-hdr">
                                    <h2>
                                        <span class="fw-300"><i>   <?php echo e(trans('admin.Clients')); ?>  </i></span>
                                    </h2>
                                </div>
                                <div class="panel-container show">
                                    <div class="panel-content">
                                        <form action="<?php echo e(url('FilterClientSechdule')); ?>" method="get" class="form-row">
                                            <div class="form-group col-md-2" style="display: none">
                                                <label class="form-label" for="simpleinput"><?php echo e(trans('admin.From')); ?></label>
                                                <input type="date" value="<?php echo e(date('Y-m-d')); ?>" name="From" class="form-control" required>
                                            </div>
                                            <div class="form-group col-md-2" style="display: none">
                                                <label class="form-label" for="simpleinput"><?php echo e(trans('admin.To')); ?></label>
                                                <input type="date" value="<?php echo e(date('Y-m-d')); ?>" name="To" class="form-control" required>
                                            </div>
                                            <div class="form-group col-md-2" style="display: block">
                                    <label class="form-label" for="">  <?php echo e(trans('admin.Governrate')); ?> </label>
                                          <select class="select2 form-control w-100" id="Governrate" name="Governrate">
                                                   <option value=""><?php echo e(trans('admin.Governrate')); ?></option>
                                              <?php $__currentLoopData = $Governrates; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $gov): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option value="<?php echo e($gov->id); ?>">

                             <?php echo e(app()->getLocale() == 'ar' ?$gov->Arabic_Name :$gov->English_Name); ?>

                                              </option>
                                              <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                        </select>
                                                    </div>
                                            <div class="form-group col-md-2" style="display: block">
                                        <label class="form-label" for="">  <?php echo e(trans('admin.City')); ?></label>
                                               <select class="select2 form-control w-100" id="City" name="City">
                                  <option value=""><?php echo e(trans('admin.City')); ?></option>
                                              <?php $__currentLoopData = $Cities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cit): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($cit->id); ?>">

                              <?php echo e(app()->getLocale() == 'ar' ?$cit->Arabic_Name :$cit->English_Name); ?>

                                              </option>
                                              <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                                        </select>
                                                                    </div>
                                            <div class="form-group col-md-2">
                                      <label class="form-label" for="">  <?php echo e(trans('admin.Activity')); ?></label>
                                            <select class="select2 form-control w-100" name="Activity">
                                              <option value=""><?php echo e(trans('admin.Activity')); ?></option>
                                              <?php $__currentLoopData = $Activites; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $act): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option value="<?php echo e($act->id); ?>">

                               <?php echo e(app()->getLocale() == 'ar' ?$act->Arabic_Name :$act->English_Name); ?>

                                              </option>
                                              <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                                        </select>
                                                                    </div>
                                            <div class="form-group col-md-2">
                                        <label class="form-label" for="">  <?php echo e(trans('admin.Responsible')); ?></label>
                                            <select class="select2 form-control w-100" name="Responsible">
                                                 <option value=""><?php echo e(trans('admin.Responsible')); ?></option>
                                              <?php $__currentLoopData = $Employess; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $emp): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option value="<?php echo e($emp->id); ?>">

                                <?php echo e(app()->getLocale() == 'ar' ?$emp->Name :$emp->NameEn); ?>

                                              </option>
                                              <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                                        </select>
                                                                    </div>
                                            <div class="form-group col-md-2">
                                        <label class="form-label" for="">  <?php echo e(trans('admin.Executions_Status')); ?></label>
                                            <select class="select2 form-control w-100" name="Executions_Status">
                                        <option value=""><?php echo e(trans('admin.Executions_Status')); ?></option>
                                        <option value="potential_client"><?php echo e(trans('admin.potential_client')); ?></option>
                                                 <option value="new_client"><?php echo e(trans('admin.new_client')); ?></option>
                                                 <option value="pending"><?php echo e(trans('admin.pending')); ?></option>
                                                 <option value="former"><?php echo e(trans('admin.former')); ?></option>
                                                 <option value="important"><?php echo e(trans('admin.important')); ?></option>
                                                                        </select>
                                                                    </div>
                                            <div class="form-group col-md-2">
                                             <label class="form-label" for="">   <?php echo e(trans('admin.ClientStatus')); ?></label>
                                <select class="select2 form-control w-100" name="ClientStatus">
                             <option value=""><?php echo e(trans('admin.ClientStatus')); ?></option>
                                              <?php $__currentLoopData = $ClientStatus; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cls): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option value="<?php echo e($cls->id); ?>">

                                    <?php echo e(app()->getLocale() == 'ar' ?$cls->Arabic_Name :$cls->English_Name); ?>

                                              </option>
                                              <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                                        </select>
                                                                    </div>
                                            <div class="form-group col-md-2">
                                      <label class="form-label" for="">  <?php echo e(trans('admin.Platforms')); ?> </label>
                                            <select class="select2 form-control w-100" id="Platform" name="Platform">
                                                <option value=""><?php echo e(trans('admin.Platforms')); ?></option>
                                              <?php $__currentLoopData = $Platforms; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $pl): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option value="<?php echo e($pl->id); ?>">

                                   <?php echo e(app()->getLocale() == 'ar' ?$pl->Arabic_Name :$pl->English_Name); ?>

                                              </option>
                                              <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                                        </select>
                                                                    </div>
                                            <div class="form-group col-md-2">
                                           <label class="form-label" for="">  <?php echo e(trans('admin.Campagin')); ?> </label>
                                     <select class="select2 form-control w-100" id="Campagin" name="Campagin">
                                            <option value=""> <?php echo e(trans('admin.Campagin')); ?></option>
                                                               <?php $__currentLoopData = $Campaigns; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $camp): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($camp->id); ?>" >


                         <?php echo e(app()->getLocale() == 'ar' ?$camp->Arabic_Name :$camp->English_Name); ?>

                                              </option>
                                              <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                                                        </select>
                                                                    </div>
                                            <div class="form-group col-md-2">
                                                <label class="form-label" for="">  <?php echo e(trans('admin.User')); ?>  </label>
                                                <select class="select2 form-control w-100" name="User">
                                                    <option value=""> <?php echo e(trans('admin.User')); ?></option>
                                                 <?php $__currentLoopData = $Users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($user->id); ?>">

                             <?php echo e(app()->getLocale() == 'ar' ?$user->name :$user->nameEn); ?>

                                                </option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </select>
                                            </div>

                                            <div class="form-group col-lg-2">
                                      <label class="form-label" for="simpleinput"><?php echo e(trans('admin.Code')); ?> </label>
                                                <input type="text" name="Code" class="form-control">
                                            </div>
                                            <div class="form-group col-lg-2">
                                      <label class="form-label" for="simpleinput"><?php echo e(trans('admin.Name')); ?> </label>
                                                <input type="text" name="Name" class="form-control">
                                            </div>
                                            <div class="form-group col-lg-2">
                                      <label class="form-label" for="simpleinput"><?php echo e(trans('admin.Phone')); ?> </label>
                                                <input type="number" name="Phone" class="form-control">
                                            </div>

                                            <div class="form-group col-md-2">
                                                <div class="buttons mt-4">
                     <button type="submit" class="btn btn-primary w-100">  <?php echo e(trans('admin.Show')); ?></button>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
          <!-- data entry -->
                    <div class="row hide-table">
                        <div class="col-xl-12">
                            <div id="panel-1" class="panel second-color">
                                <div class="panel-hdr">
                                    <h2> <?php echo e(trans('admin.Clients')); ?></h2>
                                    <div class="panel-toolbar">
    <a href="<?php echo e('ExportAllClients'); ?>" class="btn btn-success btn-sm">
                                 Export Excel
                                            </a>
                                        <button class="btn btn-primary btn-sm" data-toggle="dropdown">TableStyle</button>
                                         <?php echo $__env->make('admin.layouts.toolbar', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                                    </div>
                                </div>
                                <div class="panel-container show">
                                    <div class="panel-content">

                                        <!-- datatable start -->
                                        <div style="overflow:auto;">
                                        <table id="dt-basic-example"
                                            class="table table-bordered table-hover table-striped" style="width:100%;">
                                            <thead class="bg-highlight">
                                                <tr>
                                                    <th><?php echo e(trans('admin.Code')); ?></th>

                                                    <th><?php echo e(trans('admin.Arabic_Name')); ?></th>
                                                    <th><?php echo e(trans('admin.English_Name')); ?></th>

                                                    <th><?php echo e(trans('admin.Account_Code')); ?></th>
                                                    <th><?php echo e(trans('admin.Responsible')); ?></th>

                                                    <th><?php echo e(trans('admin.Addresses')); ?></th>
                                                    <th><?php echo e(trans('admin.Details')); ?></th>
                                                    <th><?php echo e(trans('admin.TicketsClient')); ?></th>
                                                    <th><?php echo e(trans('admin.Comments')); ?></th>

                                                    <th><?php echo e(trans('admin.Actions')); ?></th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                            <?php $__currentLoopData = $items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <tr>
                                                    <td><?php echo e($item->Code); ?></td>

                                                    <td><?php echo e($item->Name); ?></td>
                                                    <td><?php echo e($item->NameEn); ?></td>

                                                    <td>      <?php if(!empty($item->Account()->first()->Code)): ?>  <?php echo e($item->Account()->first()->Code); ?> <?php endif; ?></td>
                                                    <td>
                                                <?php if(!empty($item->Responsible)): ?>


                                  <?php echo e(app()->getLocale() == 'ar' ?$item->Responsible()->first()->Name :$item->Responsible()->first()->NameEn); ?>

                                                <?php endif; ?>
                                                    </td>


                                                                      <td>
                                <button type="button" class="btn btn-default" data-toggle="modal" data-target="#Addresses<?php echo e($item->id); ?>"><?php echo e(trans('admin.Addresses')); ?> </button>
                                                </td>
                                                    <td>
                                <button type="button" class="btn btn-default" data-toggle="modal" data-target="#Details<?php echo e($item->id); ?>"><?php echo e(trans('admin.Details')); ?> </button>
                                                </td>

                                                    <td>
                        <a href="<?php echo e(url('TicketsClient/'.$item->id)); ?>" class="btn btn-default"><?php echo e(trans('admin.TicketsClient')); ?></a>

                                                </td>
                                                                     <td>
                        <a href="<?php echo e(url('CommentsClient/'.$item->id)); ?>" class="btn btn-default"><?php echo e(trans('admin.Comments')); ?></a>

                                                </td>


                                                        <td class="text-center">
                         <a href="<?php echo e(url('ProfileCustomer/'.$item->id)); ?>" class="btn btn-default" ><i class="fal fa-user"></i></a>
                         <a href="<?php echo e(url('CoooMCustomer/'.$item->id)); ?>" class="btn btn-default" ><i class="fal fa-eye"></i></a>

                                           <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('حذف العملاء')): ?>
            <button type="button" class="btn btn-default" data-toggle="modal" data-target="#Delete<?php echo e($item->id); ?>"><i class="fal fa-trash"></i></button>
                                            <?php endif; ?>

                                          <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('تعديل العملاء')): ?>
             <a href="<?php echo e(url('EditClients/'.$item->id)); ?>" class="btn btn-default" ><i class="fal fa-edit"></i></a>
                                        <?php endif; ?>
                                                        </td>
                                                </tr>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                           </tbody>
                                            <tfoot>
                                                <tr>
                                                    <th><?php echo e(trans('admin.Code')); ?></th>

                                                    <th><?php echo e(trans('admin.Arabic_Name')); ?></th>
                                                    <th><?php echo e(trans('admin.English_Name')); ?></th>

                                                    <th><?php echo e(trans('admin.Account_Code')); ?></th>
                                                    <th><?php echo e(trans('admin.Responsible')); ?></th>

                                                    <th><?php echo e(trans('admin.Addresses')); ?></th>
                                                    <th><?php echo e(trans('admin.Details')); ?></th>
                                                    <th><?php echo e(trans('admin.TicketsClient')); ?></th>
                                                       <th><?php echo e(trans('admin.Comments')); ?></th>
                                                    <th><?php echo e(trans('admin.Actions')); ?></th>
                                                </tr>
                                            </tfoot>

                                        </table>
                                        </div>
                                       <?php echo e($items->Links()); ?>

                                        <!-- datatable end -->
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

<?php $__currentLoopData = $items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>


                    <!-- Modal Details -->
       <div class="modal fade" id="Details<?php echo e($item->id); ?>" tabindex="-1" role="dialog" aria-hidden="true">
                <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <h4 class="modal-title">
                                 <?php echo e(trans('admin.Details')); ?>

                            </h4>
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true"><i class="fal fa-times"></i></span>
                            </button>
                        </div>
                        <div class="modal-body">
                            <div class="form-row">
                                <div class="form-group col-lg-3">
                                    <label class="form-label" for="simpleinput">  <?php echo e(trans('admin.Price_Level')); ?></label>
                                    <?php if($item->Price_Level == 1): ?>
                                    <input type="text" value="<?php echo e(trans('admin.Level1')); ?>"  class="form-control" disabled>
                                <?php elseif($item->Price_Level == 2): ?>
                                     <input type="text" value="<?php echo e(trans('admin.Level2')); ?>"  class="form-control" disabled>
                                <?php elseif($item->Price_Level == 3): ?>
                                     <input type="text" value="<?php echo e(trans('admin.Level3')); ?>"  class="form-control" disabled>
                                <?php endif; ?>

                                </div>
                                <div class="form-group col-lg-3">
                                    <label class="form-label" for="simpleinput"><?php echo e(trans('admin.Phone')); ?></label>
                                    <input type="text" value="<?php echo e($item->Phone); ?>"  class="form-control" disabled>
                                </div>

                                      <div class="form-group col-lg-3">
                                    <label class="form-label" for="simpleinput"><?php echo e(trans('admin.Phone2')); ?></label>
                                    <input type="text" value="<?php echo e($item->Phone2); ?>"  class="form-control" disabled>
                                </div>


                                      <div class="form-group col-lg-3">
                                    <label class="form-label" for="simpleinput"><?php echo e(trans('admin.Phone3')); ?></label>
                                    <input type="text" value="<?php echo e($item->Phone3); ?>"  class="form-control" disabled>
                                </div>


                                      <div class="form-group col-lg-3">
                                    <label class="form-label" for="simpleinput"><?php echo e(trans('admin.Phone4')); ?></label>
                                    <input type="text" value="<?php echo e($item->Phone4); ?>"  class="form-control" disabled>
                                </div>

                                      <div class="form-group col-lg-3">
                                    <label class="form-label" for="simpleinput"><?php echo e(trans('admin.Credit_Limit')); ?></label>
                                    <input type="text" value="<?php echo e($item->Credit_Limit); ?>"  class="form-control" disabled>
                                </div>


                                        <div class="form-group col-lg-3">
                                    <label class="form-label" for="simpleinput"><?php echo e(trans('admin.Date')); ?></label>
                                    <input type="text" value="<?php echo e($item->Date); ?>"  class="form-control" disabled>
                                </div>

                                        <div class="form-group col-lg-3">
                                    <label class="form-label" for="simpleinput"><?php echo e(trans('admin.Email')); ?></label>
                                    <input type="text" value="<?php echo e($item->email); ?>"  class="form-control" disabled>
                                </div>

                                        <div class="form-group col-lg-3">
                                    <label class="form-label" for="simpleinput"><?php echo e(trans('admin.Next_Appointment')); ?></label>
                                    <input type="text" value=""  class="form-control" disabled>
                                </div>
                                                  <div class="form-group col-lg-3">
                                    <label class="form-label" for="simpleinput"><?php echo e(trans('admin.Product')); ?></label>
                                        <?php if(!empty($item->Product()->first()->P_Ar_Name)): ?>
                                    <input type="text" value="<?php echo e($item->Product()->first()->P_Ar_Name); ?>"  class="form-control" disabled>
                                        <?php endif; ?>
                                </div>


                                        <div class="form-group col-lg-3">
                                    <label class="form-label" for="simpleinput"><?php echo e(trans('admin.User')); ?></label>
                                            <?php if(!empty($item->User()->first()->name)): ?>
                                    <input type="text" value=" <?php echo e(app()->getLocale() == 'ar' ?$item->User()->first()->name :$item->User()->first()->nameEn); ?>  "  class="form-control" disabled>
                                            <?php endif; ?>
                                </div>


                                <div class="form-group col-lg-3">
                                    <label class="form-label" for="simpleinput"><?php echo e(trans('admin.Governrate')); ?></label>
                                    <?php if(!empty($item->Governrate)): ?>
             <input type="text" value="<?php echo e(app()->getLocale() == 'ar' ?$item->Governrate()->first()->Arabic_Name :$item->Governrate()->first()->English_Name); ?>"  class="form-control" disabled>
                                    <?php else: ?>
                              <input type="text"  class="form-control" disabled>
                                    <?php endif; ?>
                                </div>

                                    <div class="form-group col-lg-3">
                                        <label class="form-label" for="simpleinput"><?php echo e(trans('admin.City')); ?> </label>
                                       <?php if(!empty($item->City)): ?>
             <input type="text" value="<?php echo e(app()->getLocale() == 'ar' ?$item->City()->first()->Arabic_Name :$item->City()->first()->English_Name); ?>"  class="form-control" disabled>
                                    <?php else: ?>
                              <input type="text"  class="form-control" disabled>
                                    <?php endif; ?>
                                    </div>

                                                <div class="form-group col-lg-3">
                                        <label class="form-label" for="simpleinput"><?php echo e(trans('admin.Place')); ?> </label>
                                       <?php if(!empty($item->Place)): ?>
             <input type="text" value="<?php echo e(app()->getLocale() == 'ar' ?$item->Place()->first()->Arabic_Name :$item->Place()->first()->English_Name); ?>"  class="form-control" disabled>
                                    <?php else: ?>
                              <input type="text"  class="form-control" disabled>
                                    <?php endif; ?>
                                    </div>

                                                <div class="form-group col-lg-3">
                                        <label class="form-label" for="simpleinput"><?php echo e(trans('admin.Nationality')); ?> </label>
                                       <?php if(!empty($item->Nationality)): ?>
             <input type="text" value="<?php echo e(app()->getLocale() == 'ar' ?$item->Nationality()->first()->Arabic_Name :$item->Nationality()->first()->English_Name); ?>"  class="form-control" disabled>
                                    <?php else: ?>
                              <input type="text"  class="form-control" disabled>
                                    <?php endif; ?>
                                    </div>

                                             <div class="form-group col-lg-3">
                                    <label class="form-label" for=""><?php echo e(trans('admin.Tax_Registration_Number')); ?> </label>
                                    <input type="text" value="<?php echo e($item->Tax_Registration_Number); ?>"  class="form-control"  disabled>
                                </div>
                                             <div class="form-group col-lg-3">
                                    <label class="form-label" for=""><?php echo e(trans('admin.Tax_activity_code')); ?> </label>
                                    <input type="text" value="<?php echo e($item->Tax_activity_code); ?>"  class="form-control"  disabled>
                                </div>
                                             <div class="form-group col-lg-3">
                                    <label class="form-label" for=""><?php echo e(trans('admin.work_nature')); ?> </label>

                                        <?php if($item->work_nature == 'P'): ?>

                                                  <input type="text" value="<?php echo e(trans('admin.Person')); ?>"  class="form-control"  disabled>
                                        <?php elseif($item->work_nature == 'B'): ?>
                                                  <input type="text" value="<?php echo e(trans('admin.Egyptian_trading_company')); ?>"  class="form-control"  disabled>
                                        <?php elseif($item->work_nature == 'F'): ?>
                                                  <input type="text" value="<?php echo e(trans('admin.foreign_trading_company')); ?>"  class="form-control"  disabled>

                                        <?php endif; ?>

                                </div>
                                             <div class="form-group col-lg-3">
                                    <label class="form-label" for=""><?php echo e(trans('admin.Buliding_Num')); ?> </label>
                                    <input type="text" value="<?php echo e($item->Buliding_Num); ?>"  class="form-control"  disabled>
                                </div>
                                             <div class="form-group col-lg-3">
                                    <label class="form-label" for=""><?php echo e(trans('admin.Street')); ?> </label>
                                    <input type="text" value="<?php echo e($item->Street); ?>"  class="form-control"  disabled>
                                </div>
                                             <div class="form-group col-lg-3">
                                    <label class="form-label" for=""><?php echo e(trans('admin.Postal_Code')); ?> </label>
                                    <input type="text" value="<?php echo e($item->Postal_Code); ?>"  class="form-control"  disabled>
                                </div>
                                             <div class="form-group col-lg-3">
                                    <label class="form-label" for=""><?php echo e(trans('admin.tax_magistrate')); ?> </label>
                                    <input type="text" value="<?php echo e($item->tax_magistrate); ?>"  class="form-control"  disabled>
                                </div>


                                <div class="form-group col-lg-3">
                                    <label class="form-label" for=""><?php echo e(trans('admin.Address')); ?> </label>
                                    <input type="text" value="<?php echo e($item->Address); ?>"  class="form-control"  disabled>
                                </div>
                                <div class="form-group col-lg-3">
                                    <label class="form-label" for=""><?php echo e(trans('admin.Activity')); ?>  </label>

                                                 <?php if(!empty($item->Activity)): ?>
             <input type="text" value="<?php echo e(app()->getLocale() == 'ar' ?$item->Activity()->first()->Arabic_Name :$item->Activity()->first()->English_Name); ?>"  class="form-control" disabled>
                                    <?php else: ?>
                              <input type="text"  class="form-control" disabled>
                                    <?php endif; ?>

                                </div>
                                <div class="form-group col-lg-3">
                                    <label class="form-label" for=""> <?php echo e(trans('admin.ClientStatus')); ?>  </label>
                            <?php if(!empty($item->ClientStatus)): ?>
        <input type="text" value="<?php echo e(app()->getLocale() == 'ar' ?$item->ClientStatus()->first()->Arabic_Name :$item->ClientStatus()->first()->English_Name); ?>"  class="form-control" disabled>
                                    <?php else: ?>
                              <input type="text"  class="form-control" disabled>
                                    <?php endif; ?>
                                </div>
                                <div class="form-group col-lg-3">
                                    <label class="form-label" for=""><?php echo e(trans('admin.Platform')); ?>   </label>
                                             <?php if(!empty($item->Platform)): ?>
             <input type="text" value="<?php echo e(app()->getLocale() == 'ar' ?$item->Platform()->first()->Arabic_Name :$item->Platform()->first()->English_Name); ?>"  class="form-control" disabled>
                                    <?php else: ?>
                              <input type="text"  class="form-control" disabled>
                                    <?php endif; ?>
                                </div>
                                <div class="form-group col-lg-3">
                                    <label class="form-label" for=""><?php echo e(trans('admin.Campagin')); ?>   </label>
                                             <?php if(!empty($item->Campagin)): ?>
             <input type="text" value="<?php echo e(app()->getLocale() == 'ar' ?$item->Campagin()->first()->Arabic_Name :$item->Campagin()->first()->English_Name); ?>"  class="form-control" disabled>
                                    <?php else: ?>
                              <input type="text"  class="form-control" disabled>
                                    <?php endif; ?>
                                </div>
                                <div class="form-group col-lg-3">
                                    <label class="form-label" for=""> <?php echo e(trans('admin.ID_Number')); ?>   </label>
                                    <input type="text" value="<?php echo e($item->ID_Number); ?>"  class="form-control"  disabled>
                                </div>
                                   <div class="form-group col-lg-3">
                                    <label class="form-label" for=""> <?php echo e(trans('admin.Birthdate')); ?>   </label>
                                    <input type="text" value="<?php echo e($item->Birthdate); ?>"  class="form-control"  disabled>
                                </div>
                                <div class="form-group col-lg-3">
                                    <label class="form-label" for=""> <?php echo e(trans('admin.Qualifications')); ?>   </label>
                                    <input type="text" value="<?php echo e($item->Qualifications); ?>"  class="form-control"  disabled>
                                </div>
                                <div class="form-group col-lg-3">
                                    <label class="form-label" for=""><?php echo e(trans('admin.Passport_Number')); ?>   </label>
                 <input type="text" value="<?php echo e($item->Passport_Number); ?>"  class="form-control"  disabled>
                                </div>
                                <div class="form-group col-lg-3">
                                    <label class="form-label" for=""> <?php echo e(trans('admin.Social_Status')); ?>   </label>
                       <input type="text" value="<?php echo e($item->Social_Status); ?>"  class="form-control"  disabled>
                                </div>
                                <div class="form-group col-lg-3">
                                    <label class="form-label" for=""> <?php echo e(trans('admin.Contract_Start')); ?>    </label>
                 <input type="text" value="<?php echo e($item->Contract_Start); ?>"  class="form-control"  disabled>
                                </div>
                                <div class="form-group col-lg-3">
                                    <label class="form-label" for=""> <?php echo e(trans('admin.Contract_End')); ?>    </label>
                 <input type="text" value="<?php echo e($item->Contract_End); ?>"  class="form-control"  disabled>
                                </div>
                                <div class="form-group col-lg-3">
                                    <label class="form-label" for=""> <?php echo e(trans('admin.Company_Name')); ?>    </label>
                                    <input type="text" value="<?php echo e($item->Company_Name); ?>"  class="form-control"  disabled>
                                </div>
                                       <div class="form-group col-lg-3">
                                    <label class="form-label" for=""> <?php echo e(trans('admin.Warranty')); ?>    </label>
                                    <input type="text" value="<?php echo e($item->Warranty); ?>"  class="form-control"  disabled>
                                </div>
                                            <div class="form-group col-lg-3">
                                    <label class="form-label" for=""> <?php echo e(trans('admin.SearchCode')); ?>    </label>
                                    <input type="text" value="<?php echo e($item->SearchCode); ?>"  class="form-control"  disabled>
                                </div>

                <div class="form-group col-lg-3">
                                    <label class="form-label" for=""> <?php echo e(trans('admin.Repayment_Period')); ?>    </label>
                                    <input type="text" value="<?php echo e($item->Repayment_Period); ?>"  class="form-control"  disabled>
                                </div>


                                <div class="form-group col-lg-3">
                                <label class="form-label" for=""><?php echo e(trans('admin.Commercial_Registration_No')); ?>  </label>
                        <input type="text" value="<?php echo e($item->Commercial_Registration_No); ?>"  class="form-control"  disabled>
                                </div>
                                <div class="form-group col-lg-3">
                          <label class="form-label" for="">  <?php echo e(trans('admin.Tax_Card_No')); ?>   </label>
             <input type="text" value="<?php echo e($item->Tax_Card_No); ?>"  class="form-control"  disabled>
                                </div>
                                              <div class="form-group col-lg-3">
                          <label class="form-label" for="">  <?php echo e(trans('admin.Group')); ?>   </label>
                            <?php if(!empty($item->Group)): ?>
             <input type="text" value="<?php echo e(app()->getLocale() == 'ar' ?$item->Group()->first()->Arabic_Name :$item->Group()->first()->English_Name); ?>"  class="form-control"  disabled>
                            <?php endif; ?>
                                </div>
                                <div class="form-group col-lg-3">
                                    <label class="form-label" for=""> <?php echo e(trans('admin.Bank_Account')); ?>   </label>
                                    <input type="text" value="<?php echo e($item->Bank_Account); ?>"  class="form-control"  disabled>
                                </div>
                                <div class="form-group col-lg-3">
                                    <label class="form-label" for="">  <?php echo e(trans('admin.Executions_Status')); ?>   </label>
                                      <?php if($item->Executions_Status == 'potential_client'): ?>
             <input type="text" value="<?php echo e(trans('admin.potential_client')); ?>"  class="form-control" disabled>
                                    <?php elseif($item->Executions_Status == 'new_client'): ?>
              <input type="text" value="<?php echo e(trans('admin.new_client')); ?>"  class="form-control" disabled>
                                    <?php elseif($item->Executions_Status == 'pending'): ?>
              <input type="text" value="<?php echo e(trans('admin.pending')); ?>"  class="form-control" disabled>
                                    <?php elseif($item->Executions_Status == 'former'): ?>
              <input type="text" value="<?php echo e(trans('admin.former')); ?>"  class="form-control" disabled>
                                    <?php elseif($item->Executions_Status == 'important'): ?>
              <input type="text" value="<?php echo e(trans('admin.important')); ?>"  class="form-control" disabled>
                                    <?php endif; ?>
                                </div>
                                <div class="form-group col-lg-3">
                                    <label class="form-label" for=""> <?php echo e(trans('admin.Image')); ?>     </label>
                                 <img src="<?php echo e(URL::to($item->Image)); ?>" class="img-fluid">
                                </div>
                                        <div class="form-group col-lg-12">
                                    <label class="form-label" for=""> <?php echo e(trans('admin.Client_Paper')); ?>     </label>
                            <?php    $CustomersFiles=CustomersFiles::where('Customer',$item->id)->get();  ?>
                                <?php $__currentLoopData = $CustomersFiles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $file): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                              <div class="col-md-3">
                  <a class="btn btn-default" href="<?php echo e(Storage::url($file->File)); ?>" download>
                                           <i class="fal fa-file"> <?php echo e(trans('admin.Download')); ?></i>
                                                </a>
                                    </div>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </div>
                            </div>

                        <div class="modal-footer">

         <button type="button" class="btn btn-secondary" data-dismiss="modal"><?php echo e(trans('admin.Cancel')); ?> </button>
                        </div>
                    </div>
                </div>
            </div>
            </div>


                  <!-- Modal Delete -->
            <div class="modal fade" id="Delete<?php echo e($item->id); ?>" tabindex="-1" role="dialog" aria-hidden="true">
                        <div class="modal-dialog modal-dialog-centered" role="document">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <h4 class="modal-title">
                                          <?php echo e(trans('admin.RUSWDT')); ?> <strong>
                                         <?php echo e(app()->getLocale() == 'ar' ?$item->Name :$item->NameEn); ?>

                                        </strong>
                                    </h4>
                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                        <span aria-hidden="true"><i class="fal fa-times"></i></span>
                                    </button>
                                </div>

                                <div class="modal-footer">
                  <button type="button" class="btn btn-secondary" data-dismiss="modal"> <?php echo e(trans('admin.No')); ?></button>
                   <a href="<?php echo e(url('DeleteClients/'.$item->id)); ?>"  class="btn btn-primary"> <?php echo e(trans('admin.Yes')); ?></a>
                                </div>
                            </div>
                        </div>
                    </div>


                    <!-- Modal Addresses -->
       <div class="modal fade" id="Addresses<?php echo e($item->id); ?>" tabindex="-1" role="dialog" aria-hidden="true">
                <div class="modal-dialog modal-dialog-centered modal-xl" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <h4 class="modal-title">
                                 <?php echo e(trans('admin.Addresses')); ?>

                            </h4>
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true"><i class="fal fa-times"></i></span>
                            </button>
                        </div>
                        <div class="modal-body">
                          <div id="mobile-overflow">
         <table id="" aria-describedby=""class="table table-bordered table-hover table-striped w-100 mobile-width">
                                                                    <thead>
                                                                        <tr>
                                                                        <th><?php echo e(trans('admin.Name')); ?></th>
                                                                        <th><?php echo e(trans('admin.Governrate')); ?></th>
                                                                        <th><?php echo e(trans('admin.City')); ?></th>
                                                                        <th><?php echo e(trans('admin.Place')); ?></th>
                                                                         <th><?php echo e(trans('admin.Street')); ?></th>
                                                                         <th><?php echo e(trans('admin.Buliding')); ?></th>
                                                                         <th><?php echo e(trans('admin.Floor')); ?></th>
                                                                         <th><?php echo e(trans('admin.Flat')); ?></th>
                                                                         <th><?php echo e(trans('admin.Special_Mark')); ?> </th>
                                                                         <th><?php echo e(trans('admin.Location')); ?> </th>
                                                                         <th><?php echo e(trans('admin.Map')); ?> </th>
                                                                         <th><?php echo e(trans('admin.Address_Details')); ?> </th>
                                                                        </tr>
                                                                    </thead>
                                                                    <tbody id="data-dt">
                                <?php     $CustomersAddresses=Addressses::where('Customer',$item->id)->get();   ?>

                                        <?php $__currentLoopData = $CustomersAddresses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cust): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                             <tr>
                            <td>
                         <?php echo e($cust->Address_Name); ?>

                                </td>
                                <td>
                          <?php if(!empty($cust->Governrate()->first()->Arabic_Name)): ?>

                         <?php echo e(app()->getLocale() == 'ar' ?$cust->Governrate()->first()->Arabic_Name :$cust->Governrate()->first()->English_Name); ?>

                                    <?php endif; ?>
                                </td>
                            <td>
                          <?php if(!empty($cust->City()->first()->Arabic_Name)): ?>

           <?php echo e(app()->getLocale() == 'ar' ?$cust->City()->first()->Arabic_Name :$cust->City()->first()->English_Name); ?>

                                <?php endif; ?>
                                </td>

                                <td>
                          <?php if(!empty($cust->Place()->first()->Arabic_Name)): ?>

                  <?php echo e(app()->getLocale() == 'ar' ?$cust->Place()->first()->Arabic_Name :$cust->Place()->first()->English_Name); ?>

                                    <?php endif; ?>
                               </td>

                                <td>
                             <?php echo e($cust->Street); ?>

                               </td>
                                <td>
                         <?php echo e($cust->Buliding); ?>

                               </td>
                                <td>
                       <?php echo e($cust->Floor); ?>

                               </td>
                                <td>
                      <?php echo e($cust->Flat); ?>

                               </td>
                                <td>
                           <?php echo e($cust->Special_Mark); ?>

                               </td>
                                <td>
                        <?php echo e($cust->Location); ?>

                               </td>

                                                 <td>
                                                     <iframe src="https://maps.google.com/maps?q=<?php echo e($cust->Lat); ?>,<?php echo e($cust->Lng); ?>&hl=en&z=14&amp;output=embed" width="100%" height="400" frameborder="0" style="border:0" allowfullscreen></iframe>




                                                 </td>
                                <td>
                             <?php echo e($cust->Details); ?>

                               </td>

                             </tr>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>


                                                                    </tbody>

                                                                </table>
                                                                </div>

                        <div class="modal-footer">

         <button type="button" class="btn btn-secondary" data-dismiss="modal"><?php echo e(trans('admin.Cancel')); ?> </button>
                        </div>
                    </div>
                </div>
            </div>
            </div>





<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>


                </main>




<?php $__env->stopSection(); ?>

<?php $__env->startPush('js'); ?>
    <link rel="stylesheet" media="screen, print" href="<?php echo e(asset('Admin/css/datagrid/datatables/datatables.bundle.css')); ?>">
   <script src="<?php echo e(asset('Admin/js/datagrid/datatables/datatables.export.js')); ?>"></script>
    <script src="<?php echo e(asset('Admin/js/datagrid/datatables/datatables.bundle.js')); ?>"></script>
<script src="<?php echo e(asset('Admin/js/formplugins/summernote/summernote.js')); ?>"></script>
<script src="<?php echo e(asset('Admin/js/formplugins/select2/select2.bundle.js')); ?>"></script>
<script>
   $(document).ready(function()
   {
       $(function()
       {
           $('.select2').select2();

           $(".select2-placeholder-multiple").select2(
           {
               placeholder: "Select State"
           });
           $(".js-hide-search").select2(
           {
               minimumResultsForSearch: 1 / 0
           });
           $(".js-max-length").select2(
           {
               maximumSelectionLength: 2,
               placeholder: "Select maximum 2 items"
           });
           $(".select2-placeholder").select2(
           {
               placeholder: "Select a state",
               allowClear: true
           });

           $(".js-select2-icons").select2(
           {
               minimumResultsForSearch: 1 / 0,
               templateResult: icon,
               templateSelection: icon,
               escapeMarkup: function(elm)
               {
                   return elm
               }
           });

           function icon(elm)
           {
               elm.element;
               return elm.id ? "<i class='" + $(elm.element).data("icon") + " mr-2'></i>" + elm.text : elm.text
           }

           $(".js-data-example-ajax").select2(
           {
               ajax:
               {
                   url: "https://api.github.com/search/repositories",
                   dataType: 'json',
                   delay: 250,
                   data: function(params)
                   {
                       return {
                           q: params.term, // search term
                           page: params.page
                       };
                   },
                   processResults: function(data, params)
                   {
                       // parse the results into the format expected by Select2
                       // since we are using custom formatting functions we do not need to
                       // alter the remote JSON data, except to indicate that infinite
                       // scrolling can be used
                       params.page = params.page || 1;

                       return {
                           results: data.items,
                           pagination:
                           {
                               more: (params.page * 30) < data.total_count
                           }
                       };
                   },
                   cache: true
               },
               placeholder: 'Search for a repository',
               escapeMarkup: function(markup)
               {
                   return markup;
               }, // let our custom formatter work
               minimumInputLength: 1,
               templateResult: formatRepo,
               templateSelection: formatRepoSelection
           });

           function formatRepo(repo)
           {
               if (repo.loading)
               {
                   return repo.text;
               }

               var markup = "<div class='select2-result-repository clearfix d-flex'>" +
                   "<div class='select2-result-repository__avatar mr-2'><img src='" + repo.owner.avatar_url + "' class='width-2 height-2 mt-1 rounded' /></div>" +
                   "<div class='select2-result-repository__meta'>" +
                   "<div class='select2-result-repository__title fs-lg fw-500'>" + repo.full_name + "</div>";

               if (repo.description)
               {
                   markup += "<div class='select2-result-repository__description fs-xs opacity-80 mb-1'>" + repo.description + "</div>";
               }

               markup += "<div class='select2-result-repository__statistics d-flex fs-sm'>" +
                   "<div class='select2-result-repository__forks mr-2'><i class='fal fa-lightbulb'></i> " + repo.forks_count + " Forks</div>" +
                   "<div class='select2-result-repository__stargazers mr-2'><i class='fal fa-star'></i> " + repo.stargazers_count + " Stars</div>" +
                   "<div class='select2-result-repository__watchers mr-2'><i class='fal fa-eye'></i> " + repo.watchers_count + " Watchers</div>" +
                   "</div>" +
                   "</div></div>";

               return markup;
           }

           function formatRepoSelection(repo)
           {
               return repo.full_name || repo.text;
           }
       });
   });

</script>
    <script>
        //_fnFeatureHtmlLength();
        $(document).ready(function () {
            // Setup - add a text input to each footer cell
            $('#dt-basic-example thead tr').clone(true).appendTo('#dt-basic-example thead');
            $('#dt-basic-example thead tr:eq(1) th').each(function (i) {
                var title = $(this).text();
                $(this).html('<input type="text" class="form-control form-control-sm" placeholder="Search ' + title + '" />');

                $('input', this).on('keyup change', function () {
                    if (table.column(i).search() !== this.value) {
                        table
                            .column(i)
                            .search(this.value)
                            .draw();
                    }
                });
            });
            var table = $('#dt-basic-example').DataTable(
                {
                    // responsive: true,
                    orderCellsTop: true,
                    fixedHeader: true,
                    lengthChange: true,

                    dom: "<'row mb-3'<'col-sm-12 col-md-3 d-flex align-items-center justify-content-start'f><'col-sm-12 col-md-9 d-flex align-items-center justify-content-end'B>>" +
                        "<'row'<'col-sm-12'tr>>" +
                        "<'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>",

                    buttons: [
                        {
                            extend: 'pageLength',
                            className: 'btn-outline-default'
                        },
                        {
                            extend: 'colvis',
                            text: 'Column Visibility',
                            titleAttr: 'Col visibility',
                            className: 'btn-outline-default'
                        },
                        {
                            extend: 'pdfHtml5',
                            text: 'PDF',
                            titleAttr: 'Generate PDF',
                            className: 'btn-outline-danger btn-sm mr-1'
                        },
                        {
                            extend: 'excelHtml5',
                            text: 'Excel',
                            titleAttr: 'Generate Excel',
                            className: 'btn-outline-success btn-sm mr-1'
                        },
                        {
                            extend: 'csvHtml5',
                            text: 'CSV',
                            titleAttr: 'Generate CSV',
                            className: 'btn-outline-primary btn-sm mr-1'
                        },
                        {
                            extend: 'copyHtml5',
                            text: 'Copy',
                            titleAttr: 'Copy to clipboard',
                            className: 'btn-outline-primary btn-sm mr-1'
                        },
                        {
                            extend: 'print',
                            text: 'Print',
                            titleAttr: 'Print Table',
                            className: 'btn-outline-primary btn-sm'
                        }
                    ],
                });
            $('.js-thead-colors a').on('click', function () {
                var theadColor = $(this).attr("data-bg");
                console.log(theadColor);
                $('#dt-basic-example thead').removeClassPrefix('bg-').addClass(theadColor);
            });

            $('.js-tbody-colors a').on('click', function () {
                var theadColor = $(this).attr("data-bg");
                console.log(theadColor);
                $('#dt-basic-example').removeClassPrefix('bg-').addClass(theadColor);
            });

        });

    </script>
<?php $__env->stopPush(); ?>


<?php echo $__env->make('admin.index', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/orientlimraerp/public_html/resources/views/admin/Sales/Clients.blade.php ENDPATH**/ ?>