<style>
.style1 {border-top: solid 1px;border-top-color: #CCCCCC;}
.style21 {border-bottom: solid 1px;border-bottom-color: #CCCCCC;}
.style5 {border-left: solid 1px;border-left-color: #CCCCCC;}
.style3{ border-right: solid 1px;border-right-color: #CCCCCC; }
.style4 {border-bottom: solid 1px;border-bottom-color: #CCCCCC;}
.text{ font-family: Verdana; font-size:13px;}
#tot_amt::-webkit-input-placeholder { color:#666; }
</style>
<?php error_reporting(0);
/***************************** PREVIOUS NEXT CODING ****************************************/
 include("../../include/db.php");
 $jobcard_no=$_POST['jobcard_no'];
 function get_total_qty($jobcard_no,$particulars,$width,$height)
{
					//$sql_user1="select sum(qty) as qty from  jobcard_sublist where jobcard_no='$jobcard_no' and particulars='$particulars' and width='$width'  and height='$height' order by particulars asc";
					$sql_user1="select sum(inward_qty) as inward_qty from  inward_sub_list where jobcard_no='$jobcard_no' and inward_particular='$particulars' and roll_width='$width'  and kg_height='$height' order by inward_particular asc";
		$rs_user1=mysql_query($sql_user1);
			while($rsdata_user1=mysql_fetch_object($rs_user1))
			{ 
			// $qty=$rsdata_user1->qty;
			$qty=$rsdata_user1->inward_qty;
			}
return $qty;
}
function get_prd_qty($jobcard_no,$particulars,$width,$height)
{
		$sql_user="select sum(prod_qty) as prod_qty from  fusing_production_sublist where job_card_no='$jobcard_no' and prod_size='$particulars' and width='$width' and height='$height'";
		$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="prod_size" id="prod_size" class="types_class" tabindex="7"  style="width:100%; height:30px; font-size:14px" onChange="get_fusing_tot_qty('<?php echo $jobcard_no;?>',this.value),fusing_clear_validation(this.value),enterevent(event,'total_qty','prod_size')">
    <option value="">--Select--</option>
    <?php
	// $sql_user="select * from  jobcard_sublist where jobcard_no='$jobcard_no' order by particulars asc";
	$sql_user="select jobcard_no,inward_particular,roll_width,kg_height from  inward_sub_list where jobcard_no='$jobcard_no' order by inward_particular asc";
		$rs_user=mysql_query($sql_user);
			while($rsdata_user=mysql_fetch_object($rs_user))
			{ 
			// $particulars=$rsdata_user->particulars;
			// $width=$rsdata_user->width;
			// $height=$rsdata_user->height;
			$jobcard_no=$rsdata_user->jobcard_no;
			$particulars=$rsdata_user->inward_particular;
			$width=$rsdata_user->roll_width;
			$height=$rsdata_user->kg_height;
			$qty=get_total_qty($jobcard_no,$particulars,$width,$height);
			$prod_qty=get_prd_qty($jobcard_no,$particulars,$width,$height);
			$totz_qty=$qty-$prod_qty;
			$overall=$particulars."@#@#".$width."@#@#".$height;
if($totz_qty>0){

	?>
    <option value="<?php echo $overall;?>"><?php echo $particulars."   (".$width." x ".$height.")";?></option>
    <?php }} ?>
    </select>
