<!DOCTYPE html>
<html lang="en">


<!-- Mirrored from edumin.dexignlab.com/xhtml/add-departments.html by HTTrack Website Copier/3.x [XR&CO'2014], Tue, 17 Nov 2020 13:56:15 GMT -->
<head>
    
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Rizwan </title>
    <!-- Favicon icon -->
    <link rel="icon" type="image/png" sizes="16x16" href="<?php echo base_url();?>assets/images/favicon.png">
    <link rel="stylesheet" href="<?php echo base_url();?>assets/vendor/bootstrap-select/dist/css/bootstrap-select.min.css">
    <link rel="stylesheet" href="<?php echo base_url();?>assets/css/style.css">
    <!-- Pick date -->
    <link rel="stylesheet" href="<?php echo base_url();?>assets/vendor/pickadate/themes/default.css">
    <link rel="stylesheet" href="<?php echo base_url();?>assets/vendor/pickadate/themes/default.date.css">
     <link href="<?php echo base_url();?>assets/vendor/datatables/css/jquery.dataTables.min.css" rel="stylesheet">
    <!-- Custom Stylesheet -->
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <style>
        .success {
         border: 3px solid green;
        }

        .error {
            border: 3px solid red;
        }
    </style>
<style type="text/css">
     
    @media screen {
  #printSection {
      display: none;
  }
}


@media print {
  body * {
    visibility:hidden;
  }
  #printSection, #printSection * {
    visibility:visible;
  }
  #printSection {
    position:absolute;
    left:0;
    top:0;
  }
}




 </style>
</head>

