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

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

  <button id="btnPrint" type="button" class="float-right btn btn-warning">Print</button>
<div id="printThis">
<div class="row">
                    <div class="col-lg-12">

                        <div class="card mt-3">
                            
                            <div class="card-header"><img src="<?php echo base_url();?>assets/logo.png" style="width:105px;"/><br/>
                                <span class="float-right">
                                    <strong>P.O #:</strong> <?php echo so_number_dc($get_plan_all[0]['so_id']); ?> <br/>
                                   
                                      <strong>Product: </strong><?php $product_id = get_so_product($get_plan_all[0]['so_id']); 
                                                                        echo get_ins_pro($product_id); ?></span>
                                </div>


                            <div class="card-body">
                                <div class="row mb-5">
                                    <div class="mt-4 col-xl-6 col-lg-6 col-md-6 col-sm-12">
                                          <h3>Production Plan Details:</h3>
                                    </div>
                                   
                                </div>
                                <div class="table-responsive">
                                    <table  id="example" class="table table-striped table-bordered" style="font-size:11px;">
                                        <thead>
                                            <tr>
                                                
                                                <th class="center">Job#</th>
                                                <th class="right">Product</th>
                                                <th class="right">Making Qty</th>
                                                <th class="right">Materials</th>
                                                <th class="right">BomQty</th>
                                                <th class="right">Unit</th> 
                                               <!--  <th class="right">InStock</th> -->
                                                <th class="right">Color</th>
                                                <th class="right">Color Qty</th>
                                                <th class="right">Color Unit</th>
                                                <th class="right">Specification</th>
                                                <th class="right">Mould</th>
                                                <th class="right">Date/Time</th>
                                                <th class="right">Remarks</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php 
                                          
                                            if(!empty($get_plan_all)) {?>
                                                <?php foreach ($get_plan_all as  $value) { ?>
                                                  
                                                 <td class="center"><strong><?php echo $value['job']; ?></strong></td>
                                                 <td class="left strong"><?php echo $value['product_name']; ?></td>
                                                 <td class="left"><?php echo $value['p_qty']; ?></td>
                                                 <td class="left"><?php echo material_name($value['material_id']); ?></td>
                                                 <td class="left"><?php echo $value['bom_qty']; ?></td>
                                                 <td class="left"><?php echo $value['bom_unit']; ?></td>
                                                <!--  <td class="right"><?php //echo $value['in_stock_qty']; ?>/Bag</td> -->
                                                 <td class="right"><?php
                                                    if($value['color_id']==0){
                                                            echo "-";
                                                    }else{
                                                            echo material_name($value['color_id']); 
                                                    }
                                                  ?></td>
                                                  <td class="right"><?php
                                                     if($value['cqty']==0){
                                                            echo "-";
                                                    }else{
                                                            echo $value['cqty']; 
                                                    }

                                                    ?></td>
                                                  <td class="right"><?php
                                                    if($value['bom_unit_color']==""){
                                                            echo "-";
                                                    }else{
                                                            echo $value['bom_unit_color']; 
                                                    }

                                                   ?></td>
                                                  
                                                 <td class="right"><?php echo $value['spec_no']; ?></td>

                                                 <td class="right"><?php echo mold_code($value['mold']); ?></td>
                                                 <td class="right"><?php echo $value['created']; ?></td>
                                                 <td><?php echo $value['remarks']; ?></td>
                                            </tr>


                                           <?php } } ?>
                                            
                                        </tbody>
                                    </table>
                                </div>




                               <div class="row">
                                  
                                    <div class="col-lg-12 col-sm-12 ml-auto">
                                        
                                        <!-- <table class="table table-clear">
                                            <tbody>
                                                  <?php if(!empty($get_plan_all)) { ?>
                                                <?php foreach ($get_plan_all as  $values) { ?>
                                                    <?php if($values['machine']!=""){ ?>
                                                <tr>
                                                    <td class="center"><strong>Machine</strong></td>
                                                    <td class="center"><?php echo machine_name($values['machine']); ?></td>
                                                </tr>

                                                <tr>
                                                    <td class="center"><strong>Expected Date</strong></td>
                                                    <td class="center"><?php echo $values['expected']; ?></td>
                                                </tr>
                                                <?php
                                                    }else{

                                                        echo "";
                                                    }
                                                 }

                                                }
                                            ?>
                                            </tbody>
                                        </table> -->



                                         <div class="table-responsive">
                                            <h3>Compound Production Materials</h3>
                                    <table  id="example" class="table table-striped table-bordered" style="font-size:11px;">
                                        <thead>
                                            <tr>
                                               
                                                <th class="center">SO#</th>
                                                <th class="right">Product</th>
                                                <th class="right">Material</th>
                                                <th class="right">Machine</th>
                                                <th class="right">QCR</th>
                                                 <th class="right">Qty</th>
                                                 <th class="right">Unit</th>
                                                 <th class="right">Waste Kg</th>
                                                 <th class="right">W Lot</th>
                                                <th class="right">Date/Time</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php
                                         
                                            if(!empty($get_plan_all_compund)) {?>
                                                <?php foreach ($get_plan_all_compund as  $value) { ?>
                                                    <?php

                                                    /*print_r($value['so_id']);
                                                    die;
*/                                                       $material_type = material_type_po($value['material_id']);

                                                       if($material_type !=3 && $value['so_id'] !=""){

                                                      ?>
                                                    <tr>
                                                        <td><?php $soid = get_so_production($value['id']);
                                                                     echo so_number_dc($soid); ?></td>
                                                        <td><?php echo product_name($value['product_id']); ?></td>
                                                        <td><?php 
                                                           echo material_name($value['material_id']); ?></td>
                                                        <td><?php   $so_id = $value['so_id'];
                                                            $product = $value['product_id'];
                                                            $get_machine_id = get_runing_machine($so_id,$product);

                                                            $machine =  machine_name($value['machine_id']);
                                                            if($machine !='NULL'){

                                                                echo $machine;
                                                            }

                                                          ?></td>
                                                        <td><?php echo $value['qcr']; ?></td>
                                                       
                                                        <td><?php echo $value['qty']; ?></td>
                                                        <td>Bag</td>
                                                        <td><?php echo $value['weight_wast']; ?></td>
                                                        <td><?php echo $value['wlot']; ?></td>
                                                        <td><?php echo $value['created']; ?></td>
                                                     
                                                    </tr>
                                               

                                        <?php }else if($value['so_id'] ==""){
                                          echo "";
                                        } } } ?>
                                           
                                        </tbody>
                                    </table>
                                </div>


                                <div class="table-responsive">
                                            <h3>Compound Production Color</h3>
                                    <table  id="example" class="table table-striped table-bordered" style="font-size:11px;">
                                        <thead>
                                            <tr>
                                               
                                                <th class="center">SO#</th>
                                                <th class="right">Product</th>
                                                <th class="right">Color Material</th>
                                                <th class="right">Machine</th>
                                                
                                                <th class="right">Ratio</th>
                                                <th class="right">Qty</th>
                                                <th class="right">Unit</th>
                                                <th class="right">Date/Time</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php
                                         
                                            if(!empty($get_plan_all_compund)) {?>
                                                <?php foreach ($get_plan_all_compund as  $value) { ?>
                                                    <?php

                                                    $material_type = material_type_po($value['material_id']);

                                                       if($material_type ==3){

                                                      ?>
                                                    <tr>
                                                        <td><?php   $soid = get_so_production($value['id']);
                                                                     echo so_number_dc($soid); ?></td>
                                                        <td><?php echo product_name($value['product_id']); ?></td>
                                                        <td><?php echo material_name($value['material_id']); ?></td>
                                                        <td><?php echo machine_name($value['machine_id']); ?></td>
                                                     
                                                       <!--  <td><?php //echo $value['color_code']; ?></td> -->
                                                        <td><?php echo $value['color_ratio']; ?></td>
                                                        <td><?php echo $value['qty']; ?></td>
                                                          <td>KG</td>
                                                        <td><?php echo $value['created']; ?></td>
                                                     
                                                    </tr>
                                               

                                        <?php } } } ?>
                                           
                                        </tbody>
                                    </table>
                                </div>

                              <h3>Line Clerence:</h3> <?php 

                              if(!empty($get_plan_all)) {?>

                                 <?php foreach ($get_plan_all as  $value) {

                                 $p_id = product_id($value['product_name']);
                                    $so_id = $value['so_id'];
                                    $condition_line =  get_machine_production_from_machine_remarks($so_id,$p_id);

                                   // print_r($condition_line);
                                  ?>

                               <?php if($condition_line !=""){ ?>
                                <?php 

                                @$checkline = condition_check_line($so_id,$p_id); 

                                if($checkline !=""){ ?>
                                <p><?php echo machine_name($condition_line); echo ": &check;"; ?> </p>
                                 <?php }else { ?>
                                 <p><?php echo machine_name($condition_line); echo ": &#x2718;"; ?> </p>
                               <?php } ?>
                            <?php }else{

                                echo "";
                            } }  } ?>


                                <h3>Product Inspection:</h3> <?php 

                              if(!empty($get_plan_all)) {?>

                                 <?php foreach ($get_plan_all as  $value) {

                                  $product_id = product_id($value['product_name']);
                                  $so_id = $value['so_id'];

                                 

                                    $check_idininspection =  check_idininspection($so_id,$product_id);
                                  ?>

                                           <?php if($check_idininspection !=""){ ?>

                                              <?php $p_name = product_name($check_idininspection); ?>

                                            <?php echo product_insepect($p_name); echo ": &check;"; ?> <br/>



                                          <?php }else{

                                           //echo product_insepect($p_name); echo ": &#x2718;";
                                       } }  } ?>
                                      


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

                
           
       <?php  $this->load->view('footer'); ?>
        
</body>
<script type="text/javascript">
    function myFunction()
        {
             var mywindow = window.open('', 'PRINT', 'height=400,width=600');
            window.print();
        }

      /*  function proceed(id)
        {
            var ids = id;
             
              $.ajax({
                type:'POST',
               
                url:'<?php echo base_url('Purchase_order/email_to_vendor/'); ?>'+ids,
                data:ids,
                dataType:'json',
                success:function(data){
                   
                    alert('ok');
                },
                error:function(data){console.log(data.responseText);}
            });
        }*/



        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();
}


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