<!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>QC Machine</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">
                            <li class="breadcrumb-item"><a href="index.html">Home</a></li>
                            <li class="breadcrumb-item active"><a href="javascript:void(0);">QC Machine</a></li>
                            <li class="breadcrumb-item active"><a href="javascript:void(0);">Add Machine</a></li>
                        </ol>
                    </div>
                </div>
        
        <div class="row">


                <div class="col-12">
                  <div class="card">
                       <div class="card-header">
             <?php echo form_open(base_url(''),array('class'=>"form-horizontal add_qc_machine", 'id'=>"add_qc_machine")); ?>
                                    
              
        <div id='add_qc_machines' class='alert alert-success solid' style='display:none;'></div>   
<div class="row">
         

       

          <input type="hidden" name="user_id" id="user_id" value="<?php echo $this->session->userdata('id');?>">

           
                       <div class="col-lg-3 col-md-6 col-sm-12">
                           <div class="form-group">
                                <label class="form-label">Select Shift:</label>
                                 <select class="form-control day_night" data-live-search="true"   name="day_night" required id="day_night">
                                  <?php if($get_machine_qc[0]['day_night']==1){ ?>
                                <option value="1">Day</option>
                                 <option value="1">Day</option>
                                <option value="2">Night</option>
                                <?php }else if($get_machine_qc[0]['day_night']==2){ ?>
                                   <option value="2">Night</option>
                                    <option value="1">Day</option>
                                <option value="2">Night</option>
                                <?php } ?>
                               
                            </select>
                             </div> 
                             
                           </div>

                    


                            <div class="col-lg-3 col-md-6 col-sm-12">
                                            <div class="form-group">
                                                <label class="form-label">Machine Type:</label>
                                                <select data-live-search="true" name="machine_type"  id="machine_type" class="form-control" tabindex="-98">
                                                   
                                                        <?php  if($get_machine_qc[0]['machine_type']==1){ ?>
                                                             <?php echo "<option value='1'>Blow</option>";?>
                                                        <?php }else if($get_machine_qc[0]['machine_type']==2){ ?>
                                                             <?php echo "<option value='2'>Injection</option>"; ?>
                                                        <?php } ?>
                                                    </option>
                                                    <option value="2">Injection</option>
                                                   <option value="1">Blow</option>
                                                  
                                                   
                                                    </select>
                                            </div>
                                        </div>



                         <div class="col-lg-3 col-md-6 col-sm-12">
                          <div class="form-group product_id">
                            <label class="form-label">Machine:</label>
                            <select class="form-control machine_id"  data-live-search="true"  name="machine_id" required id="machine_id">
                                <?php if($get_machine_qc[0]['machine_id']!=0){ ?>
                                <option value="<?php echo $get_machine_qc[0]['machine_id']; ?>"><?php echo machine_name($get_machine_qc[0]['machine_id']); ?></option>
                                <?php foreach($get_machine_data as $get_qc_machines){
                                                 ?>
                                        
                                      <option value="<?php echo $get_qc_machines['id']; ?>"><?php echo $get_qc_machines['machine_name']; ?></option>
                                      <?php 
                                             } 

                                        }else if($get_machine_qc[0]['machine_id']==0){ ?>

                                  
                                     <?php foreach($get_machine_data as $get_qc_machines){
                                                 ?>
                                       <option value="<?php echo $get_qc_machines['id']; ?>"><?php echo $get_qc_machines['machine_name']; ?></option>
                                     

                              <?php } }  ?>

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

                            <div class="col-lg-3 col-md-6 col-sm-12">
                          <div class="form-group product_id">
                            <label class="form-label">Moulds:</label>
                            <select class="form-control product_id2"  data-live-search="true"  name="product_id" required id="product_id">
                                <?php if($get_machine_qc[0]['product_id']!=0){ ?>
                                <option value="<?php echo $get_machine_qc[0]['product_id']; ?>"><?php echo product_name($get_machine_qc[0]['product_id']); ?></option>

                                    <?php foreach ($get_product as $get_products) { ?>
                                        <?php  if($get_products['product_id']==0) { ?>
                                        
                                        <?php echo ""; ?>
                                        <?php }else{ ?>
                                         <option value="<?php echo $get_products['product_id']; ?>">
                                            <?php echo product_name($get_products['product_id']); ?></option>
                                   <?php } ?>
                                       <?php } ?>

                              <?php }else{ ?>

                                   <?php foreach ($get_product as $get_products) { ?>
                                        <?php  if($get_products['product_id']==0) { ?>
                                        
                                        <?php echo ""; ?>
                                        <?php }else{ ?>
                                         <option value="<?php echo $get_products['product_id']; ?>">
                                            <?php echo product_name($get_products['product_id']); ?></option>
                                   <?php } ?>
                                       <?php } } ?>
                               
                            </select>
                         </div>
                        </div>


                           <div class="col-lg-3 col-md-6 col-sm-12">
                          <div class="form-group">
                            <label class="form-label">Raw Materials:</label>
                            <select class="form-control material_id" data-live-search="true"  name="material_id" required id="material_id">
                                <option value="<?php echo $get_machine_qc[0]['material_id']; ?>"><?php echo material_name($get_machine_qc[0]['material_id']); ?></option>
                                <?php foreach ($get_materials as $get_raws) { ?>
                                  <option value="<?php echo $get_raws['id']; ?>"><?php echo $get_raws['name']; ?></option>

                               <?php } ?>
                            </select>
                         </div>
                        </div>


                         <div class="col-lg-3 col-md-6 col-sm-12">
                           <div class="form-group">
                                <label class="form-label">Report Date:</label>
                                  <input type="date" id="report_date" value="<?php echo $get_machine_qc[0]['report_date']; ?>" name="report_date" required="required"  class="form-control job">
                             </div> 
                             
                           </div> 

                           <div class="col-lg-3 col-md-6 col-sm-12">
                           <div class="form-group">
                                <label class="form-label">10 M.R.Mould:</label>
                                  <input type="number" id="mr_mould" value="<?php echo $get_machine_qc[0]['mr_mould']; ?>" name="mr_mould" required="required"  class="form-control mr_mould">
                             </div> 
                             
                           </div>


                           <div class="col-lg-3 col-md-6 col-sm-12">
                           <div class="form-group">
                                <label class="form-label">PCS Of Cavity:</label>
                                  <input type="text" id="pcs_cavity" name="pcs_cavity" value="<?php echo $get_machine_qc[0]['pcs_cavity']; ?>" required="required"  class="form-control pcs_cavity">
                             </div> 
                             
                           </div>


                           <div class="col-lg-3 col-md-6 col-sm-12">
                           <div class="form-group">
                                <label class="form-label">Weight:</label>
                                  <input type="text" id="weight" name="weight" value="<?php echo $get_machine_qc[0]['weight']; ?>" required="required"  class="form-control weight">
                             </div> 
                             
                           </div>

                         <div class="col-lg-3 col-md-6 col-sm-12">
                           <div class="form-group">
                                <label class="form-label">Finishing:</label>
                                 <select name="finishing" id="finishing" class="form-control finishing">
                                  <option value="<?php echo $get_machine_qc[0]['finishing']; ?>"><?php echo $get_machine_qc[0]['finishing']; ?></option>
                                  <option value="OK">OK</option>
                                  <option value="NOT OK">NOT OK</option>
                                 </select>
                             </div> 
                             
                           </div>


                           <div class="col-lg-3 col-md-6 col-sm-12">
                           <div class="form-group">
                                <label class="form-label">Fitting:</label>
                                 <select name="fitting" id="fitting"  class="form-control fitting">
                                  <option value="<?php echo $get_machine_qc[0]['fitting']; ?>"><?php echo $get_machine_qc[0]['fitting']; ?></option>
                                  <option value="OK">OK</option>
                                  <option value="NOT OK">NOT OK</option>
                                 </select>
                             </div> 
                             
                           </div>
                           
                           
                           <div class="col-lg-3 col-md-6 col-sm-12">
                           <div class="form-group">
                                <label class="form-label">Engriving:</label>
                                 <select name="engriving" id="engriving"  class="form-control engriving">
                                  <option value="<?php echo $get_machine_qc[0]['engriving']; ?>"><?php echo $get_machine_qc[0]['engriving']; ?></option>
                                  <option value="OK">OK</option>
                                  <option value="NOT OK">NOT OK</option>
                                 </select>
                             </div> 
                             
                           </div>


                           <div class="col-lg-3 col-md-6 col-sm-12">
                           <div class="form-group">
                                <label class="form-label">Color:</label>
                                  <input type="text" id="color" value="<?php echo $get_machine_qc[0]['color']; ?>" name="color" required="required"  class="form-control color">
                             </div> 
                             
                           </div>


                        <div class="col-lg-6 col-md-6 col-sm-12">
                            <div class="form-group">
                                <label class="form-label">Remarks:</label>
                                <textarea  class="form-control remarks" name="remarks" id="remarks"><?php echo $get_machine_qc[0]['remarks']; ?></textarea>  
                             </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">
                <input type="hidden" value="<?php echo date('Y-m-d'); ?>" name="insert_date" id="insert_date" class="form-control required">
               
            </div>
        </div>
                         <input type="hidden" value="<?php echo $this->uri->segment(3); ?>" name="id" id="id" required="required">
                 </div>
                  <button type="submit" id="dis_submit" class="btn btn-primary">Save <i class="icon-arrow-right14 position-right"></i></button>
                  <?php form_close();?>
                 
                            
                           
                          

                        </div>
                    </div>

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


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

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

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


    </div>
    <!--**********************************
        Main wrapper end
    ***********************************-->

    <!--**********************************
        Scripts
    ***********************************-->
  <!-- Required vendors -->
   

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


     
        
    var add_qc_machines = $('#add_qc_machine');   
    
    add_qc_machines.on('submit',function(e){
      $("#dis_submit").attr('disabled', true);
        e.preventDefault();
         var id = $('#id').val();
        var add_qc_machinesdata = add_qc_machines.serialize();
        
      
            $.ajax({
                type:'POST',
                url:'<?php echo base_url('Order_qc/edit_machine_qc/'); ?>'+id,
                data:add_qc_machinesdata,
                dataType:'json',
                success:function(data){
                    console.log('first'+data.status);
                    if(data.status === 'true'){
                        console.log('second'+data.status);
                       $('#add_qc_machines').show().html('Added Successfully');
                       location.href="<?php echo base_url('Order_qc/add_qc_machine'); ?>";
                    }else{
                        console.log('third'+data);          
                    }
                },
                error:function(data){console.log(data.responseText);}
            });
       // }
    });

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