<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";
		$rs_user1=mysql_query($sql_user1);
			while($rsdata_user1=mysql_fetch_object($rs_user1))
			{ 
			$qty=$rsdata_user1->qty;
			}
return $qty;
}
function get_prd_qty($jobcard_no,$particulars,$width,$height)
{
		$sql_user="select sum(prod_qty) as prod_qty from  printer_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:29px;font-size:14px" onChange="get_tot_qty_print('<?php echo $jobcard_no;?>',this.value),printer_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";
		$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;
			$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>