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


<!-- Mirrored from edumin.dexignlab.com/xhtml/index-2.html by HTTrack Website Copier/3.x [XR&CO'2014], Thu, 19 Nov 2020 03:05:22 GMT -->
<head>
    <style>
      .highcharts-figure, .highcharts-data-table table {
    min-width: 310px; 
    max-width: 800px;
    margin: 1em auto;
}

#container {
    height: 400px;
}

.highcharts-data-table table {
    font-family: Verdana, sans-serif;
    border-collapse: collapse;
    border: 1px solid #EBEBEB;
    margin: 10px auto;
    text-align: center;
    width: 100%;
    max-width: 500px;
}
.highcharts-data-table caption {
    padding: 1em 0;
    font-size: 1.2em;
    color: #555;
}
.highcharts-data-table th {
    font-weight: 600;
    padding: 0.5em;
}
.highcharts-data-table td, .highcharts-data-table th, .highcharts-data-table caption {
    padding: 0.5em;
}
.highcharts-data-table thead tr, .highcharts-data-table tr:nth-child(even) {
    background: #f8f8f8;
}
.highcharts-data-table tr:hover {
    background: #f1f7ff;
}



.highcharts-figure, .highcharts-data-table table {
    min-width: 320px; 
    max-width: 660px;
    margin: 1em auto;
}

.highcharts-data-table table {
    font-family: Verdana, sans-serif;
    border-collapse: collapse;
    border: 1px solid #EBEBEB;
    margin: 10px auto;
    text-align: center;
    width: 100%;
    max-width: 500px;
}
.highcharts-data-table caption {
    padding: 1em 0;
    font-size: 1.2em;
    color: #555;
}
.highcharts-data-table th {
    font-weight: 600;
    padding: 0.5em;
}
.highcharts-data-table td, .highcharts-data-table th, .highcharts-data-table caption {
    padding: 0.5em;
}
.highcharts-data-table thead tr, .highcharts-data-table tr:nth-child(even) {
    background: #f8f8f8;
}
.highcharts-data-table tr:hover {
    background: #f1f7ff;
}



    </style>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/data.js"></script>
<script src="https://code.highcharts.com/modules/drilldown.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>
<script src="https://code.highcharts.com/modules/accessibility.js"></script>


    <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 Associates Dashboard </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">
   

