<!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 -->
     

</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">
                    <div class="col-sm-6 p-md-0">
                        <div class="welcome-text">
                            <h4><?php echo mold_code($this->uri->segment(3)); ?></h4>

                            
                        </div>
                    </div>
                    <div class="col-sm-6 p-md-0 justify-content-sm-end mt-2 mt-sm-0 d-flex">
                        <ol class="breadcrumb">
                          <h3><?php echo ref_no_para($this->uri->segment(3)); ?></h3>
                           
                        </ol>
                    </div>
                </div>
                
                <div class="row">


                    <div class="col-12">
            
                               
                            
                          <div class="col-xl-12 col-xxl-12 col-sm-12">
                             <div class="card">

                               <?php echo form_open(base_url(''),array('class'=>"form-horizontal add_parameter", 'id'=>"add_parameter")); ?>
                                    
                                        <?php if($this->session->flashdata('parameter_success')){ ?>
                                <div class="alert alert-success solid" style='text-align:center;'><?php echo $this->session->flashdata('parameter_success'); ?></div>
                            <?php } ?> 
                                <div class="card-body">
                                    <div id='parameter_success' class='alert alert-success solid' style='display:none;'></div>
                                       <div class="row">
                                             

                                            <input type="hidden" name="mold_id" id="mold_id" value="<?php echo $this->uri->segment(3); ?>">
                                            <?php if($ref[0]['mold_id'] != $this->uri->segment(3)){ ?>
                                            <div class="col-lg-4 col-md-6 col-sm-12">
                                                    <div class="form-group">
                                                        <label class="form-label">Ref No:</label>
                                                        <input type="text" name="ref_no" id="ref_no"  class="form-control ref_no">
                                                     </div>
                                                    
                                                </div>
                                              <?php }else{
                                                echo"";
                                              } ?>
                                                  <div class="col-lg-4 col-md-6 col-sm-12">
                                            <div class="form-group">
                                                <label class="form-label">Type</label>
                                                <select name="type" id="type" required class="form-control" tabindex="-98">
                                                    <option value="">Select Option</option>
                                                    
                                                            <option value="1">SIZE/ WEIGHT</option>
                                                            <option value="2">COLOR</option>
                                                            <option value="3">ENGRAVING</option>
                                                            <option value="4">FITTING</option>
                                                    </select>
                                            </div>
                                        </div>
                                            <div class="col-lg-4 col-md-6 col-sm-12">
                                            <div class="form-group">
                                                <label class="form-label">SNO</label>
                                                <select name="sno_num" id="sno_num" required class="form-control" tabindex="-98">
                                                    <option value="">Select Option</option>
                                                    
                                                            <option value="A">A</option>
                                                            <option value="B">B</option>
                                                            <option value="C">C</option>
                                                            <option value="D">D</option>
                                                            <option value="E">E</option>
                                                            <option value="F">F</option>
                                                            <option value="G">G</option>
                                                            <option value="H">H</option>
                                                            <option value="I">I</option>
                                                            <option value="J">J</option>
                                                                <option value="K">K</option>
                                                                <option value="L">L</option>
                                                    </select>
                                            </div>
                                        </div>


                                            
                                                <div class="col-lg-4 col-md-6 col-sm-12">
                                                    <div class="form-group">
                                                        <label class="form-label">Descriptions:</label>
                                                        <input type="text" name="descrip" id="descrip"  class="form-control grade">
                                                     </div>
                                                    
                                                </div>
                                                <div class="col-lg-4 col-md-6 col-sm-12">
                                                <div class="form-group">
                                                <label class="form-label">Unit</label>
                                                <select name="units" id="units" required class="form-control" tabindex="-98">
                                                <option value="">Select Option</option>
                                                <?php if(!empty($units)){ ?>
                                              <?php foreach ($units as  $getunits) {
                                                ?>
                                            <option value="<?php echo $getunits['id']; ?>"><?php echo $getunits['names']; ?></option>
                                             <?php } } ?> 
                                              </select>
                                            </div>
                                                </div>
                                                

                                                 <div class="col-lg-4 col-md-6 col-sm-12">
                                                <div class="form-group">
                                                        <label class="form-label">Min Range:</label>
                                                        <input type="text" name="max_range" id="max_range"  class="form-control quot_ref">
                                                     </div>
                                                 </div>


                                                 <div class="col-lg-4 col-md-6 col-sm-12">
                                                <div class="form-group">
                                                        <label class="form-label">Max Range:</label>
                                                        <input type="text" name="min_range" id="min_range"  class="form-control quot_ref">
                                                     </div>
                                                 </div>

                                                  <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>
                                     <div class="col-lg-2 col-md-6 col-sm-12"> 
                                              <div class="form-group">  
                                       <button type="submit" id="dis_submit" class="btn btn-primary">Save <i class="icon-arrow-right14 position-right"></i></button>
                                       </div> </div> 
                                    </div>

                                     <?php form_close();?>
                                </div>
                            </div>
                            <div class="col-12">
                                 <div class="card">
                            <div class="card-body">
                                <button type="button" class="btn btn-rounded btn-success" onclick="btnExport_monthly();"><span class="btn-icon-left text-success"><i class="fa fa-download color-success"></i>
                                    </span>Download</button>
                               <br/><br/><br/>
                                <div class="table-responsive">
                                    <table id="example5" class="display" style="min-width: 845px">
                                        <thead>
                                            <tr>
                                                <th>Type</th>
                                                <th>SNO</th>
                                                <th>Description</th>
                                               
                                                <th>Unit</th>
                                                <th>Max</th>
                                                <th>Min</th>
                                                <th>Action</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php if(!empty($get_mold_parameter)){ ?>
                                              <?php foreach ($get_mold_parameter as  $get_mold_parameters) {
                                                ?>
                                            <tr>
                                            <td><?php
                                                if($get_mold_parameters['type']==1){
                                                    echo "SIZE/ WEIGHT";
                                                }else if($get_mold_parameters['type']==2){
                                                    echo "COLOR";
                                                }elseif($get_mold_parameters['type']==3){
                                                    echo "ENGRAVING";
                                                }elseif($get_mold_parameters['type']==4){
                                                    echo "FITTING";
                                                }else{
                                                    echo "";
                                                }
                                             ?></td>
                                              <td><?php echo $get_mold_parameters['sno_num']; ?></td>
                                              <td><?php echo $get_mold_parameters['descrip']; ?></td>
                                              <td><?php echo get_unit_name($get_mold_parameters['units']); ?></td>
                                              <td><?php echo $get_mold_parameters['max_range']; ?></td>
                                              <td><?php echo $get_mold_parameters['min_range']; ?></td>
                                              <td>
                                                   <!--  <a href="<?php //echo base_url('Admin/edit_get_mold_parameter/'.$get_mold_parameters['id']); ?>" class="btn btn-sm btn-primary"><i class="la la-pencil"></i></a> -->
                                                    <a href="javascript:void(0);" onclick="delete_data(<?php echo $get_mold_parameters['id']; ?>)" class="btn btn-sm btn-danger"><i class="la la-trash-o"></i></a>
                                                    
                                                </td>
                                               </tr>
                                             <?php } } ?>
                                                
                                        </tbody>
                                        <tbody>
                                          
                                            
                                        </tbody>
                                    </table>
                                </div>
                                
                            </div>
                            </div>
                            </div>
                        </div>
                    </div>

                   
                </div>
            </div>
       
        <!--**********************************
            Content body end
        ***********************************-->


        <!--**********************************
            Footer start
        ***********************************-->
        
        <!--**********************************
            Footer end
        ***********************************-->

        <!--**********************************
           Support ticket button start
        ***********************************-->

        <!--**********************************
           Support ticket button end
        ***********************************-->


    </div>
    

    <div class="modal fade bd-example-modal-lg" style="width: 100%;" 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="card-body" id="invoice_details">
                    
                          </div>
                      



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



         <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
        <style>
        .redborder{
            border:1px solid red;
        }
        </style>

    <script type='text/javascript'>

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


        
    var add_order = $('#add_parameter');   
    
    add_order.on('submit',function(e){
  $("#dis_submit").attr('disabled', true);
        e.preventDefault();
        
        var add_add_order = add_order.serialize();
         var p_id = $('#mold_id').val();
      
            $.ajax({
                type:'POST',
                url:'<?php echo base_url('Admin/qc_parameter'); ?>',
                data:add_add_order,
                dataType:'json',
                success:function(data){
                
                    console.log('first'+data.status);
                    if(data.status === 'true'){
                        console.log('second'+data.status);
                        $('#parameter_success').show().html('Parameter added Successfully');
                       setTimeout(function(){location.href="<?php echo base_url('Admin/qc_parameter/'); ?>"+p_id} , 2000);
                    }else{
                        console.log('third'+data);          
                    }
                },
                error:function(data){console.log(data.responseText);}
            });
       // }
    });

    function delete_data(id) { 
        var id = id;
        if (confirm('Are you sure you want to Delete.?')) {
  

        var pro_id = $('#mold_id').val();
         $.ajax({
                type:'POST',
                url:'<?php echo base_url('Admin/mold_delete_parameter/'); ?>'+id,
                data:id,
                dataType:'json',
                success:function(data){
                    console.log('first'+data.status);
                    
                        console.log('second'+data.status);
                        //debugger;
                        $('#mold_bom_danger').show().html('Deleted Successfully');
                       setTimeout(function(){location.href="<?php echo base_url('Admin/qc_parameter/'); ?>"+pro_id} , 2000);
                    
                },
                error:function(data){console.log(data.responseText);}
            });

         } else {
  
            }
        } 



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

        $.ajax({
                    type:'POST',
                    url:'<?php echo base_url('Purchase_order/get_code'); ?>',
                    data:{id:id},
                    dataType:'json',
                    success:function(data){
                        //console.log(data[0].material_code);
                          //$('#code').val(data);
                        $('.code').val(data[0].vendors_code);
                       
                       //$('.weight').val(data[0].weight);
                       
                    },
                    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>   

       <?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> 