<?php $__env->startSection('content'); ?>

  <title><?php echo e(trans('admin.Countris')); ?></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.CRM')); ?></a></li>
                        <li class="breadcrumb-item active"><?php echo e(trans('admin.Countris')); ?></li>
                        <li class="position-absolute pos-top pos-right d-none d-sm-block"><span
                                class="js-get-date"></span></li>
                    </ol>

                    <div class="row">
                        <div class="col-xl-12">
                            <div id="panel-1" class="panel">
                                <div class="panel-hdr">
                                    <h2>
                                         <span class="fw-300"><i><?php echo e(trans('admin.Countris')); ?></i></span>
                                    </h2>

                                    <div class="panel-toolbar">


                                        <button type="button" class="btn btn-default" data-toggle="modal" data-target="#default-example-modal-lg"><?php echo e(trans('admin.AddNew')); ?></button>


                                        <button class="btn btn-primary btn-sm mx-3" data-toggle="dropdown">Table Style</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">
                                   <span id="ex"> <?php echo $__env->make('admin.layouts.messages', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?></span>
                                    <div class="panel-content">
                                        <!-- datatable start -->
                                        <div id="mobile-overflow">
                                        <table
                                            class="table table-bordered table-hover table-striped w-100 mobile-width">
                                            <thead class="bg-highlight">
                                                <tr>
                                                    <th><?php echo e(trans('admin.Arabic_Name')); ?></th>
                                                    <th><?php echo e(trans('admin.English_Name')); ?></th>
                                                    <th><?php echo e(trans('admin.Flag')); ?></th>
                                                    <th><?php echo e(trans('admin.Safe')); ?></th>
                                                    <th><?php echo e(trans('admin.Store')); ?></th>
                                                    <th><?php echo e(trans('admin.Coin')); ?></th>
                                                    <th><?php echo e(trans('admin.Code')); ?></th>
                                                    <th><?php echo e(trans('admin.SearchCode')); ?></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->Arabic_Name); ?></td>
                                                    <td><?php echo e($item->English_Name); ?></td>
                                                          <td>
                                        <img src="<?php echo e(URL::to($item->Flag)); ?>" class="img-fluid">
                                                    </td>
                                                    <td>
                                                        <?php if(!empty($item->Safe()->first()->Name)): ?>
                                             <?php echo e(app()->getLocale() == 'ar' ?$item->Safe()->first()->Name :$item->Safe()->first()->NameEn); ?>

                                                        <?php endif; ?>
                                                    </td>
                                                    <td>
                                                        <?php if(!empty($item->Store()->first()->Name)): ?>

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

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

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

                                                    <?php endif; ?>
                                                    </td>

                                                    <td><?php echo e($item->Code); ?></td>
                                                     <td><?php echo e($item->SearchCode); ?></td>
                                                    <td class="text-center">

                                                        <button type="button" class="btn btn-default" data-toggle="modal" data-target="#default-example-modal-center<?php echo e($item->id); ?>"><i class="fal fa-trash"></i></button>


                                                        <button type="button" class="btn btn-default" data-toggle="modal" data-target="#default-example-modal-lg-edit<?php echo e($item->id); ?>"><i class="fal fa-edit"></i></button>

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


                                            </tbody>
                                            <tfoot>
                                                <tr>
                                                     <th><?php echo e(trans('admin.Arabic_Name')); ?></th>
                                                    <th><?php echo e(trans('admin.English_Name')); ?></th>
                                                    <th><?php echo e(trans('admin.Flag')); ?></th>
                                                    <th><?php echo e(trans('admin.Safe')); ?></th>
                                                    <th><?php echo e(trans('admin.Store')); ?></th>
                                                    <th><?php echo e(trans('admin.Coin')); ?></th>
                                                    <th><?php echo e(trans('admin.Code')); ?></th>
                                                    <th><?php echo e(trans('admin.SearchCode')); ?></th>
                                                    <th><?php echo e(trans('admin.Actions')); ?></th>

                                                </tr>
                                            </tfoot>
                                        </table>
                                        </div>
                                        <!-- datatable end -->
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>


                    <!-- Modal Add-->
         <div class="modal fade" id="default-example-modal-lg" tabindex="-1" role="dialog" aria-hidden="true">
                        <div class="modal-dialog modal-lg" role="document">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <h5 class="modal-title"><?php echo e(trans('admin.AddNew')); ?>  </h5>
                                    <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">
                                    <form action="<?php echo e(url('AddCountris')); ?>" method="post" enctype="multipart/form-data">
                                        <?php echo csrf_field(); ?>

                                              <?php echo view('honeypot::honeypotFormFields'); ?>
                                        <div class="form-row">

                                        <div class="form-group col-lg-12">
                                            <label class="form-label" for="simpleinput"><?php echo e(trans('admin.Flag')); ?></label>
                                            <input type="file" name="Flag" accept="image/*" required>
                                        </div>


                                        <div class="form-group col-lg-12">
                        <label class="form-label" for="simpleinput"><?php echo e(trans('admin.Arabic_Name')); ?></label>
                    <input type="text" name="Arabic_Name" value="<?php echo e(old('Arabic_Name')); ?>"  class="form-control" required>
                                        </div>
                                        <div class="form-group col-lg-12">
                                     <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.English_Name')); ?></label>
                         <input type="text" name="English_Name"  value="<?php echo e(old('English_Name')); ?>" class="form-control" >
                                        </div>

                                           <div class="form-group col-lg-12">
                                     <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.Safe')); ?></label>
                  <select class="select2 form-control" name="Safe" required>
                    <option value=""><?php echo e(trans('admin.Safe')); ?></option>
                      <?php $__currentLoopData = $Safes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $safe): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                      <option value="<?php echo e($safe->id); ?>">

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

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

                                                      <div class="form-group col-lg-12">
                                     <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.Store')); ?></label>
                  <select class="select2 form-control" name="Store" required>
                    <option value=""><?php echo e(trans('admin.Store')); ?></option>
                      <?php $__currentLoopData = $Stores; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $store): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                      <option value="<?php echo e($store->id); ?>">
                             <?php echo e(app()->getLocale() == 'ar' ?$store->Name :$store->NameEn); ?>

                      </option>
                      <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                  </select>
                  </div>
                      <div class="form-group col-lg-12">
                                     <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.Coin')); ?></label>
                  <select class="select2 form-control" name="Coin" required>
                    <option value=""><?php echo e(trans('admin.Coin')); ?></option>
                      <?php $__currentLoopData = $Coins; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $coin): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                      <option value="<?php echo e($coin->id); ?>">
                        <?php echo e(app()->getLocale() == 'ar' ?$coin->Arabic_Name :$coin->English_Name); ?>

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



                                                                                             <div class="form-group col-lg-6">
                                     <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.SearchCode')); ?></label>
                         <input type="text" name="SearchCode"  value="<?php echo e(old('SearchCode')); ?>" class="form-control" >
                                        </div>

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

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


                                    </form>
                                </div>

                            </div>
                        </div>
        </div>

         <?php $__currentLoopData = $items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <!-- Modal Edit-->
   <div class="modal fade" id="default-example-modal-lg-edit<?php echo e($item->id); ?>" tabindex="-1" role="dialog" aria-hidden="true">
                        <div class="modal-dialog modal-lg" role="document">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <h5 class="modal-title"><?php echo e(trans('admin.Edit')); ?>  </h5>
                                    <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">
                                    <form action="<?php echo e(url('EditCountris/'.$item->id)); ?>" method="post" enctype="multipart/form-data">
                                        <?php echo csrf_field(); ?>

                                              <?php echo view('honeypot::honeypotFormFields'); ?>
                                        <div class="form-row">


                                                 <div class="form-group col-lg-12">
                                            <label class="form-label" for="simpleinput"><?php echo e(trans('admin.Flag')); ?></label>
                                            <input type="file" name="Flag" accept="image/*" >
                                            <input type="hidden" name="Flags" value="<?php echo e($item->Flag); ?>">
                                        </div>


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

                                           <div class="form-group col-lg-12">
                                     <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.Safe')); ?></label>
                  <select class="select2 form-control" name="Safe" required>
                    <option value=""><?php echo e(trans('admin.Safe')); ?></option>
                      <?php $__currentLoopData = $Safes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $safe): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                      <option value="<?php echo e($safe->id); ?>" <?php if($item->Safe  == $safe->id): ?> selected <?php endif; ?>>
                           <?php echo e(app()->getLocale() == 'ar' ?$safe->Name :$safe->NameEn); ?>

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

                                                        <div class="form-group col-lg-12">
                                     <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.Store')); ?></label>
                  <select class="select2 form-control" name="Store" required>
                    <option value=""><?php echo e(trans('admin.Store')); ?></option>
                      <?php $__currentLoopData = $Stores; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $store): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                      <option value="<?php echo e($store->id); ?>" <?php if($item->Store  == $store->id): ?> selected <?php endif; ?>>
                                  <?php echo e(app()->getLocale() == 'ar' ?$store->Name :$store->NameEn); ?>

                      </option>
                      <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                  </select>
                  </div>
                      <div class="form-group col-lg-12">
                                     <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.Coin')); ?></label>
                  <select class="select2 form-control" name="Coin" required>
                    <option value=""><?php echo e(trans('admin.Coin')); ?></option>
                      <?php $__currentLoopData = $Coins; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $coin): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                      <option value="<?php echo e($coin->id); ?>" <?php if($item->Coin  == $coin->id): ?> selected <?php endif; ?>>
                              <?php echo e(app()->getLocale() == 'ar' ?$coin->Arabic_Name :$coin->English_Name); ?>

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

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

                                                                            <div class="form-group col-lg-12">
                                     <label class="form-label" for="simpleinput"> <?php echo e(trans('admin.Code')); ?></label>
                         <input type="text" name="Code"  value="<?php echo e($item->Code); ?>" class="form-control" >
                                        </div>
                                        </div>
                                    <div class="modal-footer">
                                    <button type="button" class="btn btn-secondary" data-dismiss="modal"><?php echo e(trans('admin.Close')); ?></button>
                                    <button type="submit" class="btn btn-primary"> <?php echo e(trans('admin.Save')); ?></button>
                                </div>

                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>

                      <!-- Modal Delete -->
<div class="modal fade" id="default-example-modal-center<?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->Arabic_Name :$item->English_Name); ?>

                                        </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('DeleteCountris/'.$item->id)); ?>"  class="btn btn-primary"> <?php echo e(trans('admin.Yes')); ?></a>
                                </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>
        //_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/limraerp/public_html/orient.limraerp.com/resources/views/admin/CRM/Countris.blade.php ENDPATH**/ ?>