  <script>
       <?php
        $select = $pdo2->prepare("SELECT qty as total FROM linebalance where lid='1'");
        $select->execute();
        $row=$select->fetch(PDO::FETCH_OBJ);
        $tl = $row->total ;
        ?>
     
 var as=<?php echo"$tl" ?>;
 var ele3='l2';
 
 var ele2 = document.getElementById(ele3);
 if (as==10)
 
 {
    
      
   ele2.style.backgroundColor = 'green';
 }else{
   ele2.style.backgroundColor = 'red';
   
    var blink_speed = 1000; // every 1000 == 1 second, adjust to suit
   var t = setInterval(function () {
    var ele = document.getElementById(ele3);
    ele.style.visibility = (ele.style.visibility == 'hidden' ? '' : 'hidden');
}, blink_speed);
    }
   </script>

