  
<head>
    <script>
    if ( window.history.replaceState ) 
    {
        window.history.replaceState( null, null, window.location.href );
    }
    </script>  
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <title>WIP | Control System</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="shortcut icon" href="img/lgo1.png">
    <!--Sweetalert Plugin --->
    <script src="bower_components/sweetalert/sweetalert.js"></script>
    <!-- AdminLTE App -->
    <script src="dist/js/adminlte.min.js"></script>
    <!-- jQuery 3 -->
    <script src="bower_components/jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap 3.3.7 -->
    <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- Bootstrap -->
    <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
    <!-- daterange picker -->
    <link rel="stylesheet" href="bower_components/bootstrap-daterangepicker/daterangepicker.css">
    <!-- bootstrap datepicker -->
    <link rel="stylesheet" href="bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css">
    <!-- bootstrap timepicker -->
    <link rel="stylesheet" href="plugins/timepicker/bootstrap-timepicker.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="bower_components/Ionicons/css/ionicons.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="dist/css/AdminLTE.min.css">

    <link rel="stylesheet" href="dist/css/skins/skin-blue.min.css">

    <!-- Google Font -->
    <link rel="stylesheet"
    href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
    <!-- DataTables -->
    <link rel="stylesheet" href="bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css">
    <!-- datepicker js -->
    <script src="bower_components/bootstrap-daterangepicker/daterangepicker.js"></script>
    <!-- bootstrap datepicker -->
    <script src="bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
    <!-- iCheck for checkboxes and radio inputs -->
    <link rel="stylesheet" href="plugins/iCheck/all.css">
    <!-- iCheck 1.0.1 -->
    <script src="plugins/iCheck/icheck.min.js"></script>
    <!-- bootstrap time picker -->
    <script src="plugins/timepicker/bootstrap-timepicker.min.js"></script>
      <script src="dist/js/date_time.js"></script>     
    <!-- chart Js -->
    <script src="chartjs/dist/Chart.min.js"></script>

</head>

<?php
    //session_start();
    /*
    if($_SESSION['username']=="")
    {
        include_once'index.php';
    } 
     
     */
    if(isset($_POST['sett']))
    {
        // echo '<script>alert("$_SESSION['role'];")</script>';
        // $ro = $_SESSION['role'];
        // if($ro=="Admin"){
        // header('refresh:1;setting.php');
        header('location:setting.php');
        //}else {
        //  echo '<script>alert("Only Admin Can Change Setting")</script>';
    }
?>

