<?php $__env->startSection('content'); ?>
<?php
use App\Models\OutcomManufacturingModel;
?>
  <title><?php echo e(trans('admin.Quality')); ?></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.Manufacturing')); ?></a></li>
                        <li class="breadcrumb-item active"> <?php echo e(trans('admin.Quality')); ?></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">
                        <h1 class="subheader-title">
                            <i class='subheader-icon fal fa-table'></i>  <?php echo e(trans('admin.Quality')); ?>

                        </h1>
                    </div>
      
     <form id="form" action="<?php echo e(url('AddQuality')); ?>" method="post" enctype="multipart/form-data">
        <?php echo csrf_field(); ?>

               <?php echo view('honeypot::honeypotFormFields'); ?>
                    <div class="row">
                        <div class="col-lg-12">
                            <div id="panel-2" class="panel">
                                <div class="panel-hdr">
                                    <h2>
                                        <span class="fw-300"><i>   <?php echo e(trans('admin.Quality')); ?>  </i></span>
                                    </h2>

                                </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">
                                    <div class="form-row">
                                            <div class="form-group col-lg-2">
                                            <label class="form-label" for="simpleinput"><?php echo e(trans('admin.Code')); ?> </label>
                                            <input type="text" value="<?php echo e($Code); ?>" class="form-control " disabled>
                                            <input type="hidden" name="Code" value="<?php echo e($Code); ?>" class="form-control">
                                        </div>
                                        <div class="form-group col-lg-2">
                                            <label class="form-label" for="simpleinput"><?php echo e(trans('admin.Date')); ?></label>
                           <input type="date" name="Date" value="<?php echo e(date('Y-m-d')); ?>" class="form-control" required>
                                        </div>
                              
                                          <div class="form-group col-lg-2">
                              <label class="form-label" for="simpleinput"><?php echo e(trans('admin.Outcome_Name')); ?></label>
                                              
                                                             <?php
                                                
