<style>
.types_class1 { 
    width:100%; height:32px;
    background-color: transparent;  
    border-style: solid;  
    border-width: 0px 0px 1px 0px;  
    border-color:#CCC; 
    outline:0;
	font-family:Segoe, 'Segoe UI', 'DejaVu Sans', 'Trebuchet MS', Verdana, sans-serif; font-size:14px
  }
</style>
<?php error_reporting(0);
/***************************** PREVIOUS NEXT CODING ****************************************/
 include("../../include/db.php");
  $jobcard_no=$_POST['job_no'];
  function get_delivered_qty1($jobcard_no,$inward_particular)
{ 
	    $sql_user="select sum(qty) as qty  from  delivery_challan_sub where job_no='$jobcard_no' and particulars='$inward_particular'";
		$rs_user=mysql_query($sql_user);
		while($rsdata_user=mysql_fetch_object($rs_user))
		{ 
		 $qty=$rsdata_user->qty;
		}
			return $qty;
		}
		
		function get_delivered_qty2($jobcard_no,$inward_particular)
{ 
	      $sql_user="select sum(prod_qty) as prod_qty  from  fusing_production_sublist where job_card_no='$jobcard_no' and prod_size='$deliv_particulars'";
		 $rs_user=mysql_query($sql_user);
			while($rsdata_user=mysql_fetch_object($rs_user))
			{ 
			 $prod_qty=$rsdata_user->prod_qty;
			}
			return $prod_qty;
		}
	?>
           <select name="deliv_particular" id="deliv_particular" onFocus="get_sub_details('<?php echo $jobcard_no;  ?>',this.value)"
           onChange="get_sub_details('<?php echo $jobcard_no;  ?>',this.value),enterevent(event,'inward_qty','deliv_particular')" tabindex="3" class="types_class1" >
           <option value="">Select</option>
           <?php 
 
		    $sql_user="select distinct(prod_size) from  fusing_production_sublist where job_card_no='$jobcard_no' ";
		    $rs_user=mysql_query($sql_user);
			while($rsdata_user=mysql_fetch_object($rs_user))
			{ 
			$inward_particular=$rsdata_user->prod_size;
			 $bal_qty1 = get_delivered_qty1($jobcard_no,$inward_particular);
			 $bal_qty2 = get_delivered_qty2($jobcard_no,$inward_particular);
			 $overall_balance = $bal_qty2-$bal_qty1;
			 /*if($overall_balance==0)
			 {*/
		    ?>
          <option value="<?php echo $inward_particular;?>" onKeyUp="enterevent(event,'inward_qty','deliv_particular')" ><?php echo $inward_particular;?>
          </option>
          <?php 
		   /*}*/
		   }
		  ?>
         </select>
            
            