<?php
 $PageSecurity = 2;
include('includes/DefineSuppTransClass.php');
include('includes/DefinePOClass.php');
include('includes/SQL_CommonFunctions.inc');
include('includes/session.inc');
include('includes/function_lib.php');

   $data1='';
   $data1.="<select name='finished_item' style='width:150px' id='finished_item' onchange='GetItemQty(this.value)'>
	    <option value='0'>Select</option>";	
	//echo "Select * from salesorder_details where masterId='".$_REQUEST['salid']."' order by id ASC";
    $sql_wo=DB_query("Select fpr_flag from fin_Product where company_id='".$_SESSION['ACGCompanyId']."' order by id ASC",$db);
                   $result_wo=DB_fetch_array($sql_wo);
                   if($result_wo['fpr_flag']=='0'){
   
	$floor_sql=DB_query("Select * from salesorder_details where masterId='".$_REQUEST['salid']."' order by id ASC   ",$db);
                   }
                   else
                   {
                 
	$floor_sql=DB_query("Select * from prd_wo_details where parentid='".$_REQUEST['salid']."' group by mst_itemid ASC   ",$db);   
                   }
	while($floor_row=DB_fetch_array($floor_sql))
	{
	$item=$s->getField('item_master','id',$floor_row['mst_itemid'],'item_name');
	
$data1.="<option value='".$floor_row['mst_itemid']."'>".$item."</option>";
		
	 } 
	
    $data1.="</select>";
			
$data2='';

  
	$data2.="<select name='job_card_no' style='width:150px;' id='job_card_no' onchange='Get_oderdata1(this.value)'  >
	   <option value='0'>Select</option>";
	
	//echo "Select * from job_card where wo_no='".$_REQUEST['salid']."' order by id ASC ";
	//echo "Select * from job_card where wo_no='".$_REQUEST['salid']."' and status='Close' order by id ASC";
	 $sql_wo=DB_query("Select fpr_flag from fin_Product where company_id='".$_SESSION['ACGCompanyId']."' order by id ASC",$db);
                   $result_wo=DB_fetch_array($sql_wo);
                   if($result_wo['fpr_flag']=='0'){
	$floor_sql=DB_query("Select * from job_card where wo_no='".$_REQUEST['salid']."'  order by id ASC   ",$db);
                   }
                else 
                {
            $floor_sql=DB_query("Select * from job_card where wo_no='".$_REQUEST['salid']."' and against_daily_status=1  order by id ASC   ",$db);     
                 
                }
                
	while($floor_row=DB_fetch_array($floor_sql))
	{
	     
	
	
$data2.="<option value=".$floor_row['id'].">".$floor_row['job_card_no']."</option>";
		
	 } 
	
    $data2.="</select>";
	
	echo $data=$data1."__".$data2;
			
			
			