<body>

    <!--*******************
        Preloader start
    ********************-->
        <div id="preloader">
        <div class="sk-three-bounce">
            <div class="sk-child sk-bounce1"></div>
            <div class="sk-child sk-bounce2"></div>
            <div class="sk-child sk-bounce3"></div>
        </div>
    </div>
    <!--*******************
        Preloader end
    ********************-->

    <!--**********************************
        Main wrapper start
    ***********************************-->
    <div id="main-wrapper">

      <?php  $this->load->view('header'); ?>
        
        <!--**********************************
            Content body start
        ***********************************-->
        <div class="content-body">
            <!-- row -->
            <div class="container-fluid">
                    
                  <div class="row page-titles mx-0" style=" width: 35%;background-color: #71A6E3; color:#fff;">
                    <div class="col-sm-6 p-md-0">
                        <div class="welcome-text">
                            <p>Job #:<b><?php echo $get_data[0]['job']; ?></b></p>
                             <p>Item # : <b><?php echo $get_data[0]['product_name']; ?></b></p>
                            
                            <p><b>Material : </b><?php  foreach ($get_data as $value) { ?>
                                <?php echo material_name($value['material_id']); ?>
                            <?php } ?> </p>
                            <p>REF No : <b><?php  echo ref_no_para($get_data[0]['mold']); 
                                 ?> </b></p>
                        </div>
                    </div>
                   
                </div>
                
                <div class="row">
            <?php echo form_open(base_url(''),array('class'=>"form-horizontal add_inspec", 'id'=>"add_inspec")); ?>   

                          <?php if($this->session->flashdata('add_inspec_success')){ ?>
                                <div class="alert alert-success solid" style='text-align:center;'><?php echo $this->session->flashdata('add_inspec_success'); ?></div>
                            <?php } ?>
           
                	<div class="col-8">
                		 
                		<div class="card">
							
							<div class="card-body">
								 <div id='add_inspec_success' class='alert alert-success solid' style='display:none;'></div>
                                  <div id='condition' class='alert alert-danger solid' style='display:none;'></div>

                                 <div class="row">
                            

                                <div class="col-lg-2 col-md-6 col-sm-12">
                                    <div class="form-group">
                                         <label class="form-label">Sno</label>
                                       <select name="sno_num" id="sno_num" class="form-control" tabindex="-98">
                                            <option value="">Select SNO</option>
                                         <?php foreach ($inspec_details as $value) { ?>
                                         <option value="<?php echo $value['id']; ?>"><?php echo $value['sno_num']; ?></option>
                                        <?php } ?>
                                                   </select>
                                    </div>
                                </div>

                                <div class="col-lg-3 col-md-6 col-sm-12">
                                   <div class="form-group">
                                    <label class="form-label">Description:</label>
                                    <input type="text" readonly="readonly" value="" name="descrip" id="descrip" class="form-control descrip">
                                 </div>
                                </div>

                                <!-- <div class="col-lg-5 col-md-6 col-sm-12">
                                    <div class="form-group">
                                    <label class="form-label">Parameters:</label>
                                    <input type="text" readonly="readonly" value="" name="parameters" id="parameters" class="form-control parameters">
                                 </div>
                                </div> -->

                                <div class="col-lg-3 col-md-6 col-sm-12">
                                    <div class="form-group">
                                        <label class="form-label">Min Range:</label>
                                        <input type="text" readonly="readonly" value="" disabled id="minrange" class="form-control maxrange">
                                    </div>
                                </div>

                                <div class="col-lg-3 col-md-6 col-sm-12">
                                    <div class="form-group">
                                        <label class="form-label">Max Range:</label>
                                        <input type="text" readonly="readonly" value="" disabled id="maxrange" class="form-control minrange">
                                    </div>
                                </div>
                                
                                <div class="col-lg-2 col-md-6 col-sm-12">
                                    <div class="form-group">
                                        <label class="form-label">1</label>
                                        <input type="text" name="sample_1" id="sample_1" required value="" class="form-control required">
                                    </div>
                                </div>

                                <div class="col-lg-2 col-md-6 col-sm-12">
                                    <div class="form-group">
                                         <label class="form-label">2</label>
                                        <input type="text" name="sample_2" id="sample_2" required value="" class="form-control required">
                                    </div>
                                </div>

                                <div class="col-lg-2 col-md-6 col-sm-12">
                                    <div class="form-group">
                                         <label class="form-label">3</label>
                                        <input type="text" name="sample_3" id="sample_3"  value="" class="form-control ">
                                    </div>
                                </div>

                                <div class="col-lg-2 col-md-6 col-sm-12">
                                    <div class="form-group">
                                         <label class="form-label">4</label>
                                        <input type="text" name="sample_4" id="sample_4"   value="" class="form-control ">
                                    </div>
                                </div>

                                <div class="col-lg-2 col-md-6 col-sm-12">
                                    <div class="form-group">
                                         <label class="form-label">5</label>
                                        <input type="text" name="sample_5" id="sample_5"  value="" class="form-control ">
                                    </div>
                                </div>

                                <div class="col-lg-2 col-md-6 col-sm-12">
                                    <div class="form-group">
                                         <label class="form-label">6</label>
                                        <input type="text" name="sample_6" id="sample_6"  value="" class="form-control ">
                                    </div>
                                </div>

                                <div class="col-lg-2 col-md-6 col-sm-12">
                                    <div class="form-group">
                                         <label class="form-label">7</label>
                                        <input type="text" name="sample_7" id="sample_7"  value="" class="form-control ">
                                    </div>
                                </div>

                                <div class="col-lg-2 col-md-6 col-sm-12">
                                    <div class="form-group">
                                         <label class="form-label">8</label>
                                        <input type="text" name="sample_8" id="sample_8"  value="" class="form-control ">
                                    </div>
                                </div>

                                <div class="col-lg-2 col-md-6 col-sm-12">
                                    <div class="form-group">
                                         <label class="form-label">9</label>
                                        <input type="text" name="sample_9" id="sample_9"  value="" class="form-control ">
                                    </div>
                                </div>

                                <div class="col-lg-2 col-md-6 col-sm-12">
                                    <div class="form-group">
                                         <label class="form-label">10</label>
                                        <input type="text" name="sample_10" id="sample_10"  value="" class="form-control ">
                                    </div>
                                </div>

                                <div class="col-lg-2 col-md-6 col-sm-12">
                                    <div class="form-group">
                                         <label class="form-label">11</label>
                                        <input type="text" name="sample_11" id="sample_11"  value="" class="form-control ">
                                    </div>
                                </div>

                                <div class="col-lg-2 col-md-6 col-sm-12">
                                    <div class="form-group">
                                         <label class="form-label">12</label>
                                        <input type="text" name="sample_12" id="sample_12"  value="" class="form-control ">
                                    </div>
                                </div>

                                <div class="col-lg-2 col-md-6 col-sm-12">
                                    <div class="form-group">
                                         <label class="form-label">13</label>
                                        <input type="text" name="sample_13" id="sample_13" value="" class="form-control ">
                                    </div>
                                </div>

                                <div class="col-lg-2 col-md-6 col-sm-12">
                                    <div class="form-group">
                                         <label class="form-label">14</label>
                                        <input type="text" name="sample_14" id="sample_14" value="" class="form-control ">
                                    </div>
                                </div>

                                <div class="col-lg-2 col-md-6 col-sm-12">
                                    <div class="form-group">
                                         <label class="form-label">15</label>
                                        <input type="text" name="sample_15" id="sample_15" value="" class="form-control ">
                                    </div>
                                </div>


                                <div class="col-lg-2 col-md-6 col-sm-12">
                                    <div class="form-group">
                                         <label class="form-label">16</label>
                                        <input type="text" name="sample_16" id="sample_16" value="" class="form-control ">
                                    </div>
                                </div>

                                <div class="col-lg-2 col-md-6 col-sm-12">
                                    <div class="form-group">
                                         <label class="form-label">17</label>
                                        <input type="text" name="sample_17" id="sample_17" value="" class="form-control ">
                                    </div>
                                </div>


                                <div class="col-lg-2 col-md-6 col-sm-12">
                                    <div class="form-group">
                                         <label class="form-label">18</label>
                                        <input type="text" name="sample_18" id="sample_18" value="" class="form-control ">
                                    </div>
                                </div>


                                <div class="col-lg-2 col-md-6 col-sm-12">
                                    <div class="form-group">
                                         <label class="form-label">19</label>
                                        <input type="text" name="sample_19" id="sample_19" value="" class="form-control ">
                                    </div>
                                </div>


                                <div class="col-lg-2 col-md-6 col-sm-12">
                                    <div class="form-group">
                                         <label class="form-label">20</label>
                                        <input type="text" name="sample_20" id="sample_20" value="" class="form-control ">
                                    </div>
                                </div>


                                <div class="col-lg-2 col-md-6 col-sm-12">
                                    <div class="form-group">
                                         <label class="form-label">21</label>
                                        <input type="text" name="sample_21" id="sample_21" value="" class="form-control ">
                                    </div>
                                </div>


                                <div class="col-lg-2 col-md-6 col-sm-12">
                                    <div class="form-group">
                                         <label class="form-label">22</label>
                                        <input type="text" name="sample_22" id="sample_22" value="" class="form-control ">
                                    </div>
                                </div>


                                <div class="col-lg-2 col-md-6 col-sm-12">
                                    <div class="form-group">
                                         <label class="form-label">23</label>
                                        <input type="text" name="sample_23" id="sample_23" value="" class="form-control ">
                                    </div>
                                </div>


                                <div class="col-lg-2 col-md-6 col-sm-12">
                                    <div class="form-group">
                                         <label class="form-label">24</label>
                                        <input type="text" name="sample_24" id="sample_24" value="" class="form-control ">
                                    </div>
                                </div>


                                <div class="col-lg-12 col-md-6 col-sm-12">
                                  <label class="form-label">Remarks</label>
                                    <div class="form-group">
                                         
                                        <textarea name="remarks" class="form-label" id="remarks" ></textarea>
                                    </div>
                                </div>
                               
                                 <input type="hidden" name="so_id" id="so_id" value="<?php echo @$inspec_details[0]['so_id']; ?>"  class="form-control so_id">


                                 <input type="hidden" name="product_id" id="product_id" value="<?php echo @$inspec_details[0]['product_name']; ?>"  class="form-control product_id">


                                 <input type="hidden" name="product_id" id="product_id" value="<?php echo product_id(@$inspec_details[0]['product_name']); ?>"  class="form-control product_id">

                                 <input type="hidden" name="para_id" id="para_id"  class="form-control para_id">

                                
                                 <input type="hidden" id="mold" value="<?php echo $this->uri->segment('3'); ?>"  class="form-control mold">


								                  <input type="hidden" name="user_id" id="user_id" value="<?php echo $this->session->userdata('id');?>">
                                    <div class="col-lg-6 col-md-6 col-sm-12">
                                        <div class="form-group">
                                           
                                            <input type="hidden" name="created" id="created" value="<?php echo date('Y-m-d H:i:s'); ?>" class="form-control required">
                                        </div>
                                    </div>



                                    <div class="col-lg-6 col-md-6 col-sm-12">
                                        <div class="form-group">
                                           
                                            <input type="hidden" value="<?php echo date('Y-m-d H:i:s'); ?>" name="modified" id="modified" class="form-control required">
                                        </div>
                                    </div>
							</div>	
                            
                            <button type="submit" class="btn btn-primary" id="emp_add" >Add</button>
							</div>
						</div>

                	</div>
                    <?php form_close(); ?>
                    <div class="col-8">


                        <div class="card">

                          
                          <div id='add_inspec_success_production' class='alert alert-success solid' style='display:none;'></div>


                          <?php if($this->session->flashdata('party_danger')){ ?>
                                    <div class="alert alert-danger solid " style='text-align:center;'><?php echo $this->session->flashdata('party_danger'); ?></div>
                                <?php } ?>
                            <div class="card-header">
                                <h4 class="card-title"></h4>
                            </div>
                            <div class="card-body">

                              <div id='party_danger' class='alert alert-danger solid' style='display:none;width: 25%;'></div>
                                <div class="table-responsive">

                                  <span class="badge badge-rounded badge-success">
                                    <a href="#" id="click_to_submit" >Click To Finish</a></span>
                                    <a  href="#" id="btnPrint" type="button" class="badge badge-rounded badge-warning">Print</a>
                                    <div id="printThis">
                                        <div class="welcome-text">
                                            <p><b>Job #:</b><?php echo $get_data[0]['job']; ?></p>
                                             <p><b>Item  : </b><?php echo $get_data[0]['product_name']; ?></p>
                                             <p><b>Material : </b><?php  foreach ($get_data as $value) { ?>
                                                <?php echo material_name($value['material_id']); ?>
                                            <?php } ?> </p>
                                            <p><b>Mould : </b><?php  echo mold_code($this->uri->segment('3')); ?> </p>
                                            <p><b>REF No : </b><?php  echo ref_no_para($get_data[0]['mold']); 
                                                 ?> </p>
                                        </div> 
                                    <table class="table verticle-middle"  style="font-size: 13px;">
                                        <thead>
                                            <tr style="background-color:#D3D3D3;">
                                           
                                                
                                              
                                                <th scope="col">SNO</th>
                                                
                                                <th scope="col">Date/Time</th>
                                                <th scope="col">Name</th>
                                                
                                                <th scope="col">Max Parameter</th>
                                                <th scope="col">Min Parameter</th>
                                                <?php
                                                    if(!empty($all_columns_count) ){
                                                    foreach ($all_columns_count as $aaa) {
                                                            
                                                        $res =  array_filter($aaa);
                                                        }
                                                    }
                                                
                                                    @$total =  count($res);

                                                 for ($x = 1; $x <= $total; $x++) { ?>
                                                   <th scope="col"><?php echo  $x; ?></th>
                                                    <?php }  ?></th>
                                                  <th>Action</th>
                                                    
                                            </tr>
                                        </thead>
                                        <tbody>
                                        <?php
                                            if (!empty($all_inspec_details)) {
                                                foreach ($all_inspec_details as $value) {
                                                    $minRange = $value['min_range'];
                                                    $maxRange = $value['max_range'];
                                                    $sampleValue = $value['sample_1'];
                                                    $sampleValue1 = $value['sample_2'];
                                                    $sampleValue2 = $value['sample_3'];
                                                    $sampleValue3 = $value['sample_4'];
                                                    $sampleValue4 = $value['sample_5'];
                                                    $sampleValue5 = $value['sample_6'];
                                                    $sampleValue6 = $value['sample_7'];
                                                    $sampleValue7 = $value['sample_8'];
                                                    $sampleValue8 = $value['sample_9'];
                                                    $sampleValue9 = $value['sample_10'];
                                                    $sampleValue10 = $value['sample_11'];
                                                    $sampleValue11 = $value['sample_12'];
                                                    $sampleValue12 = $value['sample_13'];
                                                    $sampleValue13 = $value['sample_14'];
                                                    $sampleValue14 = $value['sample_15'];
                                                    $sampleValue15 = $value['sample_16'];
                                                    $sampleValue16 = $value['sample_17'];
                                                    $sampleValue17 = $value['sample_18'];
                                                    $sampleValue18 = $value['sample_19'];
                                                    $sampleValue19 = $value['sample_20'];
                                                    $sampleValue20 = $value['sample_21'];
                                                    $sampleValue21 = $value['sample_22'];
                                                    $sampleValue22 = $value['sample_23'];
                                                    $sampleValue23 = $value['sample_24'];
                                                    echo '<tr>';
                                                    echo '<td>' . $value['sno_num'] . '</td>';
                                                    echo '<td>' . date('d/M/Y h:i:s', strtotime($value['created'])) . '</td>';
                                                    echo '<td>' . $value['descrip'] . '</td>';
                                                    echo '<td>' . $minRange . '</td>';
                                                    echo '<td>' . $maxRange . '</td>';
                                                    if(!empty($sampleValue)){
                                                    echo '<td>';
                                                   if ($sampleValue >= $maxRange && $sampleValue <= $minRange) {
                                                        echo $sampleValue . ' Approved';
                                                    } else {
                                                        echo $sampleValue . ' Rejected';
                                                    }
                                                    echo '</td>';
                                                    }
                                                    if(!empty($sampleValue1)){
                                                    echo '<td>';
                                                    if ($sampleValue1 >= $maxRange && $sampleValue1 <= $minRange) {
                                                        echo $sampleValue1 . ' Approved';
                                                    } else {
                                                        echo $sampleValue1 . ' Rejected';
                                                    }
                                                    
                                                    echo '</td>';
                                                    }
                                                    if(!empty($sampleValue2)){
                                                    echo '<td>';
                                                   
                                                    if ($sampleValue2 >= $maxRange && $sampleValue2 <= $minRange) {
                                                        echo $sampleValue2 . ' Approved';
                                                    } else {
                                                        echo $sampleValue2 . ' Rejected';
                                                    }
                                                    echo '</td>';
                                                    }
                                                    if(!empty($sampleValue3)){
                                                    echo '<td>';
                                                    if ($sampleValue3 >= $maxRange && $sampleValue3 <= $minRange) {
                                                        echo $sampleValue3 . ' Approved';
                                                    } else {
                                                        echo $sampleValue3 . ' Rejected';
                                                    }
                                                    echo '</td>';
                                                    }
                                                    if(!empty($sampleValue4)){
                                                    echo '<td>';
                                                   
                                                    if ($sampleValue4 >= $maxRange && $sampleValue4 <= $minRange) {
                                                        echo $sampleValue4 . ' Approved';
                                                    } else {
                                                        echo $sampleValue4 . ' Rejected';
                                                    }
                                                    
                                                    echo '</td>';
                                                }
                                                if(!empty($sampleValue5)){
                                                    echo '<td>';
                                                   
                                                    if ($sampleValue5 >= $maxRange && $sampleValue5 <= $minRange) {
                                                        echo $sampleValue5 . ' Approved';
                                                    } else {
                                                        echo $sampleValue5 . ' Rejected';
                                                    }
                                                   
                                                    echo '</td>';
                                                }
                                                if(!empty($sampleValue6)){
                                                    echo '<td>';
                                                   
                                                    if ($sampleValue6 >= $maxRange && $sampleValue6 <= $minRange) {
                                                        echo $sampleValue6 . ' Approved';
                                                    } else {
                                                        echo $sampleValue6 . ' Rejected';
                                                    }
                                                   
                                                    echo '</td>';
                                                }
                                                if(!empty($sampleValue7)){
                                                    echo '<td>';
                                                   
                                                    if ($sampleValue7 >= $maxRange && $sampleValue7 <= $minRange) {
                                                        echo $sampleValue7 . ' Approved';
                                                    } else {
                                                        echo $sampleValue7 . ' Rejected';
                                                    }
                                                    
                                                    echo '</td>';
                                                }
                                                if(!empty($sampleValue8)){
                                                    echo '<td>';
                                                    
                                                    if ($sampleValue8 >= $maxRange && $sampleValue8 <= $minRange) {
                                                        echo $sampleValue8 . ' Approved';
                                                    } else {
                                                        echo $sampleValue8 . ' Rejected';
                                                    }
                                                   
                                                    echo '</td>';
                                                }
                                                if(!empty($sampleValue9)){
                                                    echo '<td>';
                                                   
                                                    if ($sampleValue9 >= $maxRange && $sampleValue9 <= $minRange) {
                                                        echo $sampleValue9 . ' Approved';
                                                    } else {
                                                        echo $sampleValue9 . ' Rejected';
                                                    }
                                                    
                                                    echo '</td>';
                                                }
                                                if(!empty($sampleValue10)){
                                                    echo '<td>';
                                                    
                                                    if ($sampleValue10 >= $maxRange && $sampleValue10 <= $minRange) {
                                                        echo $sampleValue10 . ' Approved';
                                                    } else {
                                                        echo $sampleValue10 . ' Rejected';
                                                    }
                                                    
                                                    echo '</td>';
                                                }
                                                if(!empty($sampleValue11)){
                                                    echo '<td>';
                                                   
                                                    if ($sampleValue11 >= $maxRange && $sampleValue11 <= $minRange) {
                                                        echo $sampleValue11 . ' Approved';
                                                    } else {
                                                        echo $sampleValue11 . ' Rejected';
                                                    }
                                                   
                                                    echo '</td>';
                                                }
                                                if(!empty($sampleValue12)){
                                                    echo '<td>';
                                                    
                                                    if ($sampleValue12 >= $maxRange && $sampleValue12    <= $minRange) {
                                                        echo $sampleValue12  . ' Approved';
                                                    } else {
                                                        echo $sampleValue12  . ' Rejected';
                                                    }
                                                   
                                                    echo '</td>';
                                                }
                                                if(!empty($sampleValue13)){
                                                    echo '<td>';
                                                    
                                                    if ($sampleValue13 >= $maxRange && $sampleValue13 <= $minRange) {
                                                        echo $sampleValue13 . ' Approved';
                                                    } else {
                                                        echo $sampleValue13 . ' Rejected';
                                                    }
                                                    
                                                    echo '</td>';
                                                }
                                                if(!empty($sampleValue14)){
                                                    echo '<td>';
                                                    
                                                    if ($sampleValue14 >= $maxRange && $sampleValue14 <= $minRange) {
                                                        echo $sampleValue14 . ' Approved';
                                                    } else {
                                                        echo $sampleValue14 . ' Rejected';
                                                    }
                                                    
                                                    echo '</td>';
                                                }
                                                if(!empty($sampleValue15)){
                                                    echo '<td>';
                                                    
                                                    if ($sampleValue15 >= $maxRange && $sampleValue15 <= $minRange) {
                                                        echo $sampleValue15 . ' Approved';
                                                    } else {
                                                        echo $sampleValue15 . ' Rejected';
                                                    }
                                                    
                                                    echo '</td>';
                                                }
                                                if(!empty($sampleValue16)){
                                                    echo '<td>';
                                                   
                                                    if ($sampleValue16 >= $maxRange && $sampleValue16 <= $minRange) {
                                                        echo $sampleValue16 . ' Approved';
                                                    } else {
                                                        echo $sampleValue16 . ' Rejected';
                                                    }
                                                    
                                                    echo '</td>';
                                                }
                                                if(!empty($sampleValue17)){
                                                    echo '<td>';
                                                   
                                                    if ($sampleValue17 >= $maxRange && $sampleValue17 <= $minRange) {
                                                        echo $sampleValue17 . ' Approved';
                                                    } else {
                                                        echo $sampleValue17 . ' Rejected';
                                                    }
                                                    
                                                    echo '</td>';
                                                }
                                                if(!empty($sampleValue18)){
                                                    echo '<td>';
                                                    
                                                    if ($sampleValue18 >= $maxRange && $sampleValue18 <= $minRange) {
                                                        echo $sampleValue18 . ' Approved';
                                                    } else {
                                                        echo $sampleValue18 . ' Rejected';
                                                    }
                                                    
                                                    echo '</td>';
                                                }
                                                if(!empty($sampleValue19)){
                                                    echo '<td>';
                                                   
                                                    if ($sampleValue19 >= $maxRange && $sampleValue19 <= $minRange) {
                                                        echo $sampleValue19 . ' Approved';
                                                    } else {
                                                        echo $sampleValue19 . ' Rejected';
                                                    }
                                                    
                                                    echo '</td>';
                                                }
                                                if(!empty($sampleValue20)){
                                                    echo '<td>';
                                                    
                                                    if ($sampleValue20 >= $maxRange && $sampleValue20 <= $minRange) {
                                                        echo $sampleValue20 . ' Approved';
                                                    } else {
                                                        echo $sampleValue20 . ' Rejected';
                                                    }
                                                    
                                                    echo '</td>';
                                                }
                                                if(!empty($sampleValue21)){
                                                    echo '<td>';
                                                    
                                                    if ($sampleValue21 >= $maxRange && $sampleValue21 <= $minRange) {
                                                        echo $sampleValue21 . ' Approved';
                                                    } else {
                                                        echo $sampleValue21 . ' Rejected';
                                                    }
                                                    
                                                    echo '</td>';
                                                }
                                                    if(!empty($sampleValue22)){
                                                    echo '<td>';
                                                    if ($sampleValue22 >= $maxRange && $sampleValue22 <= $minRange) {
                                                        echo $sampleValue22 . ' Approved';
                                                    } else {
                                                        echo $sampleValue22 . ' Rejected';
                                                    }
                                                    echo '</td>';
                                                    }
                                                    if(!empty($sampleValue23)){
                                                    echo '<td>';
                                                    if ($sampleValue23 >= $maxRange && $sampleValue23 <= $minRange) {
                                                        echo $sampleValue23 . ' Approved';
                                                    } else {
                                                        echo $sampleValue23 . ' Rejected';
                                                    }
                                                   
                                                    echo '</td>';
                                                    }
                                                    echo '<td>
                                                    <a href="javascript:void(0);" onclick="delete_data(' . $value['parameter_id'] . ')" class="btn btn-sm btn-danger"><i class="la la-trash-o"></i></a>
                                                    </td>';
                                                    echo '</tr>';
                                                }
                                            }
                                            ?>

                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