$Ouut=OutcomManufacturingModel::where('Model',$item->Model)->orderBy('id','desc')->first();        
                                            ?>    
                                                        
                                                                      
    <input type="text"  value="<?php echo e(app()->getLocale() == 'ar' ?$Ouut->P_Ar_Name :$Ouut->P_En_Name); ?>" class="form-control" disabled required>
                                              
                                              
                                              
                    <input type="hidden" name="Outcome_Name" value="<?php echo e($Exe->Outcome_Name); ?>">                          
                    <input type="hidden" name="Outcome_Code" value="<?php echo e($Exe->Outcome_Code); ?>">                          
                    <input type="hidden" name="Outcome_Qty" value="<?php echo e($Exe->Outcome_Qty); ?>">                          
                    <input type="hidden" name="Except_Qty" value="<?php echo e($Exe->Except_Qty); ?>">                          
                    <input type="hidden" name="Outcome_Unit" value="<?php echo e($Exe->Outcome_Unit); ?>">                          
                    <input type="hidden" name="Outcome_Store" value="<?php echo e($Exe->Outcome_Store); ?>">                          
                                        </div>
                 
                                            <div class="form-group col-lg-2">
                                 <label class="form-label" for="simpleinput"><?php echo e(trans('admin.Execution_Code')); ?> </label>
                                            <input type="text" value="<?php echo e($Exe->NewCode); ?>" class="form-control " disabled>
                             <input type="hidden" name="Execution_Code" value="<?php echo e($Exe->NewCode); ?>" class="form-control">
                               <input type="hidden" name="ManuExecution" value="<?php echo e($Exe->id); ?>" class="form-control">
                                        </div>
                                        <div class="form-group col-lg-2">
                                 <label class="form-label" for="simpleinput"><?php echo e(trans('admin.Production_Manager')); ?> </label>
                                            <input type="text" value="<?php echo e($Exe->Production_Manager()->first()->Name); ?>" class="form-control " disabled>
                             <input type="hidden" name="Production_Manager" value="<?php echo e($Exe->Production_Manager); ?>" class="form-control">
                                        </div>
                                        
                                                             <div class="form-group col-lg-2">
                                 <label class="form-label" for="simpleinput"><?php echo e(trans('admin.Quality_Manager')); ?> </label>
            <input type="text" value="<?php echo e(app()->getLocale() == 'ar' ?$Exe->Quality_Manager()->first()->Name :$Exe->Quality_Manager()->first()->NameEn); ?>" class="form-control " disabled>
                             <input type="hidden" name="Quality_Manager" value="<?php echo e($Exe->Quality_Manager); ?>" class="form-control">
                                        </div>
                                        

                                        
                                        
                                          <div class="form-group col-lg-12">
                             <label class="form-label" for="simpleinput"><?php echo e(trans('admin.Notes')); ?>  </label>
                            <input type="text" name="Note" value="<?php echo e(old('Note')); ?>" class="form-control">
                                        </div>        
                                        
                                        
                                    </div>
                                   
                            </div>
                        </div>
                    </div>
                </div>   
                    </div>  
                    <div class="row">
                        <div class="col-xl-12">
                            <div  class="panel">
                                <div class="panel-container show">
                                    <div class="panel-content">
   
                                        <div class="panel-container show">
                                            <div class="panel-content">
                                                <ul class="nav nav-tabs" role="tablist">
                                                    <li class="nav-item">
                             <a class="nav-link active" data-toggle="tab" href="#tab_borders_icons-1" role="tab"><i class="fal fa-home mr-1"></i> <?php echo e(trans('admin.ExaminationsTypes')); ?>  </a>
                                                    </li>
                                                </ul>
                                                <div class="tab-content border border-top-0 p-3">
                            <div class="tab-pane fade show active" id="tab_borders_icons-1" role="tabpanel">
                                                       <div class="row">
                                                        <div class="col-xl-12">
                                                            <div id="panel-1" class="panel">
                                                                <div class="panel-container show">
                                                                    <div class="panel-content">
                                                           
                                               <div  id="mobile-overflow" class="mb-2">
                         <div class="row">
                         <div class="col-md-8">                     
                              <select class="select2 form-control" id="Exmine" onchange="Check()">
                             <option value=""><?php echo e(trans('admin.Exmine_Type')); ?></option>
                             <?php $__currentLoopData = $Exmines; $__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>      
                            <input type="hidden" id="EXName"> 
                            <input type="hidden" id="EXUnit"> 
                            <input type="hidden" id="EXUnitName"> 
                            <input type="hidden" id="EXAllowF"> 
                            <input type="hidden" id="EXAllowT"> 
                                    </div>
                                  <div class="col-md-4">
                                                   
                          <button type="button" id="but" style="display: none" class="btn btn-default" onclick="Insert()">
                                <i class="fal fa-plus"></i>      
                                      </button>                         
                                                   
                                    </div>      
                                    </div>
                                      </div>                                
                                                                        
                                                                        <!-- datatable start -->
                                                                          <div  id="mobile-overflow">
                                    <table id="dt"  class="table table-bordered table-hover table-striped w-100 mobile-width">
                                        <thead>
                                            <tr>
                                                <th><?php echo e(trans('admin.Exmine_Type')); ?></th>
                                                <th><?php echo e(trans('admin.Unit')); ?></th>
                                                <th><?php echo e(trans('admin.Allow_From')); ?></th>
                                                <th><?php echo e(trans('admin.Allow_To')); ?></th>
                                                <th><?php echo e(trans('admin.Result')); ?></th>
                                                <th><?php echo e(trans('admin.Accept')); ?></th>
                                                <th><?php echo e(trans('admin.Actions')); ?></th>
                                            </tr>
                                        </thead>
                                        <tbody id="data-dt">
                                            
                                        
                                            
                                        </tbody>
                                    </table>
                                     </div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>  
                                                    </div>
                                                </div>

                                            </div>
                                        </div>
                            </div>
                        </div>
                    </div>
                    </div>
                    </div>
       <input type="hidden" id="COUNT" value="0">
         <input type="hidden" id="ROWCOUNT" value="0">
         
         
         <div class="row" id="SUBMIT" style="display: none">
 
                 <input type="hidden" id="sp" name="SP">    
              <button type="button"  class="btn btn-primary" onclick="SPS()"> <i class="fal fa-folder"></i> <?php echo e(trans('admin.Save')); ?> </button>
         
       <button type="button"  class="btn btn-primary" onclick="SPP()"><i class="fal fa-save"></i>  <?php echo e(trans('admin.SaveandPrint')); ?> </button> 

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

  <script src="j<?php echo e(asset('Admin/s/datagrid/datatables/datatables.bundle.js')); ?>"></script>
    <script src="<?php echo e(asset('Admin/js/datagrid/datatables/datatables.export.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 src="<?php echo e(asset('Admin/js/formplugins/dropzone/dropzone.js')); ?>"></script>
    
    <script>
        

        $(document).ready(function () {

            $('#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: false,

                    dom: "<'row mb-3'<'col-sm-12 col-md-6 d-flex align-items-center justify-content-start'f><'col-sm-12 col-md-6 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: '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>
         
        $(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>
         
        var autoSave = $('#autoSave');
        var interval;
        var timer = function()
        {
            interval = setInterval(function()
            {
                //start slide...
                if (autoSave.prop('checked'))
                    saveToLocal();

                clearInterval(interval);
            }, 3000);
        };

        //save
        var saveToLocal = function()
        {
            localStorage.setItem('summernoteData', $('#saveToLocal').summernote("code"));
            console.log("saved");
        }

        //delete 
        var removeFromLocal = function()
        {
            localStorage.removeItem("summernoteData");
            $('#saveToLocal').summernote('reset');
        }

        $(document).ready(function()
        {
            //init default
            $('.js-summernote').summernote(
            {
                height: 200,
                tabsize: 2,
                placeholder: "Type here...",
                dialogsFade: true,
                toolbar: [
                    ['style', ['style']],
                    ['font', ['strikethrough', 'superscript', 'subscript']],
                    ['font', ['bold', 'italic', 'underline', 'clear']],
                    ['fontsize', ['fontsize']],
                    ['fontname', ['fontname']],
                    ['color', ['color']],
                    ['para', ['ul', 'ol', 'paragraph']],
                    ['height', ['height']]
                    ['table', ['table']],
                    ['insert', ['link', 'picture', 'video']],
                    ['view', ['fullscreen', 'codeview', 'help']]
                ],
                callbacks:
                {
                    //restore from localStorage
                    onInit: function(e)
                    {
                        $('.js-summernote').summernote("code", localStorage.getItem("summernoteData"));
                    },
                    onChange: function(contents, $editable)
                    {
                        clearInterval(interval);
                        timer();
                    }
                }
            });

            //load emojis
            $.ajax(
            {
                url: 'https://api.github.com/emojis',
                async: false
            }).then(function(data)
            {
                window.emojis = Object.keys(data);
                window.emojiUrls = data;
            });

            //init emoji example
            $(".js-hint2emoji").summernote(
            {
                height: 100,
                toolbar: false,
                placeholder: 'type starting with : and any alphabet',
                hint:
                {
                    match: /:([\-+\w]+)$/,
                    search: function(keyword, callback)
                    {
                        callback($.grep(emojis, function(item)
                        {
                            return item.indexOf(keyword) === 0;
                        }));
                    },
                    template: function(item)
                    {
                        var content = emojiUrls[item];
                        return '<img src="' + content + '" width="20" /> :' + item + ':';
                    },
                    content: function(item)
                    {
                        var url = emojiUrls[item];
                        if (url)
                        {
                            return $('<img />').attr('src', url).css('width', 20)[0];
                        }
                        return '';
                    }
                }
            });

            //init mentions example
            $(".js-hint2mention").summernote(
            {
                height: 100,
                toolbar: false,
                placeholder: "type starting with @",
                hint:
                {
                    mentions: ['jayden', 'sam', 'alvin', 'david'],
                    match: /\B@(\w*)$/,
                    search: function(keyword, callback)
                    {
                        callback($.grep(this.mentions, function(item)
                        {
                            return item.indexOf(keyword) == 0;
                        }));
                    },
                    content: function(item)
                    {
                        return '@' + item;
                    }
                }
            });

        });

    </script>

    <script type="text/javascript">
        

        $(function () {
        
        $('.dz-details').click(function () {
        
        $('.dz-image').hide();
        
     
        
        });
        
        });
        
        </script>
        <script>
            
               function readURL(input) {
        if (input.files && input.files[0]) {
            var reader = new FileReader();
            
            reader.onload = function (e) {
                $('#blah').attr('src', e.target.result);
               
            }
            
            reader.readAsDataURL(input.files[0]);
           
        }
    }
    
    $("#imgInp").change(function(){
        readURL(this);
       
    });
  $(function () {
        
        $('.close').click(function () {
        
        $('#blah').hide(),
        $('.close').hide();
        
     
        
        });
        
        });
        </script>

<script type="text/javascript">
    

    $(document).ready(function() {
    
    $('.show-table').click(function () {
    
    $('.hide-products-table').show();
    
 
    
    });
    
    });
    
    </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>
<!-- Exmine Name -->
<script>
    function Check(){
        var Exmine =$('#Exmine').val();
            $.ajax({
                              url: 'ExmineFilter/'+Exmine,
                              type:"GET",
                              dataType:"json",
                              beforeSend: function(){
                                  $('#loader').css("visibility", "visible");
                              },
   
                              success:function(data) {

                    $('#EXName').val(data.Name); 
                    $('#EXUnit').val(data.Unit); 
                    $('#EXUnitName').val(data.UnitName); 
                    $('#EXAllowF').val(data.ALlowF); 
                    $('#EXAllowT').val(data.ALlowT); 
         document.getElementById('but').style.display="block";   
                              },
                              complete: function(){
                                  $('#loader').css("visibility", "hidden");
                              }
                          });    
        
        
    }
</script>    

<!-- insert table -->
<script>
      
        function Insert(){
        var Exmine = document.getElementById('Exmine').value;
        var EXName = document.getElementById('EXName').value;
        var EXUnit = document.getElementById('EXUnit').value;
        var EXUnitName = document.getElementById('EXUnitName').value;
        var EXAllowF = document.getElementById('EXAllowF').value;
        var EXAllowT = document.getElementById('EXAllowT').value;

            if(Exmine != ''){
        var table =  ` <tr id="ROW${Exmine}"> 
                                <td>
                            ${EXName}
                                </td>
                                <td>
                                ${EXUnitName}
                               </td>
                                <td>${EXAllowF}</td>
                                <td>${EXAllowT}</td>
                                <td>
          <input type="number" step="any" class="form-control" onclick="RS(${Exmine})" onkeyup="RS(${Exmine})" id="RESULT${Exmine}" name="Result[]">
                                 </td>
                                <td>
          <input type="checkbox" class="form-control" id="Accept${Exmine}" onclick="CHECKO(${Exmine})" name="Accept[]" value="1">
                                 </td>
                                <td>
                    <button id="Del" type="button" class="btn btn-default"><i class="fal fa-trash"></i></button>
    <input type="hidden" name="Exmine_Type[]" value="${EXName}">
    <input type="hidden" name="Exmine_Unit[]" value="${EXUnit}">
    <input type="hidden" name="Exmine_Allow_From[]" id="ALLOWFROM${Exmine}" value="${EXAllowF}">
    <input type="hidden" name="Exmine_Allow_To[]" id="ALLOWTO${Exmine}" value="${EXAllowT}">
    <input type="hidden" name="Exmine[]" value="${Exmine}">
                                </td>




                             </tr>`;
                             document.getElementById('data-dt').innerHTML += table;
    $.fn.rowCount = function() {
     return $('tr', $(this).find('tbody')).length;
   };
   
   var rowctr = $('#dt').rowCount();     
            $('#ROWCOUNT').val(rowctr);   

           document.getElementById('but').style.display="none";       

            }else{
                
                alert('يجب ان تختار نوع فحص اولا');
            }
            
$('#data-dt').on('click', '#Del', function(e){
   $(this).closest('tr').remove();
                         $.fn.rowCount = function() {
     return $('tr', $(this).find('tbody')).length;
   };
   
   var rowctr = $('#dt').rowCount();     
      $('#ROWCOUNT').val(rowctr);   
  
})    
   
        }

    </script>
 
<!-- Check Result-->
<script>
 function RS(r){
   
     var result=$('#RESULT'+r).val();
     var from=$('#ALLOWFROM'+r).val();
     var to=$('#ALLOWTO'+r).val();

     if(parseFloat(result) >= parseFloat(from)){
     if(parseFloat(result) <= parseFloat(to)){
        
        document.getElementById('ROW'+r).style.border="none"; 
     }else{

        document.getElementById('ROW'+r).style.border="3px solid red";   
 
         
     }
         
         
     }else{
         
      document.getElementById('ROW'+r).style.border="3px solid red";       
     }
     
     
 }





</script>
<!-- Check Submit-->
<script>
 function CHECKO(r){
    
     var Accept=$('#Accept'+r).val();
     var x=$('#COUNT').val();
     var y=$('#ROWCOUNT').val();
     var i = 0;
     
     if ($('#Accept'+r).is(':checked')) {
         
         i = parseFloat(x) +  parseFloat(1) ;
     }else{
         
          i = parseFloat(x) -  parseFloat(1) ;
         
     }
     
     if(parseFloat(i) < 0 ){
         
         i=0;
     }
     
     $('#COUNT').val(parseFloat(i));
   
      var x=$('#COUNT').val();
     
     if(parseFloat(x) == parseFloat(y)){
             document.getElementById('SUBMIT').style.display="block";     
     }else{
         
              document.getElementById('SUBMIT').style.display="none";    
     }
     
     
     
     
 }

    
    
</script>

<!-- Submit Script -->
<script>


       function SPS(){
           $('#sp').val(0);  
           var x= $('#sp').val();   
        
   
         if(x == 0){
             document.getElementById("SUBMIT").style.display = "none"; 
      document.getElementById('form').submit();   
         }
           
           
       
    }

     function SPP(){
           $('#sp').val(1);  
           var x= $('#sp').val();   
        
   
         if(x == 1){
             document.getElementById("SUBMIT").style.display = "none"; 
      document.getElementById('form').submit();   
         }
           
           
       
    }
 
</script>

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

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