<script>
window.onload = function() {
 
 
var chart = new CanvasJS.Chart("chartContainer", {
    theme: "light2",
    animationEnabled: true,
    title: {
        text: "World Energy Consumption by Sector - 2020"
    },
    data: [{
        type: "pie",
        indexLabel: "{y}",
        yValueFormatString: "#,##0.00\"%\"",
        indexLabelPlacement: "inside",
        indexLabelFontColor: "#36454F",
        indexLabelFontSize: 18,
        indexLabelFontWeight: "bolder",
        showInLegend: true,
        legendText: "{label}",
        dataPoints: <?php echo json_encode($dataPoints, JSON_NUMERIC_CHECK); ?>
    }]
});
chart.render();
 
}
</script>
</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'); ?>
       
        <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>Hi, welcome back! <h3><?php echo $this->session->userdata('name');?></h3></h4>
                            <span class="ml-1"><?php echo $this->session->userdata('username');?></</span></br>

                            <span><a href="#" class="badge badge-primary" data-toggle="modal" data-target=".bd-example-modal-lg" class="dropdown-item ai-icon">
                                        Reset Password
                                    </a></span>
                        </div>
                    </div>
                    <div class="col-sm-6 p-md-0 justify-content-sm-end mt-2 mt-sm-0 d-flex">
                        
                          <img src="<?php echo base_url();?>assets/logo.png" style="width:25%;"/>

                    </div>
                </div>

                <div class="row">

                	<div class="col-xl-12 col-lg-12 col-xxl-12 col-md-12">
                        <div class="card profile-tab">
                            <div class="card-header">
                                <h4 class="card-title">QC Machine Entries / Pending Request </h4>
                            </div>
                            <div class="card-body custom-tab-1">
                                <ul class="nav nav-tabs mb-3">
                                	
									
									
                                    <li class="nav-item"><a href="#QC_Check_Timing" data-toggle="tab" class="nav-link pb-2 ">QC Check Timing</a></li>
                                     <li class="nav-item"><a href="#randomly_check_qc" data-toggle="tab" class="nav-link pb-2 ">Daily Ramdomly</a></li>
                                      <li class="nav-item"><a href="#my-pos" data-toggle="tab" class="nav-link pb-2 ">Pending P.O</a></li>

                                      <li class="nav-item"><a href="#my-requsition" data-toggle="tab" class="nav-link pb-2 ">Pending Requsitions</a></li>
                                      
                                   <!--  <li class="nav-item"><a href="#Supervisor_Daily" data-toggle="tab" class="nav-link pb-2">Supervisor Daily</a></li> 
                                     <li class="nav-item"><a href="#Complain_Hour" data-toggle="tab" class="nav-link pb-2">Complain Hour</a></li>  -->
                                </ul>
                            <div class="tab-content">

                            <div id="QC_Check_Timing" class="tab-pane fade active show">
                                <div class="table-responsive">
                                            
                                    <table  id="example" class="table table-striped table-bordered" style="font-size:12px; ">
                                    
                                                <thead>
                                                    <tr>
                                                        <th>Date</th>
                                                        <th>Machine</th>
                                                        <th>Product</th>
                                                        <th>Job</th>
                                                        <th>Power Lot</th>
                                                        <th>Bag#</th>
                                                        <th>Spot</th>
                                                        <th>Short</th>
                                                        
                                                        <th>Remarks</th>
                                                        <th>Entry Time</th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                     <?php if(!empty($check_timing)){ 
                                                     	foreach ($check_timing as $value) { ?>
                                                     	
                                                    <tr>
                                                        <td><strong><?php echo date("d-m-Y", strtotime($value['insert_date']));
                                                         ?></strong></td>
                                                        <td> <?php  echo machine_name(@$value['machine']); ?></td>
                                                        <td><?php echo $value['product_name']; ?></td>
                                                        <td><?php  echo $value['job']; ?></td>
                                                        <td><?php  echo $value['power_lot']; ?></td>
                                                        <td><?php  echo $value['bag_no']; ?></td>
                                                        <td><?php  echo $value['black_spot']; ?></td>
                                                        <td><?php  echo $value['short_pcs']; ?></td>
                                                        
                                                        <td ><?php echo $value['remarks']; ?></td>
                                                        <td><?php 
                                                        $datetime = $value['created']; 
                                                        echo date('h:i A', strtotime($datetime));          
                                                        ?></td>
                                                        
                                                    </tr>
                                            		<?php } } ?>
                                                 </tbody>
                                            </table>
                                        </div>
                                    </div>

                                   

                                   <div id="randomly_check_qc" class="tab-pane fade ">
                                        <div class="table-responsive">
                                            

                                   <table  id="example5" class="table table-striped table-bordered" style="font-size:12px; ">
                                                <thead>
                                                    <tr>
                                                        <th>Date</th>
                                                        <th>Machine</th>
                                                        <th>Product</th>
                                                        <th>Material</th>
                                                        <th>In</th>
                                                        <th>Cavities</th>
                                                        <th>PCavities</th>
                                                        <th>Operator</th>
                                                        <th>Short</th>
                                                        <th>Condition</th>
                                                        <th>Fitting</th>
                                                        <th>Range</th>
                                                        <th>Check</th>
                                                        <th>Out</th>
                                                        <th>Remarks</th>
                                                        <th>Entry Time</th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                     <?php if(!empty($randomly_check_qc)){ 
                                                     	foreach ($randomly_check_qc as $value) { ?>
                                                     	
                                                    <tr>
                                                        <td><strong><?php echo date("d-m-Y", strtotime($value['insert_date']));
                                                         ?></strong></td>
                                                        <td><?php echo machine_name(@$value['machine']); ?></td>
                                                        <td><?php echo $value['product_name']; ?></td>
                                                        <td><?php echo material_name(@$value['material']); ?></td>
                                                        <td><?php echo $value['time_in']; ?></td>
                                                        <td><?php echo $value['total_cavities']; ?></td>
                                                        <td><?php echo $value['production_cavities']; ?></td>
                                                        <td><?php echo fullname(@$value['operator']); ?></td>
                                                        <td><?php echo $value['short_pcs']; ?></td>
                                                        <td><?php echo $value['condition']; ?></td>
                                                        <td><?php echo $value['fitting']; ?></td>
                                                        <td><?php echo $value['pcs_weight_range']; ?></td>
                                                        <td><?php echo $value['check_pcs']; ?></td>
                                                        <td><?php echo $value['time_out']; ?></td>
                                                        <td><?php echo $value['remarks']; ?></td>
                                                        <td><?php 
                                                        $datetime = $value['created']; 
                                                        echo date('h:i A', strtotime($datetime));          
                                                        ?></td>
                                                    </tr>
                                            		<?php } } ?>
                                                 </tbody>
                                            </table>
                                        </div>
                                    </div>

                                    <div id="my-pos" class="tab-pane fade">
                                        <div class="table-responsive">
                                            

                                    <table id="example5" class="display" style="min-width: 845px">
                                                <thead>
                                                    <tr>
                                                
                                                <th>PO No</th>
                                                <th>PO Date</th>
                                                <th>Vendor</th>
                                                <th>Code</th>
                                                <th>Status</th>
                                                 <th>Approved</th>
                                                <th>Action</th>
                                                
                                            </tr>
                                                </thead>
                                                <tbody>
                                                    <?php if(!empty($get_po)) {?>
                                                <?php foreach ($get_po as $all_get_po) {
                                                   if($all_get_po['approve_status']==0)
                                                 { ?>
                                            <tr>
                                             <td><strong><a href=""><?php echo $all_get_po['po_no']; ?></a></strong></td>
                                                <td><?php   echo date("d-m-Y", strtotime($all_get_po['po_date']) );  ?></td>
                                                <td><strong><?php echo vendor($all_get_po['vendor_id']); ?></strong></td>
                                                <td><?php  echo vendor_code($all_get_po['vendor_id']); ?></td>

                                                 <?php if($all_get_po['status']==0) {?>
                                                <td><span class="badge badge-danger">Pending</span></td>
                                                <?php }else if($all_get_po['status']==1) {?>
                                                    <td><span class="badge badge-success">Active</span></td>
                                                <?php }else if($all_get_po['status']==2) { ?>
                                                <?php } ?>

                                                 <?php if($all_get_po['approve_status']==0) {?>
                                                <td><span class="badge badge-warning">Not Approved</span></td>
                                                <?php }else{ ?>
                                                    <td><span class="badge badge-success">Approved</span></td>
                                                <?php } ?>
                                                <!-- <td><?php //echo $all_get_po['items']; ?>(items)</td> -->
                                                <!-- <td><button type="button" class="badge badge-primary" data-toggle="modal" data-target=".bd-example-modal-lg" onclick="view_po_invoice('<?php  //echo $all_get_po['id']; ?>')">View P.O</button></td> -->
                                                <td><a href="<?php echo base_url('Purchase_order/view_invoice_details/'.$all_get_po['id']);?> " target="_blank"  class="badge badge-primary">View</a>
                                                <button onclick="po_approved(<?php echo $all_get_po['id']; ?>)" class="badge badge">Approved</button>
                                                <button onclick="po_cancel(<?php echo $all_get_po['id']; ?>)" class="badge badge-danger">Cancel Order</button></td>
                                            </tr>
                                        <?php }
                                    }
                                                }
                                         ?>
                                                   
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>



                                    <div id="my-requsition" class="tab-pane fade">
                                        <div class="table-responsive">
                                            

                                    <table id="example5" class="display" style="min-width: 1145px">
                                                <thead>
                                                    <tr>
                                                
                                                 <th>SO#</th>
                                                 <th>Product</th>
                                                  <th>SO Date</th>
                                                 
                                                 <th>Party Name</th>
                                            <!--     <th>Status</th> -->
                                                <th>Action</th>
                                                
                                            </tr>
                                                </thead>
                                                <tbody>
                                                 <?php
                                                    if(!empty($get_all_confirm_so)){
                                                 foreach ($get_all_confirm_so as $value) {
                                                   
                                                 ?>
                                            <tr>
                                                <td><?php echo $value['so_no']; ?></td>
                                                 <td><?php echo product_name($value['product_id']); ?></td>
                                                 <td><?php //$aa = date_format('d-m-y',);
                                                echo date("d-m-Y", strtotime($value['so_date']) );
                                                ?></td>
                                                <td><?php echo $value['party_name']; ?></td>
                                                
                                                
                                                <!--]]<?php if($value['bom_status']==0){ ?>
                                             
                                                       <td><span class="badge badge-danger">Pending</span></td>
                                                    <?php }else{ ?>
                                                   <td><span class="badge badge-success">Created</span></td>

                                            <?php } ?> -->
                                                <td>
                                                <a href="<?php echo base_url ('Sales_order/view_boms/'); echo $value['sales_order_id']; ?>" class="badge badge-primary">View Requisition</a>


                                                 <button onclick="po_approved_req(<?php echo $value['so_id']; ?>)" class="badge badge">Approved</button>


                                                 <!-- <button data-toggle="modal" data-target=".bd-example-modal-lg11" class="badge badge-success"  onclick="last_rates(<?php echo $value['so_id']; ?>)" class="badge badge-warning">Last Rates</button>
 -->

                                             
                                               <!--  <button type="button" class="badge badge-primary" data-toggle="modal" data-target=".bd-example-modal-lg" onclick="bom_destroye('<?php  //echo $value['product_id']; ?>')">Load Bom</button> -->
                                                </td>
                                               
                                            </tr>
                                        <?php 
                                              }
                                            }
                                         ?>
                                                   
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>

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









                     <div class="col-xl-12 col-lg-12 col-xxl-12 col-md-12">
                        <div class="card profile-tab">
                            <div class="card-header">
                                <h4 class="card-title">Today Current Status</h4>
                            </div>
                            <div class="card-body custom-tab-1">
                                <ul class="nav nav-tabs mb-3" >
                                    <li class="nav-item" ><a  href="#my-challans" style="font-size: 14px;" data-toggle="tab" class="nav-link pb-2 ">Supplies Delivered</a></li>
                                    <li class="nav-item" ><a  href="#my-pos" style="font-size: 14px;" data-toggle="tab" class="nav-link pb-2 ">Compund Production</a></li>
                                    <li class="nav-item"><a style="font-size: 14px;" href="#production-qc" data-toggle="tab" class="nav-link pb-2">Production QC</a></li>

                                    <li class="nav-item"><a  href="#production-po" style="font-size: 14px;" data-toggle="tab" class="nav-link pb-2">P.O</a></li>

                                     <li class="nav-item"><a  href="#production-so" style="font-size: 14px;" data-toggle="tab" class="nav-link pb-2">Sales Orders</a></li>

                                      <li class="nav-item"><a  href="#production-semi_in" style="font-size: 14px;" data-toggle="tab" class="nav-link pb-2">Semi Finish In Stock</a></li>

                                      <li class="nav-item"><a  href="#production-finish" style="font-size: 14px;" data-toggle="tab" class="nav-link pb-2">Finish Good In Stock</a></li>
                                </ul>
                                <div class="tab-content">

                                    <div id="my-pos" class="tab-pane fade">
                                        <div class="table-responsive">
                                            

                                    <table id="example5" class="display" style="min-width: 845px;font-size:11px;">
                                         <thead>
                                               <tr>
                                                   <th>SO#</th>
                                                    <th>PRODUCT</th>
                                                    <th>MATERIAL</th>
                                                    <th>Machine</th>
                                                    <th>QCR</th>
                                                    <th>QTY</th>
                                                    <th>UNIT</th>
                                               </tr>
                                                </thead>
                                                <tbody>
                                               
                                                     <?php if(!empty($compound_production)) {?>
                                                <?php foreach ($compound_production as $compound_productions) {
                                                   ?>
                                                 <tr>
                                                    <td><strong><?php echo so_number($compound_productions['so_id']); ?></strong></td>
                                                    <td><?php echo @product_name($compound_productions['product_id']); ?></td>
                                                    <td><?php echo material_name($compound_productions['material_id']); ?></td>
                                                     <td><?php echo @machine_name($compound_productions['machine_id']); ?></td>
                                                    <td><?php echo $compound_productions['qcr']; ?></td>
                                                    <td><?php echo $compound_productions['qty']; ?></td>
                                                    <td><?php 
                                                    $unit =  material_type_po($compound_productions['material_id']); 
                                                    if($unit ==1){
                                                        echo "Bag";
                                                    }else {

                                                        echo "Kg";
                                                    }

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


                                    

                                    <div id="my-challans" class="tab-pane fade active show">
                                        <div class="table-responsive">
                                            

                                    <table id="example5" class="display" style="min-width: 845px;font-size:11px;">
                                         <thead>
                                               <tr>
                                                   <th>SO#</th>
                                                    <th>Comapny</th>
                                                    <th>Product</th>
                                                    <th>Delivery Qty</th>
                                                    <th>Qty</th>
                                                    <th>Reamaing Qty</th>
                                                    <th>Delivery Date</th>
                                                    <th>Action</th>
                                               </tr>
                                                </thead>
                                                <tbody>
                                               
                                                     <?php if(!empty($get_delivery_challan)) {?>
                                                <?php foreach ($get_delivery_challan as $get_delivery_challans) {
                                                   ?>
                                                 <tr>

                                                    <td><?php echo $get_delivery_challans['so_no']; ?></td>
                                                    <td><?php echo $get_delivery_challans['party_name']; ?></td>
                                                    <td><?php  $product =  sale_order_pro($get_delivery_challans['id']); 

                                                            echo product_name($product); ?></td>
                                                    <td>
                                                    <?php  $deliver = deliverd_qty($get_delivery_challans['id']); ?>
                                                    <?php if($deliver !=""){ ?>
                                                    <strong><?php echo $deliver; ?></strong>

                                                  <?php }else{ ?>

                                                  <?php echo "0"; } ?>
                                                  </td>
                                                  <td><?php echo qty_so($get_delivery_challans['id']);


                                                  ?></td>
                                                    <td><?php  echo qty_so($get_delivery_challans['id'])-$deliver;


                                                  ?></td>
                                                  </td>
                                                    <td><?php  echo $get_delivery_challans['insert_date'];


                                                  ?></td>
                                                  <td>
                                                        <a href="<?php echo base_url('Sales_order/view_invoice_details_so/'.$get_delivery_challans['id']);?> " target="_blank"  class="badge badge-primary">View</a>

                                                  <a href="<?php echo base_url('Sales_order/view_dc_invoice/'.$get_delivery_challans['id']);?> " target="_blank"  class="badge badge-primary">View DC</a>

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

                                    <div id="production-qc" class="tab-pane fade">
                                        <div class="table-responsive">
                                            <table id="example5" class="display" style="min-width: 845px">
                                                <thead>
                                                    <tr>
                                                        <th>Date</th>
                                                        <th>Qc Check Timing</th>
                                                        <th>Daily Ramdomly</th>
                                                        <th>Supervisor Daily</th>
                                                        <th>Complain Hour</th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                     <?php $today_date = date('Y-m-d'); ?>
                                                    <tr>
                                                        <td><strong><?php echo date("d-m-Y", strtotime($today_date));
                                                         ?></strong></td>
                                                        <td> Total Count:<?php echo machine_get_qc_check($today_date);  ?></td>
                                                        <td>Total Count:<?php echo machine_daily_ramdomly($today_date);  ?></td>
                                                        <td>Total Count:<?php echo machine_get_supervisor($today_date);  ?></td>
                                                        <td>Total Count:<?php echo machine_get_complain_hour($today_date);  ?></td>
                                                        
                                                    </tr>
                                            
                                                 </tbody>
                                            </table>
                                        </div>
                                    </div>


                                    <div id="production-po" class="tab-pane fade">
                                        <div class="table-responsive">
                                            <table id="example5" class="display" style="min-width: 845px">
                                                <thead>
                                                    <tr>
                                                        <th>PO #</th>
                                                        <th>PO Date</th>
                                                        <th>Vendor</th>
                                                        <th>Items</th>
                                                        <th>Qty</th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                     <?php if(!empty($po_today)) {?>
                                                      <?php foreach ($po_today as $po_todays) {
                                                   ?>
                                                    <tr>
                                                       <td><strong><?php echo $po_todays['po_no'];  ?></strong></td>
                                                       <td><?php echo date("d-m-Y", strtotime($po_todays['po_date']));   ?></td>
                                                       <td><?php echo vendor($po_todays['vendor_id']);  ?></td>
                                                        <td><?php  
                                                        $po_mat = po_material($po_todays['id']);  
                                                            if($po_mat == 0){

                                                                $p_id = po_product($po_todays['id']);
                                                                echo product_name($p_id);

                                                             }else{
                                                                $m_id = po_material($po_todays['id']);
                                                                echo material_name($m_id);
                                                            }

                                                     ?></td>
                                                       <td><?php echo po_dashboard_qty($po_todays['id']);  ?></td>
                                                      
                                                    </tr>
                                                    <?php } } ?>
                                                 </tbody>
                                            </table>
                                        </div>
                                    </div>


                                    <div id="production-so" class="tab-pane fade">
                                        <div class="table-responsive">
                                            <table id="example5" class="display" style="min-width: 845px;">
                                                <thead>
                                                    <tr>
                                                        <th>SO #</th>
                                                        <th>SO Date</th>
                                                        <th>Party</th>
                                                        <th>Items</th>
                                                        <th>Qty</th>
                                                        <th>Delivery Date</th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                     <?php if(!empty($so_today)) {?>
                                                      <?php foreach ($so_today as $so_todays) {
                                                   ?>
                                                    <tr>
                                                       <td><?php echo $so_todays['so_no'];  ?></td>
                                                       <td><?php echo date("d-m-Y", strtotime($so_todays['so_date'])); ?></td>
                                                       <td><?php echo partyname($so_todays['party_id']);  ?></td>
                                                        <td><?php  
                                                            $pro_name =  sale_order_pro($so_todays['id']);
                                                            
                                                            echo product_name($pro_name);
                                                          ?></td>
                                                       <td><?php echo qty_so($so_todays['id']);  ?></td>
                                                       <td><?php  
                                                        echo date("d-m-Y", strtotime(so_delivery_date($so_todays['id'])));
                                                       ?></td>
                                                      
                                                    </tr>
                                                    <?php } } ?>
                                                 </tbody>
                                            </table>
                                        </div>
                                    </div>
                                    
                                    <div id="production-semi_in" class="tab-pane fade">
                                        <div class="table-responsive">
                                            <table id="example5" class="display" style="min-width: 845px">
                                                <thead>
                                                    <tr>
                                                      
                                                        <th>Date</th>
                                                        <th>Items</th>
                                                        <th>Qty</th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                     <?php if(!empty($semi_production)) {?>
                                                      <?php foreach ($semi_production as $semi_productions) {
                                                   ?>
                                                     <tr>
                                                        <?php if($semi_productions['product_id']!=""){ ?>
                                                       
                                                       <td><?php echo date("d-m-Y", strtotime($semi_productions['insert_date'])); ?></td>
                                                       <td><?php echo product_name($semi_productions['product_id']);  ?></td>
                                                       <td><?php echo $semi_productions['qty'];  ?></td>
                                                        <?php }else{ ?>
                                                        
                                                        <?php } ?>
                                                      
                                                    </tr>
                                                    <?php } } ?>
                                                 </tbody>
                                            </table>
                                        </div>
                                    </div>


                                    <div id="production-finish" class="tab-pane fade">
                                        <div class="table-responsive">
                                            <table id="example5" class="display" style="min-width: 845px">
                                                <thead>
                                                    <tr>
                                                      
                                                        <th>Date</th>
                                                        <th>Batch</th>
                                                        <th>Items</th>
                                                        <th>Qty</th>
                                                        <th>Entry Time</th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                     <?php if(!empty($finish_production)) {?>
                                                      <?php foreach ($finish_production as $finish_productions) {
                                                   ?>
                                                     <tr>
                                                        <?php if($finish_productions['product_id']!=""){ ?>
                                                       
                                                       <td><?php echo date("d-m-Y", strtotime($finish_productions['insert_date'])); ?></td>
                                                       <td><?php echo $finish_productions['batch'];  ?></td>
                                                       <td><?php echo product_name($finish_productions['product_id']);  ?></td>
                                                       <td><?php echo $finish_productions['qty'];  ?></td>
                                                       <td><?php 
                                                        $datetime = $finish_productions['created']; 
                                                        echo date('h:i A', strtotime($datetime));

                                                                  
                                                        ?></td>
                                                        <?php }else{ ?>
                                                        
                                                        <?php } ?>
                                                      
                                                    </tr>
                                                    <?php } } ?>
                                                 </tbody>
                                            </table>
                                        </div>
                                    </div>
                                    
                                </div>
                            </div>
                        </div>
                    </div>  





                   
                    <div class="col-xl-3 col-xxl-3 col-sm-6">
                        <div class="widget-stat card">
                            <div class="card-body">
                                <div class="media ai-icon">
                                    <span class="mr-3">
                                        <!-- <i class="ti-user"></i> -->
                                        <svg id="icon-customers" width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-user">
                                            
                                            <circle cx="12" cy="7" r="4">
                                                <img src="<?php echo base_url(); ?>/assets/image/emp.png" style="width: 45px;"></circle>
                                        </svg>
                                    </span>
                                    <div class="media-body">
                                        <p class="mb-1">Empolyees</p>
                                        <h4 class="mb-0">68</h4>
                                        <span class="badge badge-primary">Total Empolyees</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>


                     <div class="col-xl-3 col-xxl-3 col-sm-6">
                        <div class="widget-stat card">
                            <div class="card-body">
                                <div class="media ai-icon">
                                    <span class="mr-3">
                                         <svg id="icon-customers"  width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-user">
                                            <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
                                            <circle cx="12" cy="7" r="4"><img src="<?php echo base_url(); ?>/assets/image/party.png" style="width: 45px;"></circle>
                                        </svg>
                                    </span>
                                    <div class="media-body">
                                        <p class="mb-1">Parties</p>
                                        <h4 class="mb-0"><?php echo $count_parties[0]['party_count']; ?></h4>
                                        <span class="badge badge-primary">Total Parties</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>



                     <div class="col-xl-3 col-xxl-3 col-sm-6">
                        <div class="widget-stat card">
                            <div class="card-body">
                                <div class="media ai-icon">
                                    <span class="mr-3">
                                       <svg id="icon-customers"  width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-user">
                                            <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
                                            <circle cx="12" cy="7" r="4"><img src="<?php echo base_url(); ?>/assets/image/vendor.png" style="width: 45px;"></circle>
                                        </svg>
                                    </span>
                                    <div class="media-body">
                                        <p class="mb-1">Vendors</p>
                                        <h4 class="mb-0"><?php echo $count_vendor[0]['vendor_count']; ?></h4>
                                        <span class="badge badge-danger">Total Vendors</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>


                     <div class="col-xl-3 col-xxl-3 col-sm-6">
                        <div class="widget-stat card">
                            <div class="card-body">
                                <div class="media ai-icon">
                                    <span class="mr-3">
                                        <svg id="icon-customers"  width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-user">
                                            <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
                                            <circle cx="12" cy="7" r="4"><img src="<?php echo base_url(); ?>/assets/image/machine.png" style="width: 45px;"></circle>
                                        </svg>
                                    </span>
                                    <div class="media-body">
                                        <p class="mb-1">Machines</p>
                                        <h4 class="mb-0"><?php echo $machines[0]['count_machines']; ?></h4>
                                        <span class="badge badge-success">Total Machines</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>


                    <div class="col-xl-3 col-xxl-3 col-sm-6">
                        <div class="widget-stat card">
                            <div class="card-body">
                                <div class="media ai-icon">
                                    <span class="mr-3">
                                        <svg id="icon-customers"  width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-user">
                                            <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
                                            <circle cx="12" cy="7" r="4"><img src="<?php echo base_url(); ?>/assets/image/mold.png" style="width: 45px;"></circle>
                                        </svg>
                                    </span>
                                    <div class="media-body">
                                        <p class="mb-1">Molds</p>
                                          <h4 class="mb-0"><?php echo $molds[0]['count_molds']; ?></h4>
                                        <span class="badge badge-success">Total Molds</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>


                      <div class="col-xl-3 col-xxl-3 col-sm-6">
                        <div class="widget-stat card">
                            <div class="card-body">
                                <div class="media ai-icon">
                                    <span class="mr-3">
                                         <svg id="icon-customers"  width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-user">
                                            <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
                                            <circle cx="12" cy="7" r="4"><img src="<?php echo base_url(); ?>/assets/image/materials.png" style="width: 45px;"></circle>
                                        </svg>
                                    </span>
                                    <div class="media-body">
                                        <p class="mb-1">Materials</p>
                                        <h4 class="mb-0"><?php echo $materials[0]['materials']; ?></h4>
                                        <span class="badge badge-primary">Total Materials</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>


                    <div class="col-xl-3 col-xxl-3 col-sm-6">
                        <div class="widget-stat card">
                            <div class="card-body">
                                <div class="media ai-icon">
                                    <span class="mr-3">
                                          <svg id="icon-customers"  width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-user">
                                            <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
                                            <circle cx="12" cy="7" r="4"><img src="<?php echo base_url(); ?>/assets/image/products.png" style="width: 45px;"></circle>
                                        </svg>
                                    </span>
                                    <div class="media-body">
                                        <p class="mb-1">Products</p>
                                        <h4 class="mb-0"><?php echo $products[0]['products']; ?></h4>
                                        <span class="badge badge-primary">Total Products</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>


                     <div class="col-xl-3 col-xxl-3 col-sm-6">
                        <div class="widget-stat card">
                            <div class="card-body">
                                <div class="media ai-icon">
                                    <span class="mr-3">
                                         <svg id="icon-customers" xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-user">
                                            <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
                                            <circle cx="12" cy="7" r="4"></circle>
                                        </svg>
                                    </span>
                                    <div class="media-body">
                                        <p class="mb-1">Users</p>
                                        <h4 class="mb-0">16</h4>
                                        <span class="badge badge-primary">Total Users</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>


                     <div class="col-xl-8 col-xxl-6 col-sm-6">

                    <figure class="highcharts-figure">
                        <div id="container"></div>
                        <p class="highcharts-description">
                            
                        </p>
                    </figure>
                </div>



                <div class="col-xl-8 col-xxl-6 col-sm-6">

                    <figure class="highcharts-figure">
                        <div id="Purchase_orders"></div>
                        <p class="highcharts-description">
                            
                        </p>
                    </figure>
                </div>
                

                    </div> 


                <!-- <div class="col-xl-12 col-lg-12 col-xxl-12 col-md-12">
                        <div class="card profile-tab">
                            <div class="card-header">
                                <h4 class="card-title">Pending Status</h4>
                            </div>
                            <div class="card-body custom-tab-1">
                                <ul class="nav nav-tabs mb-3">
                                    <li class="nav-item"><a href="#my-pos" data-toggle="tab" class="nav-link pb-2 ">Pending P.O</a></li>
                                   
                                </ul>
                                <div class="tab-content">

                         
                                   
                                    
                                </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" 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">
                                              
                         <?php echo form_open(base_url(''),array('class'=>"form-horizontal add_fg_rates_success", 'id'=>"add_fg_rates_success")); ?>
                                     <fieldset class="content-group">
                                                                   
                                      <?php if($this->session->flashdata('fg_rates_success')){ ?>
                                                            <div class="alert alert-success solid" style='text-align:center;'><?php echo $this->session->flashdata('fg_rates_success'); ?></div>
                                                        <?php } ?>  

                                            <div class="col-xl-12 col-xxl-12 col-sm-12">
                                                <div class="card">
                                                    <div class="card-header">
                                                        <h5 class="card-title">Reset Password</h5>
                                                    </div>
                                                   
                                                   <div class="card-body">
                                                         <div id='fg_rates_success' class='alert alert-success solid' style='display:none;'></div>
                                                            

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


                                                            <div class="row">

                                                                

                                                               
                                                                <div class="col-lg-6 col-md-6 col-sm-12">
                                                                    <div class="form-group">
                                                                        <label class="form-label"> Old Password::</label>
                                                                        <input type="text" required="required" name="password" id="password" class="form-control required">
                                                                    </div>
                                                                </div>

                                                                <div class="col-lg-6 col-md-6 col-sm-12">
                                                                    <div class="form-group">
                                                                        <label class="form-label"> New Password::</label>
                                                                        <input type="password" name="n_password" id="n_password" class="form-control ">
                                                                    </div>
                                                                </div>

                                                                <div class="col-lg-6 col-md-6 col-sm-12">
                                                                    <div class="form-group">
                                                                        <label class="form-label"> Conform Password::</label>
                                                                        <input type="password"  name="c_password" id="c_password" class="form-control ">
                                                                    </div>
                                                                </div>
                                                              
                                                               <input type="hidden" name="user_id" id="user_id" value="<?php echo $this->session->userdata('id');?>">
                                                                
                                                                 
                                                            </div>
                                                       
                                                    </div>
                                                </div>
                                            </div>



                                                </div>
                                                <div class="modal-footer">
                                                    <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                                                    <button type="submit" id="dis_submit" class="btn btn-primary">Submit <i class="icon-arrow-right14 position-right"></i></button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>


     <div class="modal fade bd-example-modal-lg11" 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="reciving_po">
                    
                          </div>
                      



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

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

    
      <?php  $this->load->view('footer'); ?>
    
</body>

<script type="text/javascript">
var lcount = <?php echo $leasecount; ?>;
Highcharts.chart('container', {

    chart: {
        type: 'column'
    },
    title: {
        text: 'Sales Orders 2021'
    },
    subtitle: {
        text: ''
    },
    accessibility: {
        announceNewData: {
            enabled: true
        }
    },
    xAxis: [{
            categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun','Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
            crosshair: true
        }],
    yAxis: {
        title: {
            text: 'Monthly Sales Orders'
        }

    },
    legend: {
        enabled: true
    },
    plotOptions: {
        series: {
            borderWidth: 0,
            dataLabels: {
                enabled: true,
                format: ''
            }
        }
    },

    tooltip: {
        //headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
       // pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y:.2f}%</b> of total<br/>'
    },

    series: [
        {
            name: "Total Sales Order",
            colorByPoint: true,
            data: lcount
        }
    ],
    drilldown: {
        series: [
            {
                name: "Chrome",
                id: "Chrome",
                data: lcount
            }
            
        ]
    }
});


///Purchase Orders

var lcount1 = <?php echo $leasecount1; ?>;
Highcharts.chart('Purchase_orders', {

    chart: {
        type: 'column'
    },
    title: {
        text: 'Purchase Orders 2021'
    },
    subtitle: {
        text: ''
    },
    accessibility: {
        announceNewData: {
            enabled: true
        }
    },
    xAxis: [{
            categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun','Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
            crosshair: true
        }],
    yAxis: {
        title: {
            text: 'Monthly Purchase Orders'
        }

    },
    legend: {
        enabled: true
    },
    plotOptions: {
        series: {
            borderWidth: 0,
            dataLabels: {
                enabled: true,
                format: ''
            }
        }
    },

    tooltip: {
        //headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
       // pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y:.2f}%</b> of total<br/>'
    },

    series: [
        {
            name: "Total Purchase Order",
            colorByPoint: true,
            data: lcount1
        }
    ],
    drilldown: {
        series: [
            {
                name: "PO",
                id: "PO",
                data: lcount1
            }
            
        ]
    }
});




// Build the chart
Highcharts.chart('po_orders', {
    chart: {
        plotBackgroundColor: null,
        plotBorderWidth: null,
        plotShadow: false,
        type: 'pie'
    },
    title: {
        text: 'Purchase Orders 2021'
    },
    tooltip: {
        pointFormat: ''
    },
    accessibility: {
        point: {
            valueSuffix: ''
        }
    },
    plotOptions: {
        pie: {
            allowPointSelect: true,
            cursor: 'pointer',
            dataLabels: {
                enabled: false
            },
            showInLegend: true
        }
    },
    series: [{
        name: 'Brands',
        colorByPoint: true,
        data: [{
            name: 'Chrome',
            y: 61.41,
            sliced: true,
            selected: true
        }]
    }]
});


 function po_approved_req(id) { 
        var id = id;

        
         //var po_id = $('#po_id').val();
        if (confirm('Are you sure you want to Finish .?')) {
  
         $.ajax({
                type:'POST',
                url:'<?php echo base_url('Purchase_order/pending_requisition/'); ?>'+id,
                data:id,
                dataType:'json',
                success:function(data){
                    console.log('first'+data.status);
                    
                        console.log('second'+data.status);
                        //debugger;
                       // $('#material_bom_danger').show().html('Component Deleted Successfully');
                       setTimeout(function(){location.href="<?php echo base_url('Admin/dashboard1/'); ?>"} ,);
                    
                },
                error:function(data){console.log(data.responseText);}
            });

     }
 }

 function last_rates(id) { 
        var id = id;

        
         //var po_id = $('#po_id').val();
       
         $.ajax({
                type:'POST',
                url:'<?php echo base_url('Purchase_order/last_rates/'); ?>'+id,
                data:id,
                dataType:'json',
                success:function(data){
                    console.log('first'+data.status);

                     $('#reciving_po').show().html(data.html);
                   
                },
                error:function(data){console.log(data.responseText);}
            });

     
 }

function po_approved(id) { 
        var id = id;

        
         //var po_id = $('#po_id').val();
        if (confirm('Are you sure you want to Approved.?')) {
  
         $.ajax({
                type:'POST',
                url:'<?php echo base_url('Purchase_order/approved_po/'); ?>'+id,
                data:id,
                dataType:'json',
                success:function(data){
                    console.log('first'+data.status);
                    
                        console.log('second'+data.status);
                        //debugger;
                       // $('#material_bom_danger').show().html('Component Deleted Successfully');
                       setTimeout(function(){location.href="<?php echo base_url('Admin/dashboard/'); ?>"} ,);
                    
                },
                error:function(data){console.log(data.responseText);}
            });

     }
 }

 
 function po_cancel(id) { 
        var id = id;

        
         //var po_id = $('#po_id').val();
        if (confirm('Are you sure you want to Cancel.?')) {
  
         $.ajax({
                type:'POST',
                url:'<?php echo base_url('Purchase_order/po_cancel/'); ?>'+id,
                data:id,
                dataType:'json',
                success:function(data){
                    console.log('first'+data.status);
                    
                        console.log('second'+data.status);
                        //debugger;
                       // $('#material_bom_danger').show().html('Component Deleted Successfully');
                       setTimeout(function(){location.href="<?php echo base_url('Admin/dashboard/'); ?>"} ,);
                    
                },
                error:function(data){console.log(data.responseText);}
            });

     }
 }


</script>
<script type='text/javascript'>
        
    var fg_rates_success = $('#add_fg_rates_success');   
    
    fg_rates_success.on('submit',function(e){
    //$("#dis_submit").attr('disabled', true);
        e.preventDefault();
        
        var fg_rates_successdata = fg_rates_success.serialize();
        
      
            $.ajax({
                type:'POST',
                url:'<?php echo base_url('Admin/reset_pass'); ?>',
                data:fg_rates_successdata,
                dataType:'json',
                success:function(data){
                    console.log('first'+data.status);
                    if(data.status === 'true'){
                         $('#fg_rates_danger').hide();
                        console.log('second'+data.status);
                        $('#fg_rates_success').show().html('Password Reset Successfully').hide(3000);
                       setTimeout(function(){location.href="<?php echo base_url(''); ?>"} , 3000);
                    }else if(data.status === 'false'){

                        $('#fg_rates_danger').show().html('Mismatch Password...!');

                    }else{
                        console.log('third'+data);          
                    }
                },
                error:function(data){console.log(data.responseText);}
            });
       // }
    });

</script>
<!-- Mirrored from edumin.dexignlab.com/xhtml/index-2.html by HTTrack Website Copier/3.x [XR&CO'2014], Thu, 19 Nov 2020 03:05:25 GMT -->
</html>