</div>




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

         <div class="modal fade bd-example-modal-lg1" tabindex="-1" role="dialog" aria-hidden="true">
                                        <div class="modal-dialog modal-lg">
                                            <div class="modal-content">
                                                <div class="modal-header">
                                                  
                                                    <button type="button" class="close" data-dismiss="modal"><span>&times;</span>
                                                    </button>
                                                </div>
                                                <div class="modal-body">
                                              
                                            <div class="col-xl-12 col-xxl-12 col-sm-6">
                                                <div class="card">
                                                    <div class="card-header">
                                                       <h5 class="card-title"></h5>
                                                    </div>
                                                   
                                                   <div class="card-body" id="emp_details">
                                              
                                                    </div>
                                                </div>
                                            </div>



                                                </div>
                                                <div class="modal-footer">
                              
                                                <div class="modal-footer">
                                                    <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
                                                  
                                                </div>
                                            </div>
                                        </div>
                                    </div>
            
                                  </div>
          
                                    
    <!-- Required vendors -->
         <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
         <style type="text/css" media="print">
  @page { size: landscape; }
</style>
        <style>
        .redborder{
            border:1px solid red;
        }
        </style>

    <script type='text/javascript'>
     document.getElementById("btnPrint").onclick = function () {
    printElement(document.getElementById("printThis"));
}

        function printElement(elem) {
            var domClone = elem.cloneNode(true);
            
            var $printSection = document.getElementById("printSection");
            
            if (!$printSection) {
                var $printSection = document.createElement("div");
                $printSection.id = "printSection";
                document.body.appendChild($printSection);
            }
            
            $printSection.innerHTML = "";
            $printSection.appendChild(domClone);
            window.print();
        }


      function delete_data(parameter_id) { 
        var id = parameter_id;
        //var mold = mold;
          var mold_id = $("#mold").val();

           if (confirm('Are you sure you want to Delete.?')) {
         $.ajax({
                type:'POST',
                url:'<?php echo base_url('Requisition/delete_parameter/'); ?>'+id,
                data:id,
                dataType:'json',
                success:function(data){
                    console.log('first'+data.status);
                    
                        console.log('second'+data.status);
                        //debugger;
                        $('#party_danger').show().html('Deleted Successfully');
                      setTimeout(function(){location.href="<?php echo base_url('Requisition/inspection/'); ?>"+mold_id} , 3000);
                    
                },
                error:function(data){console.log(data.responseText);}
            });
          }
        } 

        $("#sno_num").change(function() {
    
        var id =  this.value;

        $.ajax({
                    type:'POST',
                    url:'<?php echo base_url('Requisition/get_all_inspec'); ?>',
                    data:{id:id},
                    dataType:'json',
                    success:function(data){
                        //console.log(data[0].material_code);
                         $('.descrip').val(data[0].descrip);
                         $('.parameters').val(data[0].parameters);
                         $('.maxrange').val(data[0].max_range);
                         $('.minrange').val(data[0].min_range);
                          $('.para_id').val(data[0].id);
                         
                        //$('.code').val(data[0].pro_code);
                       
                       //$('.weight').val(data[0].weight);
                       
                    },
                    error:function(data){console.log(data.responseText);}
                });

    });


         $("#click_to_submit").click(function() {
    
        var so_id = $("#so_id").val();
        var mold = $("#mold").val();

        var product_id = $("#product_id").val();
          
            if (confirm('Are you sure you want to Finish .?')) {
        $.ajax({
                    type:'POST',
                    url:'<?php echo base_url('Requisition/complete_inspection'); ?>',
                    data:{so_id:so_id,mold:mold,product_id:product_id},
                    dataType:'json',
                    success:function(data){
                        
                        if(data.status === 'true'){
                        console.log('second'+data.status);
                        $('#add_inspec_success_production').show().html('Added Successfully').hide(3000);
                        setTimeout(function(){location.href="<?php echo base_url('Requisition/product_inspection/'); ?>"} , 1000);
                    }else{
                        console.log('third'+data);          
                    }
                    },
                    error:function(data){console.log(data.responseText);}
                });
      }
    });


        


  var add_inspec = $('#add_inspec');   
    
    add_inspec.on('submit',function(e){

        e.preventDefault();
        $("#emp_add").attr('disabled', true);
       
         var add_inspecdata = add_inspec.serialize();
         var so_id = $("input#so_id").val();
          var para_id = $("input#para_id").val();
          var sample_size = $("input#sample_size").val();
            var user_id = $("input#user_id").val();
            var created = $("input#created").val();
            var modified = $("input#modified").val();
            if (confirm('Are you sure you want to Add .?')) {
            $.ajax({
             url:'<?php echo base_url('Requisition/inspection'); ?>',
             type:"post",
             data:new FormData(this),
             processData:false,
             contentType:false,
             cache:false,
             async:false,
             dataType:'json',
             success: function(data){
            
                    if(data.status === 'true'){
                        console.log('second'+data.status);
                        $('#add_inspec_success').show().html('added Successfully').hide(3000);
                      location.reload();
                    }else if (data.status === 'false'){
                        console.log('third'+data);     

                         $('#condition').show().html('Data Already Exists..!');     
                    }
                }
             });
       }
    });



    function view_ins(id) { 
      var id =  id;
      //alert(id);

      $.ajax({
                type:'POST',
                url:'<?php echo base_url('Requisition/view_ins_samples_details'); ?>',
                data:{id:id},
                dataType:'json',
                success:function(data){
                    //console.log('first'+data.status);
                    //if(data.status === 'true'){
                     $('#emp_details').show().html(data.html);
                       //$('#bom_details').show(data);
                   /* }else{
                        //console.log('third'+data);          
                    }*/
                },
                error:function(data){console.log(data.responseText);}
            });
       
        } 



         $("#update_status").click(function() {
    
        var id =  this.value;
       // alert(id);
        $.ajax({
                    type:'POST',
                    url:'<?php echo base_url('Requisition/update_status'); ?>',
                    data:{id:id},
                    dataType:'json',
                    success:function(data){
                         if(data.status === 'true'){
                        console.log('second'+data.status);
                       
                              location.reload();
                            }else{
                                console.log('third'+data);          
                            }
                               
                    },
                    error:function(data){console.log(data.responseText);}
                });

    });

           
     function btnExport_monthly()
{
    
    var tab_text="<table border='2px'><tr bgcolor='#ebebeb'>";
    var textRange; var j=0;
    tab = document.getElementById('example5'); // id of table

    for(j = 0 ; j < tab.rows.length ; j++) 
    {     
        tab_text=tab_text+tab.rows[j].innerHTML+"</tr>";
        //tab_text=tab_text+"</tr>";
    }

    tab_text=tab_text+"</table>";
    tab_text= tab_text.replace(/<A[^>]*>|<\/A>/g, "");//remove if u want links in your table
    tab_text= tab_text.replace(/<img[^>]*>/gi,""); // remove if u want images in your table
    tab_text= tab_text.replace(/<input[^>]*>|<\/input>/gi, ""); // reomves input params


    var ua = window.navigator.userAgent;
    var msie = ua.indexOf("MSIE "); 

    if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./))      // If Internet Explorer
    {
        txtArea2.document.open("txt/html","replace");
        txtArea2.document.write(tab_text);
        txtArea2.document.close();
        txtArea2.focus(); 
        sa=txtArea2.document.execCommand("SaveAs",true,"Generation_School_Report");
    }  
    else                 //other browser not tested on IE 11
        sa = window.open('data:application/vnd.ms-excel,' + encodeURIComponent(tab_text));  

    return (sa);
}
    </script>  
    
    <script>
  $(document).ready(function() {
    $("#sample_1").on("input", function() {
        var minRangeValue = parseFloat($("#minrange").val());
        var maxRangeValue = parseFloat($("#maxrange").val());
        var sampleValue = parseFloat($(this).val());

        if (!isNaN(sampleValue)) {
            if (minRangeValue <= sampleValue && sampleValue <= maxRangeValue ){
                $(this).removeClass("error");
                $(this).addClass("success");
            } else {
                $(this).removeClass("success");
                $(this).addClass("error");
            }
        } else {
            $(this).removeClass("success");
            $(this).removeClass("error");
        }
    });

    $("#sample_2").on("input", function() {
        var minRangeValue = parseFloat($("#minrange").val());
        var maxRangeValue = parseFloat($("#maxrange").val());
        var sampleValue = parseFloat($(this).val());

        if (!isNaN(sampleValue)) {
            if (minRangeValue <= sampleValue && sampleValue <= maxRangeValue){
                $(this).removeClass("error");
                $(this).addClass("success");
            } else {
                $(this).removeClass("success");
                $(this).addClass("error");
            }
        } else {
            $(this).removeClass("success");
            $(this).removeClass("error");
        }
    });
});

