<?php
$PageSecurity = 2;
include('includes/session.inc');
$title = _('View/Search Items') ;
include('includes/SQL_CommonFunctions.inc');
$arrayItem=explode(",",$_REQUEST['q']);
$newString=implode("','",$arrayItem);
//echo $newString;
//echo "Select * from item_master where SubCategoryID in ('".$newString."')";
$item_sql=DB_query("Select * from item_master where SubCategoryID in ('".$newString."')",$db);
?>
<div style="overflow:auto; height:100px; width:98%; border:1px solid #808080; " >
<?php $num=DB_num_rows($item_sql); if($num>0){?>
	<input type="checkbox" name="subgroup" id="subgroup" value="0" onclick="subitems()">All<br />
<?php } ?>	
	<?php 
	$items=explode(",",$_REQUEST['arr']);
	$c3=0;
	while($row3=DB_fetch_array($item_sql))
	{ 
		$checked='';
		for($x=0;$x<count($items);$x++)
		{	
			 if($items[$x]==$row3['id'])
			 $checked="checked";
		}	
	?>
	<input type="checkbox" name="item[]" id="item_<?php echo $c3;?>" value="<?php echo $row3['id'];?>" <?php echo $checked;?>/><?php echo $row3['StockID']." - ".$row3['item_name'];?><br />
	<?php 	
	$c3++;
	}
	?>
	</div>