<?php
session_start();
include_once('opendb.php');
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='inde.php'; </script>";
 return;
}
$cname=$_REQUEST['cname'];

if(strlen($user)<=0)
{
  print "<script> alert('Invalid User'); document.location='inde.php' </script>";
  return;
}

$sql="SELECT gname FROM partmaster where partcode='$cname'";
$result = mysqli_query($db,$sql);
$row=mysqli_fetch_row($result);
$g=mysqli_query($db,"select distinct(gname) from groupmaster order by gname asc");
?>
<select name='grp'>
<?
    while($grow=mysqli_fetch_array($g))
{
?>
<option value="<? echo $grow[0] ?>"<? if($row[0]==$grow[0]) echo 'selected="selected"';?>><? echo $grow[0] ?></option>
<?
}
?>
</select>