<header class="main-header"  style="background-color: #f1f1f1;">
    <nav class="navbar navbar-static-top ">
        <div class="row">
            <!-- ./col --------------------------------------------------------------------------------------------->        
                            
                  <div class="col-lg-1 col-xs-1">
                       <img src="img/lgo1.png" class="user-image" alt="User Image" width="50" hight="50">
                      
                     
                 </div>
                  <div class="col-lg-6 col-xs-6">
                   
                      <p> <h3>Wip Control System </h3> </p>
                     
                 </div>
                  <div class="col-lg-4 col-xs-4">
                   
		    <a><h3>
                        <b><span id="date_time" class="pull-right"></span></b>
                            <script type="text/javascript">window.onload = date_time('date_time');</script>
                        </h3>
                    </a>
            
                  <!-- Tasks Menu -->
	
                  <!-- Tasks Menu -->
	
         
            
                     
                 </div>
                 
                
                 
                 
      </div>
         
             
        
            <!-- Navbar Right Menu -->
        
       
        </nav>
      </header>
        


  <!-- Content Wrapper. Contains page content -->
  
    <!-- Main content -->
    <section class="content container-fluid" >
        
        
        
    <?php
        include_once'db/connect_db.php';
        include('function1/avbstk.php');
 
        function adddata($lid,$qty)
        {
            /*
            include('db/connect_db.php');
             $usr=1;
             $old=getqty('1');
            $insert = $pdo2->prepare("INSERT INTO datalog(date,qty,cumm,lid,usr) VALUES(:dt,:qt,:cu,:ln,:us)");

            $insert->bindParam(':dt',date("Y/m/d"));
            $insert->bindParam(':qt',$qty);

            $tto=$qty+$old;
            $insert->bindParam(':cu',$tto);

            $insert->bindParam(':ln',$lid);
            $insert->bindParam(':us',$usr);
            $insert->execute();
             
             */
        }                   
        function removedata($lid,$qty)
        {
            /*
            include('db/connect_db.php');
             $usr=1;
             $old=getqty('1');
            $insert = $pdo2->prepare("INSERT INTO datalog(date,qty,cumm,lid,usr) VALUES(:dt,:qt,:cu,:ln,:us)");

            $insert->bindParam(':dt',date("Y/m/d"));
            $insert->bindParam(':qt',$qty);

            $tto=$qty-$old;
            $insert->bindParam(':cu',$tto);

            $insert->bindParam(':ln',$lid);
            $insert->bindParam(':us',$usr);
            $insert->execute();
             * 
             */
        }          
        function  datain($qt,$lid)
        {
            include('db/connect_db.php');
            $dtin = $pdo2->prepare("UPDATE linebalance SET qty=qty+:a WHERE lid='$lid'");
            $dtin->bindParam(':a', $qt);
            $dtin->execute();                       
        }
        function  datout($qt,$lid)
        {
            include('db/connect_db.php');
            $dtin = $pdo2->prepare("UPDATE linebalance SET qty=qty-:a WHERE lid='$lid'");
            $dtin->bindParam(':a', $qt);
            $dtin->execute();
        }  
        
        if(isset($_POST['update']))
        {
            for ($i=1;$i<=28;$i++)
            {
                $line1=$i;
                $line="lin".$line1;
                if(isset($_POST[$line]))
                {
                    adddata($line1,$_POST[$line]);
                    datain($_POST[$line],$line1);
                }
            }
            for ($i=1;$i<=28;$i++)
            {
                $line12=$i;
                $line="lout".$line12;
                if(isset($_POST[$line]))
                {
                        
                    removedata($line12,$_POST[$line]);
                    datout($_POST[$line],$line12);
                }
            }
                  
            echo'<script type="text/javascript">
                jQuery(function validation()
                {
                    swal("Save", "Sucessfully Saved", "info",{button: "Continue",});
                });
                </script>';          
        } 
    ?>
       
    <form action="" method="POST">
        <div class="col-md-offset-1 col-md-4">
            <br>
            <table  id="myRegister" >
                <tbody>
                    <tr>
                        <td style="width:75px"><h4><?php echo "Line1"; ?></h4></td>
                        <td style="width:8px"></td>
                        <td><h4><?php echo "in"; ?></h4></td>
                        <td style="width:8px"></td>
                        <td style="width:75px"><input type="number" class="form-control productname" style="width:75px;" name="lin1" ></td>
                        <td style="width:15px"></td>
                        <td style="width:75px"><h4><?php echo "Out"; ?></h4></td>
                        <td style="width:75px"><input type="number" class="form-control productname" style="width:75px;" name="lout1" >
                                                              
                                      </td>
                                  
                                     <td style="width:15px"></td>
                                     <td style="width:75px"> <font color="red"> <input type="text" class="form-control productname" style="width:75px;" 
                                                                     name="tl2" value = " <?php echo getqty('1'); ?> " readonly > </Font></td>
                      
                              </tr>              
                                  <tr>
                                        <td style="width:75px"><h4><?php echo "Line 2"; ?></h4></td>
                                    <td style="width:8px"></td>
                                         <td><h4><?php echo "in"; ?></h4></td>
                                         <td style="width:8px"></td>
                                    <td style="width:75px">  <input type="number" class="form-control productname" style="width:75px;" name="lin2" >
                                   
                                      
                                      </td>
                                      <td style="width:15px"></td>
                                   
                                            <td style="width:75px"><h4><?php echo "Out"; ?></h4></td>
                                    <td style="width:75px"> 
                                        
                                        <input type="number" class="form-control productname" style="width:75px;" name="lout2" >
                                   
                                       
                                      </td>
                                    <td style="width:15px"></td>
                                <td style="width:75px"> <font color="red"> <input type="text" class="form-control productname" style="width:75px;" 
                                                                     name="tl2" value = " <?php echo getqty('2'); ?> " readonly > </Font></td>
                                </tr> 
                                
                                <tr>
                                        <td style="width:75px"><h4><?php echo "Line 3"; ?></h4></td><td style="width:8px"></td>
                                         <td><h4><?php echo "in"; ?></h4></td>
                                        <td style="width:8px"></td>
                                    <td style="width:75px">  <input type="number" class="form-control productname" style="width:75px;" name="lin3" >
                                   
                                      
                                      </td>
                                      
                                    <td style="width:15px"></td>
                                            <td style="width:75px"><h4><?php echo "Out"; ?></h4></td>
                                    <td style="width:75px"> 
                                        
                                        <input type="number" class="form-control productname" style="width:75px;" name="lout3" >
                                   
                                       
                                      </td>
                                      <td style="width:15px"></td>
                                   <td style="width:75px"> <font color="red"> <input type="text" class="form-control productname" style="width:75px;" 
                                                                     name="tl2" value = " <?php echo getqty('3'); ?> " readonly > </Font></td>
                                     
                                </tr> 
                                <tr>
                                        <td style="width:75px"><h4><?php echo "Line 4"; ?></h4></td><td style="width:8px"></td>
                                         <td><h4><?php echo "in"; ?></h4></td>
                                        <td style="width:8px"></td>
                                    <td style="width:75px">  <input type="number" class="form-control productname" style="width:75px;" name="lin4" >
                                   
                                      
                                      </td>
                                      <td style="width:15px"></td>
                                     
                                            <td style="width:75px"><h4><?php echo "Out"; ?></h4></td>
                                    <td style="width:75px"> 
                                        
                                        <input type="number" class="form-control productname" style="width:75px;" name="lout4" >
                                   
                                       
                                      </td>
                                      <td style="width:15px"></td>
                                     <td style="width:75px"> <font color="red"> <input type="text" class="form-control productname" style="width:75px;" 
                                                                     name="tl2" value = " <?php echo getqty('4'); ?> " readonly > </Font></td>
                               
                                </tr> 
                                <tr>
                                        <td style="width:75px"><h4><?php echo "Line 5"; ?></h4></td><td style="width:8px"></td>
                                         <td><h4><?php echo "in"; ?></h4></td>
                                        <td style="width:8px"></td>
                                    <td style="width:75px">  <input type="number" class="form-control productname" style="width:75px;" name="lin5" >
                                   
                                      
                                      </td>
                                      <td style="width:15px"></td>
                                   
                                            <td style="width:75px"><h4><?php echo "Out"; ?></h4></td>
                                    <td style="width:75px"> 
                                        
                                        <input type="number" class="form-control productname" style="width:75px;" name="lout5" >
                                   
                                       
                                      </td>
                                      <td style="width:15px"></td>
                                     <td style="width:75px"> <font color="red"> <input type="text" class="form-control productname" style="width:75px;" 
                                                                     name="tl2" value = " <?php echo getqty('5'); ?> " readonly > </Font></td>
                                <tr>
                                        <td style="width:75px"><h4><?php echo "Line 6"; ?></h4></td>
                                        <td style="width:8px"></td>
                                         <td><h4><?php echo "in"; ?></h4></td>
                                         <td style="width:8px"></td>
                                    <td style="width:75px">  <input type="number" class="form-control productname" style="width:75px;" name="lin6" >
                                   
                                      
                                      </td>
                                      <td style="width:15px"></td>
                                     
                                            <td style="width:75px"><h4><?php echo "Out"; ?></h4></td>
                                    <td style="width:75px"> 
                                        
                                        <input type="number" class="form-control productname" style="width:75px;" name="lout6" >
                                   
                                       
                                      </td>
                                      <td style="width:15px"></td>
                                   <td style="width:75px"> <font color="red"> <input type="text" class="form-control productname" style="width:75px;" 
                                                                     name="tl2" value = " <?php echo getqty('6'); ?> " readonly > </Font></td>
                                    
                                </tr> 
                                <tr>
                                        <td style="width:75px"><h4><?php echo "Line 7"; ?></h4></td><td style="width:8px"></td>
                                         <td><h4><?php echo "in"; ?></h4></td>
                                        <td style="width:8px"></td>
                                    <td style="width:75px">  <input type="number" class="form-control productname" style="width:75px;" name="lin7" >
                                   
                                      
                                      </td>
                                      
                                  <td style="width:15px"></td>
                                            <td style="width:75px"><h4><?php echo "Out"; ?></h4></td>
                                    <td style="width:75px"> 
                                        
                                        <input type="number" class="form-control productname" style="width:75px;" name="lout7" >
                                   
                                       
                                      </td>
                                      <td style="width:15px"></td>
                                     <td style="width:75px"> <font color="red"> <input type="text" class="form-control productname" style="width:75px;" 
                                                                     name="tl2" value = " <?php echo getqty('7'); ?> " readonly > </Font></td>

                                </tr> 
                                <tr>
                                        <td style="width:75px"><h4><?php echo "Line 8"; ?></h4></td>
                                        <td style="width:8px"></td>
                                         <td><h4><?php echo "in"; ?></h4></td>
                                         <td style="width:8px"></td>
                                    <td style="width:75px">  <input type="number" class="form-control productname" style="width:75px;" name="lin8" >
                                   
                                      
                                      </td>
                                      <td style="width:15px"></td>
                                  
                                            <td style="width:75px"><h4><?php echo "Out"; ?></h4></td>
                                    <td style="width:75px"> 
                                        
                                        <input type="number" class="form-control productname" style="width:75px;" name="lout8" >
                                   
                                       
                                      </td>
                                     <td style="width:15px"></td>
                                     <td style="width:75px"> <font color="red"> <input type="text" class="form-control productname" style="width:75px;" 
                                                                     name="tl2" value = " <?php echo getqty('8'); ?> " readonly > </Font></td>
                                    
                                     
                                </tr> 
                                <tr>
                                        <td style="width:75px"><h4><?php echo "Line 9"; ?></h4></td>
                                        <td style="width:8px"></td>
                                         <td><h4><?php echo "in"; ?></h4></td>
                                         <td style="width:8px"></td>
                                    <td style="width:75px">  <input type="number" class="form-control productname" style="width:75px;" name="lin9" >
                                   
                                      
                                      </td>
                                      
                                    <td style="width:15px"></td>
                                            <td style="width:75px"><h4><?php echo "Out"; ?></h4></td>
                                    <td style="width:75px"> 
                                        
                                        <input type="number" class="form-control productname" style="width:75px;" name="lout9" >
                                   
                                       
                                      </td>
                                       <td style="width:15px"></td>
                                     <td style="width:75px"> <font color="red"> <input type="text" class="form-control productname" style="width:75px;" 
                                                                     name="tl2" value = " <?php echo getqty('9'); ?> " readonly > </Font></td>
                                </tr> 
                                <tr>
                                        <td style="width:75px"><h4><?php echo "Line 10"; ?></h4></td>
                                        <td style="width:8px"></td>
                                         <td><h4><?php echo "in"; ?></h4></td>
                                         <td style="width:8px"></td>
                                    <td style="width:75px">  <input type="number" class="form-control productname" style="width:75px;" name="lin10" >
                                   
                                      
                                      </td>
                                      
                                  <td style="width:15px"></td>
                                            <td style="width:75px"><h4><?php echo "Out"; ?></h4></td>
                                    <td style="width:75px"> 
                                        
                                        <input type="number" class="form-control productname" style="width:75px;" name="lout10" >
                                   
                                       
                                      </td>
                                   
                                      <td style="width:15px"></td>
                                     <td style="width:75px"> <font color="red"> <input type="text" class="form-control productname" style="width:75px;" 
                                                                     name="tl2" value = " <?php echo getqty('10'); ?> " readonly > </Font></td>
                                  
                                </tr> 
                                <tr>
                                        <td style="width:75px"><h4><?php echo "Line 11"; ?></h4></td>
                                        <td style="width:8px"></td>
                                         <td><h4><?php echo "in"; ?></h4></td>
                                         <td style="width:8px"></td>
                                    <td style="width:75px">  <input type="number" class="form-control productname" style="width:75px;" name="lin11" >
                                   
                                      
                                      </td>
                                      
                                     <td style="width:15px"></td>
                                            <td style="width:75px"><h4><?php echo "Out"; ?></h4></td>
                                    <td style="width:75px"> 
                                        
                                        <input type="number" class="form-control productname" style="width:75px;" name="lout11" >
                                   
                                       
                                      </td>
                                      <td style="width:15px"></td>
                                     <td style="width:75px"> <font color="red"> <input type="text" class="form-control productname" style="width:75px;" 
                                                                     name="tl2" value = " <?php echo getqty('11'); ?> " readonly > </Font></td>   
                                </tr> 
                                <tr>
                                        <td style="width:75px"><h4><?php echo "Line 12"; ?></h4></td>
                                        <td style="width:8px"></td>
                                         <td><h4><?php echo "in"; ?></h4></td>
                                         <td style="width:8px"></td>
                                    <td style="width:75px">  <input type="number" class="form-control productname" style="width:75px;" name="lin12" >
                                   
                                      
                                      </td>
                                      
                                     <td style="width:15px"></td>
                                            <td style="width:75px"><h4><?php echo "Out"; ?></h4></td>
                                    <td style="width:75px"> 
                                        
                                        <input type="number" class="form-control productname" style="width:75px;" name="lout12" >
                                   
                                       
                                      </td>
                                             <td style="width:15px"></td>
                                     <td style="width:75px"> <font color="red"> <input type="text" class="form-control productname" style="width:75px;" 
                                                                     name="tl2" value = " <?php echo getqty('12'); ?> " readonly > </Font></td>
                                </tr> 
                                <tr>
                                        <td style="width:75px"><h4><?php echo "Line 13"; ?></h4></td>
                                        <td style="width:8px"></td>
                                         <td><h4><?php echo "in"; ?></h4></td>
                                         <td style="width:8px"></td>
                                    <td style="width:75px">  <input type="number" class="form-control productname" style="width:75px;" name="lin13" >
                                   
                                      
                                      </td>
                                      
                                     <td style="width:15px"></td>
                                            <td style="width:75px"><h4><?php echo "Out"; ?></h4></td>
                                    <td style="width:75px"> 
                                        
                                        <input type="number" class="form-control productname" style="width:75px;" name="lout13" >
                                   
                                       
                                      </td>
                                        <td style="width:15px"></td>
                                     <td style="width:75px"> <font color="red"> <input type="text" class="form-control productname" style="width:75px;" 
                                                                     name="tl2" value = " <?php echo getqty('13'); ?> " readonly > </Font></td>
                                </tr> 
                                <tr>
                                        <td style="width:75px"><h4><?php echo "Line 14"; ?></h4></td>
                                        <td style="width:8px"></td>
                                         <td><h4><?php echo "in"; ?></h4></td>
                                         <td style="width:8px"></td>
                                    <td style="width:75px">  <input type="number" class="form-control productname" style="width:75px;" name="lin14" >
                                   
                                      
                                      </td>
                                      <td style="width:15px"></td>
                                    
                                            <td style="width:75px"><h4><?php echo "Out"; ?></h4></td>
                                    <td style="width:75px"> 
                                        
                                        <input type="number" class="form-control productname" style="width:75px;" name="lout14" >
                                   
                                       
                                      </td>
                                   <td style="width:15px"></td>
                                     <td style="width:75px"> <font color="red"> <input type="text" class="form-control productname" style="width:75px;" 
                                                                     name="tl2" value = " <?php echo getqty('14'); ?> " readonly > </Font></td>
                                 
                                </tr> 
                                
                            </tbody>
                        </table>
                         
      
              
  
          </div>  
         
       
      <div class="col-md-offset-1 col-md-4">
       
              
            <br>
            
               <table  id="myRegister" >
              
              
                 <tbody>
                                
                                <tr>
                                        <td style="width:75px"><h4><?php echo "Line 15"; ?></h4></td>
                                        <td style="width:8px"></td>
                                         <td><h4><?php echo "in"; ?></h4></td>
                                        <td style="width:8px"></td>
                                        <td style="width:75px">  <input type="number" class="form-control productname" style="width:75px;" name="lin15" >
                                   
                                      
                                      </td>
                                      <td style="width:15px"></td>
                                   
                                            <td style="width:75px"><h4><?php echo "Out"; ?></h4></td>
                                    <td style="width:75px"> 
                                        
                                        <input type="number" class="form-control productname" style="width:75px;" name="lout15" >
                                   
                                       
                                      </td>
                                     <td style="width:15px"></td>
                                     <td style="width:75px"> <font color="red"> <input type="text" class="form-control productname" style="width:75px;" 
                                                                     name="tl2" value = " <?php echo getqty('15'); ?> " readonly > </Font></td>
                      
                              </tr>              
                                  <tr>
                                        <td style="width:75px"><h4><?php echo "Line 16"; ?></h4></td>
                                    <td style="width:8px"></td>
                                         <td><h4><?php echo "in"; ?></h4></td>
                                         <td style="width:8px"></td>
                                    <td style="width:75px">  <input type="number" class="form-control productname" style="width:75px;" name="lin16" >
                                   
                                      
                                      </td>
                                      <td style="width:15px"></td>
                                   
                                            <td style="width:75px"><h4><?php echo "Out"; ?></h4></td>
                                    <td style="width:75px"> 
                                        
                                        <input type="number" class="form-control productname" style="width:75px;" name="lout16" >
                                   
                                       
                                      </td>
                                   <td style="width:15px"></td>
                                     <td style="width:75px"> <font color="red"> <input type="text" class="form-control productname" style="width:75px;" 
                                                                     name="tl2" value = " <?php echo getqty('16'); ?> " readonly > </Font></td>
                                
                                </tr> 
                                
                                <tr>
                                        <td style="width:75px"><h4><?php echo "Line 17"; ?></h4></td><td style="width:8px"></td>
                                         <td><h4><?php echo "in"; ?></h4></td>
                                        <td style="width:8px"></td>
                                    <td style="width:75px">  <input type="number" class="form-control productname" style="width:75px;" name="lin17" >
                                   
                                      
                                      </td>
                                      
                                    <td style="width:15px"></td>
                                            <td style="width:75px"><h4><?php echo "Out"; ?></h4></td>
                                    <td style="width:75px"> 
                                        
                                        <input type="number" class="form-control productname" style="width:75px;" name="lout17" >
                                   
                                       
                                      </td>
                                   
                                      <td style="width:15px"></td>
                                     <td style="width:75px"> <font color="red"> <input type="text" class="form-control productname" style="width:75px;" 
                                                                     name="tl2" value = " <?php echo getqty('17'); ?> " readonly > </Font></td>
                                     
                                </tr> 
                                <tr>
                                        <td style="width:75px"><h4><?php echo "Line 18"; ?></h4></td><td style="width:8px"></td>
                                         <td><h4><?php echo "in"; ?></h4></td>
                                        <td style="width:8px"></td>
                                    <td style="width:75px">  <input type="number" class="form-control productname" style="width:75px;" name="lin18" >
                                   
                                      
                                      </td>
                                      <td style="width:15px"></td>
                                     
                                            <td style="width:75px"><h4><?php echo "Out"; ?></h4></td>
                                    <td style="width:75px"> 
                                        
                                        <input type="number" class="form-control productname" style="width:75px;" name="lout18" >
                                   
                                       
                                      </td>
                                   
                                      <td style="width:15px"></td>
                                     <td style="width:75px"> <font color="red"> <input type="text" class="form-control productname" style="width:75px;" 
                                                                     name="tl2" value = " <?php echo getqty('18'); ?> " readonly > </Font></td>
                               
                                </tr> 
                                <tr>
                                        <td style="width:75px"><h4><?php echo "Line 19"; ?></h4></td><td style="width:8px"></td>
                                         <td><h4><?php echo "in"; ?></h4></td>
                                        <td style="width:8px"></td>
                                    <td style="width:75px">  <input type="number" class="form-control productname" style="width:75px;" name="lin19" >
                                   
                                      
                                      </td>
                                      <td style="width:15px"></td>
                                   
                                            <td style="width:75px"><h4><?php echo "Out"; ?></h4></td>
                                    <td style="width:75px"> 
                                        
                                        <input type="number" class="form-control productname" style="width:75px;" name="lout19" >
                                   
                                       
                                      </td>
                                   
                                      <td style="width:15px"></td>
                                     <td style="width:75px"> <font color="red"> <input type="text" class="form-control productname" style="width:75px;" 
                                                                     name="tl2" value = " <?php echo getqty('19'); ?> " readonly > </Font></td>
                           
                                <tr>
                                        <td style="width:75px"><h4><?php echo "Line 20"; ?></h4></td>
                                        <td style="width:8px"></td>
                                         <td><h4><?php echo "in"; ?></h4></td>
                                         <td style="width:8px"></td>
                                    <td style="width:75px">  <input type="number" class="form-control productname" style="width:75px;" name="lin20" >
                                   
                                      
                                      </td>
                                      <td style="width:15px"></td>
                                     
                                            <td style="width:75px"><h4><?php echo "Out"; ?></h4></td>
                                    <td style="width:75px"> 
                                        
                                        <input type="number" class="form-control productname" style="width:75px;" name="lout20" >
                                   
                                       
                                      </td>
                                   
                                      <td style="width:15px"></td>
                                     <td style="width:75px"> <font color="red"> <input type="text" class="form-control productname" style="width:75px;" 
                                                                     name="tl2" value = " <?php echo getqty('20'); ?> " readonly > </Font></td>
                                    
                                </tr> 
                                <tr>
                                        <td style="width:75px"><h4><?php echo "Line 21"; ?></h4></td><td style="width:8px"></td>
                                         <td><h4><?php echo "in"; ?></h4></td>
                                        <td style="width:8px"></td>
                                    <td style="width:75px">  <input type="number" class="form-control productname" style="width:75px;" name="lin21" >
                                   
                                      
                                      </td>
                                      
                                  <td style="width:15px"></td>
                                            <td style="width:75px"><h4><?php echo "Out"; ?></h4></td>
                                    <td style="width:75px"> 
                                        
                                        <input type="number" class="form-control productname" style="width:75px;" name="lout21" >
                                   
                                       
                                      </td>
                                   
                                      <td style="width:15px"></td>
                                     <td style="width:75px"> <font color="red"> <input type="text" class="form-control productname" style="width:75px;" 
                                                                     name="tl2" value = " <?php echo getqty('21'); ?> " readonly > </Font></td>

                                </tr> 
                                <tr>
                                        <td style="width:75px"><h4><?php echo "Line 22"; ?></h4></td>
                                        <td style="width:8px"></td>
                                         <td><h4><?php echo "in"; ?></h4></td>
                                         <td style="width:8px"></td>
                                    <td style="width:75px">  <input type="number" class="form-control productname" style="width:75px;" name="lin22" >
                                   
                                      
                                      </td>
                                      <td style="width:15px"></td>
                                  
                                            <td style="width:75px"><h4><?php echo "Out"; ?></h4></td>
                                    <td style="width:75px"> 
                                        
                                        <input type="number" class="form-control productname" style="width:75px;" name="lout22" >
                                   
                                       
                                      </td>
                                   
                                      <td style="width:15px"></td>
                                     <td style="width:75px"> <font color="red"> <input type="text" class="form-control productname" style="width:75px;" 
                                                                     name="tl2" value = " <?php echo getqty('22'); ?> " readonly > </Font></td>
                                    
                                     
                                </tr> 
                                <tr>
                                        <td style="width:75px"><h4><?php echo "Line 23"; ?></h4></td>
                                        <td style="width:8px"></td>
                                         <td><h4><?php echo "in"; ?></h4></td>
                                         <td style="width:8px"></td>
                                    <td style="width:75px">  <input type="number" class="form-control productname" style="width:75px;" name="lin23" >
                                   
                                      
                                      </td>
                                      
                                    <td style="width:15px"></td>
                                            <td style="width:75px"><h4><?php echo "Out"; ?></h4></td>
                                    <td style="width:75px"> 
                                        
                                        <input type="number" class="form-control productname" style="width:75px;" name="lout23" >
                                   
                                       
                                      </td>
                                   
                                      <td style="width:15px"></td>
                                     <td style="width:75px"> <font color="red"> <input type="text" class="form-control productname" style="width:75px;" 
                                                                     name="tl2" value = " <?php echo getqty('23'); ?> " readonly > </Font></td>
                                    
                                    
                                </tr> 
                                <tr>
                                        <td style="width:75px"><h4><?php echo "Line 24"; ?></h4></td>
                                        <td style="width:8px"></td>
                                         <td><h4><?php echo "in"; ?></h4></td>
                                         <td style="width:8px"></td>
                                    <td style="width:75px">  <input type="number" class="form-control productname" style="width:75px;" name="lin24" >
                                   
                                      
                                      </td>
                                      
                                  <td style="width:15px"></td>
                                            <td style="width:75px"><h4><?php echo "Out"; ?></h4></td>
                                    <td style="width:75px"> 
                                        
                                        <input type="number" class="form-control productname" style="width:75px;" name="lout24" >
                                   
                                       
                                      </td>
                                   
                                       <td style="width:15px"></td>
                                     <td style="width:75px"> <font color="red"> <input type="text" class="form-control productname" style="width:75px;" 
                                                                     name="tl2" value = " <?php echo getqty('24'); ?> " readonly > </Font></td>
                                   
                                    
                                  
                                </tr> 
                                <tr>
                                        <td style="width:75px"><h4><?php echo "Line 25"; ?></h4></td>
                                        <td style="width:8px"></td>
                                         <td><h4><?php echo "in"; ?></h4></td>
                                         <td style="width:8px"></td>
                                    <td style="width:75px">  <input type="number" class="form-control productname" style="width:75px;" name="lin25" >
                                   
                                      
                                      </td>
                                      
                                     <td style="width:15px"></td>
                                            <td style="width:75px"><h4><?php echo "Out"; ?></h4></td>
                                    <td style="width:75px"> 
                                        
                                        <input type="number" class="form-control productname" style="width:75px;" name="lout25" >
                                   
                                       
                                      </td>
                                        <td style="width:15px"></td>
                                     <td style="width:75px"> <font color="red"> <input type="text" class="form-control productname" style="width:75px;" 
                                                                     name="tl2" value = " <?php echo getqty('25'); ?> " readonly > </Font></td>
                                </tr> 
                                <tr>
                                        <td style="width:75px"><h4><?php echo "Line 26"; ?></h4></td>
                                        <td style="width:8px"></td>
                                         <td><h4><?php echo "in"; ?></h4></td>
                                         <td style="width:8px"></td>
                                    <td style="width:75px">  <input type="number" class="form-control productname" style="width:75px;" name="lin26" >
                                   
                                      
                                      </td>
                                      
                                     <td style="width:15px"></td>
                                            <td style="width:75px"><h4><?php echo "Out"; ?></h4></td>
                                    <td style="width:75px"> 
                                        
                                        <input type="number" class="form-control productname" style="width:75px;" name="lout26" >
                                   
                                       
                                      </td>
                                     <td style="width:15px"></td>
                                     <td style="width:75px"> <font color="red"> <input type="text" class="form-control productname" style="width:75px;" 
                                                                     name="tl2" value = " <?php echo getqty('26'); ?> " readonly > </Font></td>
                              
                                </tr> 
                                <tr>
                                        <td style="width:75px"><h4><?php echo "Line 27"; ?></h4></td>
                                        <td style="width:8px"></td>
                                         <td><h4><?php echo "in"; ?></h4></td>
                                         <td style="width:8px"></td>
                                    <td style="width:75px">  <input type="number" class="form-control productname" style="width:75px;" name="lin27" >
                                   
                                      
                                      </td>
                                      
                                     <td style="width:15px"></td>
                                            <td style="width:75px"><h4><?php echo "Out"; ?></h4></td>
                                    <td style="width:75px"> 
                                        
                                        <input type="number" class="form-control productname" style="width:75px;" name="lout27" >
                                    
                                      </td>
                                   
                                    <td style="width:15px"></td>
                                     <td style="width:75px"> <font color="red"> <input type="text" class="form-control productname" style="width:75px;" 
                                                                     name="tl2" value = " <?php echo getqty('27'); ?> " readonly > </Font></td>
                                </tr> 
                                <tr>
                                        <td style="width:75px"><h4><?php echo "Line 28"; ?></h4></td>
                                        <td style="width:8px"></td>
                                         <td><h4><?php echo "in"; ?></h4></td>
                                         <td style="width:8px"></td>
                                    <td style="width:75px">  <input type="number" class="form-control productname" style="width:75px;" name="lin28" >
                                   
                                      
                                      </td>
                                      <td style="width:15px"></td>
                                    
                                            <td style="width:75px"><h4><?php echo "Out"; ?></h4></td>
                                    <td style="width:75px"> 
                                        
                                        <input type="number" class="form-control productname" style="width:75px;" name="lout28" >
                                   
                                       
                                      </td>
                                   
                                      <td style="width:15px"></td>
                                     <td style="width:75px"> <font color="red"> <input type="text" class="form-control productname" style="width:75px;" 
                                                                     name="tl2" value = " <?php echo getqty('28'); ?> " readonly > </Font></td>
                                 
                                </tr> 
                                
                            </tbody>
                        </table>
              
              
 
     </div>
         
     
           <div class="row">
                   <br/>  <br/>
           </div>
         
             <div class="row">
                 <!-- ./col --------------------------------------------------------------------------------------------->        
                
                 <hr>
         <div class="col-lg-12">    
                  <div class="col-md-offset-1 col-md-4">
         
                    
                                <button type="submit" class="btn btn-primary" name="update" id="update">Update All</button> &nbsp;&nbsp;
                     
                             <button type="submit" class="btn btn-primary" name="clear" id="clear" >Clear All</button>&nbsp;&nbsp;
                              
              <a href="dashboard.php" class="btn btn-warning">Dashboard</a>
             
           
             <a href="setting.php" class="btn btn-primary">Setting</a>&nbsp;&nbsp;
               
               
                 </div>
              
                   
		  </div>
                 
              </div>    
                 
                 
  
         
         
                
              
   
        
        
  
                 <!-- ./col --------------------------------------------------------------------------------------------->        
              
      
         
  
        
       </form>      

             
        
        
    </section>
    <!-- /.content -->
    
     
     <div class="row">
                 <!-- ./col --------------------------------------------------------------------------------------------->        
              
         <div class="col-lg-12"  style="background-color: #f1f1f1;">    
                  <div class="col-lg-4 col-xs-4">
                  
                      
                     
                 </div>
                  <div class="col-lg-4 col-xs-4">
                      <center>
                  <a>
                        <strong>Copyright &copy; 2022 <a href="">BUILDTECK asia</a>.</strong> 
                        
                    </a>
                      </center>
                 </div>
                  <div class="col-lg-4 col-xs-4">
                   
		  
            
                  <!-- Tasks Menu -->
	
                  <!-- Tasks Menu -->
	
         
            
                     
                 </div>
                 
              </div>    
                 
                 
      </div>
    
    
    
    
    
    
    
    
    
    
 
  <!-- /.content-wrapper -->

   <script>

  $(document).ready(function(){
   $('#ty').on('change',function(){

    if($(this).val() == 'Available Stock123' )
        //$("#employee_id").attr("disabled", "disabled"); 
            
           
             $("#dt2").prop("disabled", true),
         $("#dt1").prop("disabled", true),
          $("#pq").prop("disabled", true);
         
    else
        //$("#employee_id").removeAttr("disabled");
             $("#dt2").prop("disabled", false),
             $("#dt1").prop("disabled", false), 
          $("#pq").prop("disabled", false); 
    
    });
});
  
    
   </script>
  
  
  
  
  
  
  
   <script>
      var ctx = document.getElementById('myBestSellItem');
      var myChart = new Chart(ctx, {
          type: 'bar',
          data: {
              labels: <?php echo json_encode($pname); ?>,
              datasets: [{
                  label: 'Total Produk Terjual',
                  data: <?php echo json_encode($qty); ?>,
                  backgroundColor: 'rgb(120,112,175)',
                  borderColor: 'rgb(255,255,255)',
                  borderWidth: 1
              }]
          },
          options: {}
      });
  </script>


