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

  <title><?php echo e(trans('admin.SalesProsMoreDetails')); ?></title>

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

                    </div>
                    <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.SalesProsMoreDetails')); ?></i></span>
                                    </h2>

                                    <div class="panel-toolbar">
                                        <button class="btn btn-sm btn-primary waves-effect waves-themed d-none" onclick="window.print()" style="margin-left:3px"><i class="fal fa-print"></i> <?php echo e(trans('admin.Print')); ?></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">
                                    <div class="panel-content">

                                          <form action="<?php echo e(url('SalesProsMoreDetailsFilter')); ?>" method="get">



                                    <div class="form-row">

                                                <div class="form-group col-md-2 no-print">
                                                <label class="form-label" for="">  <?php echo e(trans('admin.Type')); ?>  </label>
                                                <select class="select2 form-control w-100" id="Type" onchange="Show()">
                                                    <option value=""> <?php echo e(trans('admin.Type')); ?></option>
                                                    <option value="Clients"> <?php echo e(trans('admin.Clients')); ?></option>
                                                    <option value="Executors"> <?php echo e(trans('admin.Executor')); ?></option>
                                                    <option value="Delegate"> <?php echo e(trans('admin.Delegate')); ?></option>
                                                    <option value="Stores"> <?php echo e(trans('admin.Stores')); ?></option>

                                                </select>
                                            </div>

                                   <div class="form-group col-md-2 col-2-print">
                     <label class="form-label" for="simpleinput"><?php echo e(trans('admin.From')); ?></label>
                         <input type="date" value="<?php echo e(date('Y-m-d')); ?>" id="From" name="From" class="form-control" required>
                                            </div>
                                                       <div class="form-group col-md-2 col-2-print">
                     <label class="form-label" for="simpleinput"><?php echo e(trans('admin.To')); ?></label>
                         <input type="date" value="<?php echo e(date('Y-m-d')); ?>" id="To" name="To" class="form-control" required>
                                            </div>


                                      <div class="form-group col-md-2 no-print" style="display: none" id="ShowClient">
                                                <label class="form-label" for="">  <?php echo e(trans('admin.Clients')); ?>  </label>
                                                <select class="select2 form-control w-100" id="Client" name="Client">
                                                    <option value=""> <?php echo e(trans('admin.Clients')); ?></option>
                                                 <?php $__currentLoopData = $Clients; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cli): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($cli->id); ?>">

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

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

                                         <div class="form-group col-md-2 col-12 no-print"  style="display: none" id="ShowStore">
                                             <label class="form-label" for="">  <?php echo e(trans('admin.Stores')); ?>  </label>
                                             <select  class="select2 form-control w-100 select-border"  id="Store" name="Store">
                                        <option value=""> <?php echo e(trans('admin.Stores')); ?></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-md-2 col-12 no-print"  style="display: none" id="ShowDele">
                                             <label class="form-label" for="">  <?php echo e(trans('admin.Delegate')); ?>  </label>
                                             <select class="select2 form-control w-100 ; select-border"  id="Delegate" name="Delegate">
                                                        <option value=""> <?php echo e(trans('admin.Delegate')); ?></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 col-12 no-print"  style="display: none" id="ShowExe">
                                             <label class="form-label" for="">  <?php echo e(trans('admin.Executor')); ?>  </label>
                                             <select class="select2 form-control w-100 ; select-border"  id="Executor" name="Executor">
                                                        <option value=""> <?php echo e(trans('admin.Executor')); ?></option>
                                                    <?php $__currentLoopData = $Executors; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ex): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                  <option value="<?php echo e($ex->id); ?>">

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

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


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

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

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

                                             <div class="form-group col-lg-1 no-print" style="padding: 22px;">

                    <button type="submit" class="btn btn-primary"><i class="fal fa-search"></i></button>

                                        </div>

                                        </div>

                                        </form>
                                        <!-- datatable start -->
                                        <div id="mobile-overflow">
                                 <table class="table table-bordered table-hover table-striped w-100 mobile-width Data">


                                        </table>
                                        </div>
                                        <!-- datatable end -->
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </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')); ?>">
    <link rel="stylesheet" media="screen, print" href="<?php echo e(asset('Admin/css/formplugins/select2/select2.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/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>


<script>
    function Show(){
        var Type=$('#Type').val();

        if(Type == 'Clients'){

            document.getElementById('ShowClient').style.display='block';
            document.getElementById('ShowStore').style.display='none';
            document.getElementById('ShowDele').style.display='none';
            document.getElementById('ShowExe').style.display='none';

           }

          if(Type == 'Executors'){

            document.getElementById('ShowClient').style.display='none';
            document.getElementById('ShowStore').style.display='none';
            document.getElementById('ShowDele').style.display='none';
            document.getElementById('ShowExe').style.display='block';

           }

          if(Type == 'Delegate'){

            document.getElementById('ShowClient').style.display='none';
            document.getElementById('ShowStore').style.display='none';
            document.getElementById('ShowDele').style.display='block';
            document.getElementById('ShowExe').style.display='none';

           }

          if(Type == 'Stores'){

            document.getElementById('ShowClient').style.display='none';
            document.getElementById('ShowStore').style.display='block';
            document.getElementById('ShowDele').style.display='none';
            document.getElementById('ShowExe').style.display='none';

           }

    }

</script>

<!--  Filter Products
<script>
   $(document).ready(function(){

    fetch_customer_data();
    function fetch_customer_data(From = '',To='',Client='',Group='')
    {
     $.ajax({
      url:'ClientSalesFilter',
      method:'GET',
      data:{From:From,To:To,Client:Client,Group:Group},
      dataType:'json',
      success:function(data)
      {


       $('.Data').html(data.table_data);

      }
     })
    }



    $(document).on('change', '#From', function(){
     var From = $(this).val();
     var To = $('#To').val();
     var Client = $('#Client').val();
     var Group = $('#Group').val();
     fetch_customer_data(From,To,Client,Group);
    });

   $(document).on('change', '#To', function(){
     var To = $(this).val();
     var From = $('#From').val();
     var Client = $('#Client').val();
     var Group = $('#Group').val();
     fetch_customer_data(From,To,Client,Group);
    });


   $(document).on('change', '#Client', function(){
     var Client = $(this).val();
     var From = $('#From').val();
     var To = $('#To').val();
      var Group = $('#Group').val();
     fetch_customer_data(From,To,Client,Group);
    });

         $(document).on('change', '#Group', function(){
     var Group = $(this).val();
     var From = $('#From').val();
     var To = $('#To').val();
      var Client = $('#Client').val();
     fetch_customer_data(From,To,Client,Group);
    });


   });

</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/Reports/SalesProsMoreDetails.blade.php ENDPATH**/ ?>