$("#sample_3").on("input", function() {
        var minRangeValue = parseFloat($("#minrange").val());
        var maxRangeValue = parseFloat($("#maxrange").val());
        var sampleValue = parseFloat($(this).val());

        if (!isNaN(sampleValue)) {
            if (minRangeValue <= sampleValue && sampleValue <= maxRangeValue){
                $(this).removeClass("error");
                $(this).addClass("success");
            } else {
                $(this).removeClass("success");
                $(this).addClass("error");
            }
        } else {
            $(this).removeClass("success");
            $(this).removeClass("error");
        }
    });

    $("#sample_4").on("input", function() {
        var minRangeValue = parseFloat($("#minrange").val());
        var maxRangeValue = parseFloat($("#maxrange").val());
        var sampleValue = parseFloat($(this).val());

        if (!isNaN(sampleValue)) {
            if (minRangeValue <= sampleValue && sampleValue <= maxRangeValue){
                $(this).removeClass("error");
                $(this).addClass("success");
            } else {
                $(this).removeClass("success");
                $(this).addClass("error");
            }
        } else {
            $(this).removeClass("success");
            $(this).removeClass("error");
        }
    });

    $("#sample_5").on("input", function() {
        var minRangeValue = parseFloat($("#minrange").val());
        var maxRangeValue = parseFloat($("#maxrange").val());
        var sampleValue = parseFloat($(this).val());

        if (!isNaN(sampleValue)) {
            if (minRangeValue <= sampleValue && sampleValue <= maxRangeValue){
                $(this).removeClass("error");
                $(this).addClass("success");
            } else {
                $(this).removeClass("success");
                $(this).addClass("error");
            }
        } else {
            $(this).removeClass("success");
            $(this).removeClass("error");
        }
    });

    $("#sample_6").on("input", function() {
        var minRangeValue = parseFloat($("#minrange").val());
        var maxRangeValue = parseFloat($("#maxrange").val());
        var sampleValue = parseFloat($(this).val());

        if (!isNaN(sampleValue)) {
            if (minRangeValue <= sampleValue && sampleValue <= maxRangeValue){
                $(this).removeClass("error");
                $(this).addClass("success");
            } else {
                $(this).removeClass("success");
                $(this).addClass("error");
            }
        } else {
            $(this).removeClass("success");
            $(this).removeClass("error");
        }
    });

    $("#sample_7").on("input", function() {
        var minRangeValue = parseFloat($("#minrange").val());
        var maxRangeValue = parseFloat($("#maxrange").val());
        var sampleValue = parseFloat($(this).val());

        if (!isNaN(sampleValue)) {
            if (minRangeValue <= sampleValue && sampleValue <= maxRangeValue){
                $(this).removeClass("error");
                $(this).addClass("success");
            } else {
                $(this).removeClass("success");
                $(this).addClass("error");
            }
        } else {
            $(this).removeClass("success");
            $(this).removeClass("error");
        }
    });

    $("#sample_8").on("input", function() {
        var minRangeValue = parseFloat($("#minrange").val());
        var maxRangeValue = parseFloat($("#maxrange").val());
        var sampleValue = parseFloat($(this).val());

        if (!isNaN(sampleValue)) {
            if (minRangeValue <= sampleValue && sampleValue <= maxRangeValue){
                $(this).removeClass("error");
                $(this).addClass("success");
            } else {
                $(this).removeClass("success");
                $(this).addClass("error");
            }
        } else {
            $(this).removeClass("success");
            $(this).removeClass("error");
        }
    });

    $("#sample_9").on("input", function() {
        var minRangeValue = parseFloat($("#minrange").val());
        var maxRangeValue = parseFloat($("#maxrange").val());
        var sampleValue = parseFloat($(this).val());

        if (!isNaN(sampleValue)) {
            if (minRangeValue <= sampleValue && sampleValue <= maxRangeValue){
                $(this).removeClass("error");
                $(this).addClass("success");
            } else {
                $(this).removeClass("success");
                $(this).addClass("error");
            }
        } else {
            $(this).removeClass("success");
            $(this).removeClass("error");
        }
    });


    $("#sample_10").on("input", function() {
        var minRangeValue = parseFloat($("#minrange").val());
        var maxRangeValue = parseFloat($("#maxrange").val());
        var sampleValue = parseFloat($(this).val());

        if (!isNaN(sampleValue)) {
            if (minRangeValue <= sampleValue && sampleValue <= maxRangeValue){
                $(this).removeClass("error");
                $(this).addClass("success");
            } else {
                $(this).removeClass("success");
                $(this).addClass("error");
            }
        } else {
            $(this).removeClass("success");
            $(this).removeClass("error");
        }
    });

    $("#sample_11").on("input", function() {
        var minRangeValue = parseFloat($("#minrange").val());
        var maxRangeValue = parseFloat($("#maxrange").val());
        var sampleValue = parseFloat($(this).val());

        if (!isNaN(sampleValue)) {
            if (minRangeValue <= sampleValue && sampleValue <= maxRangeValue){
                $(this).removeClass("error");
                $(this).addClass("success");
            } else {
                $(this).removeClass("success");
                $(this).addClass("error");
            }
        } else {
            $(this).removeClass("success");
            $(this).removeClass("error");
        }
    });

    $("#sample_12").on("input", function() {
        var minRangeValue = parseFloat($("#minrange").val());
        var maxRangeValue = parseFloat($("#maxrange").val());
        var sampleValue = parseFloat($(this).val());

        if (!isNaN(sampleValue)) {
            if (minRangeValue <= sampleValue && sampleValue <= maxRangeValue){
                $(this).removeClass("error");
                $(this).addClass("success");
            } else {
                $(this).removeClass("success");
                $(this).addClass("error");
            }
        } else {
            $(this).removeClass("success");
            $(this).removeClass("error");
        }
    });

    $("#sample_13").on("input", function() {
        var minRangeValue = parseFloat($("#minrange").val());
        var maxRangeValue = parseFloat($("#maxrange").val());
        var sampleValue = parseFloat($(this).val());

        if (!isNaN(sampleValue)) {
            if (minRangeValue <= sampleValue && sampleValue <= maxRangeValue){
                $(this).removeClass("error");
                $(this).addClass("success");
            } else {
                $(this).removeClass("success");
                $(this).addClass("error");
            }
        } else {
            $(this).removeClass("success");
            $(this).removeClass("error");
        }
    });

    $("#sample_14").on("input", function() {
        var minRangeValue = parseFloat($("#minrange").val());
        var maxRangeValue = parseFloat($("#maxrange").val());
        var sampleValue = parseFloat($(this).val());

        if (!isNaN(sampleValue)) {
            if (minRangeValue <= sampleValue && sampleValue <= maxRangeValue){
                $(this).removeClass("error");
                $(this).addClass("success");
            } else {
                $(this).removeClass("success");
                $(this).addClass("error");
            }
        } else {
            $(this).removeClass("success");
            $(this).removeClass("error");
        }
    });

    $("#sample_15").on("input", function() {
        var minRangeValue = parseFloat($("#minrange").val());
        var maxRangeValue = parseFloat($("#maxrange").val());
        var sampleValue = parseFloat($(this).val());

        if (!isNaN(sampleValue)) {
            if (minRangeValue <= sampleValue && sampleValue <= maxRangeValue){
                $(this).removeClass("error");
                $(this).addClass("success");
            } else {
                $(this).removeClass("success");
                $(this).addClass("error");
            }
        } else {
            $(this).removeClass("success");
            $(this).removeClass("error");
        }
    });


    $("#sample_16").on("input", function() {
        var minRangeValue = parseFloat($("#minrange").val());
        var maxRangeValue = parseFloat($("#maxrange").val());
        var sampleValue = parseFloat($(this).val());

        if (!isNaN(sampleValue)) {
            if (minRangeValue <= sampleValue && sampleValue <= maxRangeValue){
                $(this).removeClass("error");
                $(this).addClass("success");
            } else {
                $(this).removeClass("success");
                $(this).addClass("error");
            }
        } else {
            $(this).removeClass("success");
            $(this).removeClass("error");
        }
    });

    $("#sample_17").on("input", function() {
        var minRangeValue = parseFloat($("#minrange").val());
        var maxRangeValue = parseFloat($("#maxrange").val());
        var sampleValue = parseFloat($(this).val());

        if (!isNaN(sampleValue)) {
            if (minRangeValue <= sampleValue && sampleValue <= maxRangeValue){
                $(this).removeClass("error");
                $(this).addClass("success");
            } else {
                $(this).removeClass("success");
                $(this).addClass("error");
            }
        } else {
            $(this).removeClass("success");
            $(this).removeClass("error");
        }
    });

    $("#sample_18").on("input", function() {
        var minRangeValue = parseFloat($("#minrange").val());
        var maxRangeValue = parseFloat($("#maxrange").val());
        var sampleValue = parseFloat($(this).val());

        if (!isNaN(sampleValue)) {
            if (minRangeValue <= sampleValue && sampleValue <= maxRangeValue){
                $(this).removeClass("error");
                $(this).addClass("success");
            } else {
                $(this).removeClass("success");
                $(this).addClass("error");
            }
        } else {
            $(this).removeClass("success");
            $(this).removeClass("error");
        }
    });

    $("#sample_19").on("input", function() {
        var minRangeValue = parseFloat($("#minrange").val());
        var maxRangeValue = parseFloat($("#maxrange").val());
        var sampleValue = parseFloat($(this).val());

        if (!isNaN(sampleValue)) {
            if (minRangeValue <= sampleValue && sampleValue <= maxRangeValue){
                $(this).removeClass("error");
                $(this).addClass("success");
            } else {
                $(this).removeClass("success");
                $(this).addClass("error");
            }
        } else {
            $(this).removeClass("success");
            $(this).removeClass("error");
        }
    });

    $("#sample_20").on("input", function() {
        var minRangeValue = parseFloat($("#minrange").val());
        var maxRangeValue = parseFloat($("#maxrange").val());
        var sampleValue = parseFloat($(this).val());

        if (!isNaN(sampleValue)) {
            if (minRangeValue <= sampleValue && sampleValue <= maxRangeValue){
                $(this).removeClass("error");
                $(this).addClass("success");
            } else {
                $(this).removeClass("success");
                $(this).addClass("error");
            }
        } else {
            $(this).removeClass("success");
            $(this).removeClass("error");
        }
    });

    $("#sample_21").on("input", function() {
        var minRangeValue = parseFloat($("#minrange").val());
        var maxRangeValue = parseFloat($("#maxrange").val());
        var sampleValue = parseFloat($(this).val());

        if (!isNaN(sampleValue)) {
            if (minRangeValue <= sampleValue && sampleValue <= maxRangeValue){
                $(this).removeClass("error");
                $(this).addClass("success");
            } else {
                $(this).removeClass("success");
                $(this).addClass("error");
            }
        } else {
            $(this).removeClass("success");
            $(this).removeClass("error");
        }
    });

    $("#sample_22").on("input", function() {
        var minRangeValue = parseFloat($("#minrange").val());
        var maxRangeValue = parseFloat($("#maxrange").val());
        var sampleValue = parseFloat($(this).val());

        if (!isNaN(sampleValue)) {
            if (minRangeValue <= sampleValue && sampleValue <= maxRangeValue){
                $(this).removeClass("error");
                $(this).addClass("success");
            } else {
                $(this).removeClass("success");
                $(this).addClass("error");
            }
        } else {
            $(this).removeClass("success");
            $(this).removeClass("error");
        }
    });

    $("#sample_23").on("input", function() {
        var minRangeValue = parseFloat($("#minrange").val());
        var maxRangeValue = parseFloat($("#maxrange").val());
        var sampleValue = parseFloat($(this).val());

        if (!isNaN(sampleValue)) {
            if (minRangeValue <= sampleValue && sampleValue <= maxRangeValue){
                $(this).removeClass("error");
                $(this).addClass("success");
            } else {
                $(this).removeClass("success");
                $(this).addClass("error");
            }
        } else {
            $(this).removeClass("success");
            $(this).removeClass("error");
        }
    });

    $("#sample_24").on("input", function() {
        var minRangeValue = parseFloat($("#minrange").val());
        var maxRangeValue = parseFloat($("#maxrange").val());
        var sampleValue = parseFloat($(this).val());

        if (!isNaN(sampleValue)) {
            if (minRangeValue <= sampleValue && sampleValue <= maxRangeValue){
                $(this).removeClass("error");
                $(this).addClass("success");
            } else {
                $(this).removeClass("success");
                $(this).addClass("error");
            }
        } else {
            $(this).removeClass("success");
            $(this).removeClass("error");
        }
    });
</script>
  <?php  $this->load->view('footer'); ?>
        
</body>

<!-- Mirrored from edumin.dexignlab.com/xhtml/add-departments.html by HTTrack Website Copier/3.x [XR&CO'2014], Tue, 17 Nov 2020 13:56:15 GMT -->
</html>