<?php $PageSecurity = 11;
include('includes/session.inc');
//include('includes/header.inc');
include('includes/SQL_CommonFunctions.inc');
include('includes/function_lib.php');
if($_REQUEST['site']!='')
{	
	  $itemname="select * from item_master where item_name like '%".$_REQUEST['site']."%'";	
	  $item_res=DB_query($itemname,$db);
	  $data3='';
	  $data3.="<table width='100%' border='0' align='center' cellpadding=1' cellspacing='3' id='tab'>";
      $data3.="<tr>";
       $data3.="<th><strong>Item Code</strong></th>";
        $data3.="<th><strong>Item Name </strong></th>";
		$data3.="<th><strong>Description </strong></th>";
		$data3.="<th><strong>UOM</strong></th>";
		$data3.="</tr>";
		 while($myrow =DB_fetch_array($item_res))
	     {  
		$u_sql=DB_query("Select unitname from unitsofmeasure where unitid='".$myrow['unit']."'",$db);
		$u_row=DB_fetch_array($u_sql);
		$group=DB_query("select categorydescription from stockcategory where categoryid='".$myrow['SubCategoryID']."'",$db);
		$groupdata=DB_fetch_array($group);
		$m_sql=DB_query("Select manufacturer from product_manufacture where id='".$myrow['make']."'",$db);
		$m_row=DB_fetch_array($m_sql);
		$g_sql=DB_query("Select grade from product_grade where id='".$myrow['grade']."'",$db);
		$g_row=DB_fetch_array($g_sql);
		$gs_sql=DB_query("Select gsm from gsm where id='".$myrow['gsm']."'",$db);
		$gs_row=DB_fetch_array($gs_sql);

 
 
        $data3.="<tr bgcolor='#FFFFFF'>";
      $data3."<td><a href='javascript:loadValue('".$myrow['StockID']."','".$myrow['item_name']."','".$u_row['unitname']."',
      	'".$groupdata['categorydescription']."','".$m_row['manufacturer']."','".$g_row['grade']."','".$gs_row['gsm']."','".$myrow['size']."'
      	,'".$ct[2]."')'>'".$myrow['StockID']."'</a></td>";
       $data3.="<td>".$myrow['item_name']."</td>";
		$data3.="<td>".$myrow['descriptions']."</td>";
		$data3.="<td>".$myrow['UOM']."</td>";
		      $data3.="</tr>"; 
 
               }
              $data3.="</table>"; 
              
    echo  $data=$data3;          
           }  ?>
