<?php 
$PageSecurity = 11;
include('includes/session.inc');
include('includes/function_lib.php');
if($_REQUEST['shadecode']=='new')
{?>

<input type="text" name="item_code_new" id="item_code_new" style="width:180px;" />

<?php } else {?>
<select name="item_code" id="item_code" style="width:180px;">
				<?php $itemcode=DB_query("Select id,StockID,item_name from item_master where id='".$_REQUEST['shadecode']."'",$db); 
					  while($itemcodeRow=DB_fetch_array($itemcode)){
					  $sel='';
					  if($item_code==$itemcodeRow['id'])
					  $sel='selected';
					  ?>
				<option value="<? echo $itemcodeRow['id']; ?>"<?php echo $sel; ?>><? echo $itemcodeRow['StockID']; ?></option>
				<?php } ?>
	      </select>
<?php } ?>		  