<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");
 $job_card_nos=$_POST['job_card_nos'];
  $return_no=$_POST['return_no'];
  $invoice_no=$_POST['invoice_no'];

 $res_fsdf=$_GET['res'];
function  get_media_in_quants($particular_nam,$job_card_nos,$invoice_no)
{
 $sql="select sum(qty) as qty from media_pur_sublist where particulars_id='$particular_nam'  and media_pur_no='$job_card_nos' and invoice_no='$invoice_no'";
  $rs=mysql_query($sql);
  while($rsdata=mysql_fetch_array($rs))
  {
   				$qty=$rsdata['qty'];
  }
  return $qty;
}
function  get_media_out_quants($particular_nam,$return_no,$invoice_no)
{
  $sql="select sum(qty) as out_qty from return_media_pur_sublist where particulars_id='$particular_nam'  and return_no='$return_no' and invoice_no='$invoice_no'";
  $rs=mysql_query($sql);
  while($rsdata=mysql_fetch_array($rs))
  {
   				$out_qty=$rsdata['out_qty'];
  }
  return $out_qty;
}

 ?>

	
     <select name="particulars" id="particulars" class="types_class1" tabindex="3" onchange="get_qty_fun(this.value,'<?php echo $job_card_nos;?>','<?php echo $return_no; ?>'),cons_ret_media_clear_valid_sub(this.value)"  style="width:100%; height:32px; font-family:Segoe, 'Segoe UI', 'DejaVu Sans', 'Trebuchet MS', Verdana, sans-serif; font-size:14px">
         <option value="" >select</option>
<?php 
  $parti=mysql_query("SELECT *  FROM `media_pur_sublist` WHERE `media_pur_no`='$job_card_nos' and invoice_no='$invoice_no'");

 while($get_res=mysql_fetch_array($parti))
 {
	 $particular_nam=$get_res['particulars_id'];
	 $in_quants=get_media_in_quants($particular_nam,$job_card_nos,$invoice_no);
	 $out_quants=get_media_out_quants($particular_nam,$return_no,$invoice_no);
	 $whole=$in_quants-$out_quants;
	 if(($in_quants!=$out_quants)&&($whole!=0))
	 {
	?>
    <option value="<?php echo $get_res['particulars_id'];?>" ><?php echo $get_res['particulars']; ?></option>
        <?php }} ?>
    </select>
    
