<?
session_start();
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
include("includes/top.php");
if(strlen($brcode)<=0 && strlen($user)<=0)
{
 print "<script> alert('Please login again'); parent.document.location='ind.php'; </script>";
 return;
}

?>
<style>
 td{font-family:verdana;font-size:14;color:black;}
 th{font-family:verdana;font-size:14;color:white;background-color:#5b5858}
 body{background-color:silver;}
 select
  {border-style:ridge;
   border-color:black;
   height:25px;
   border-size=1;
   font-family:verdana;
   color:black;
  }
 input
  {border-style:ridge;
   border-color:#22437f;
   background-color:white;
   height:25px;
   font-weight:bold;
   border-size=1;
   font-family:sans-serif;
   color:BLACK;
  }
</style>
<script>
function showexgrp(nat)
{
  nature=nat.value;
  if(nature!='')
   window.open('exgrp.php?nature='+nature,menubar=false,resizable=false);
}
function rnd1()
{
 window.open('chkrnd.php',menubar=false,resizable=false);
}
function chkey(abc)
{
 yy=abc.value
 if(yy.indexOf('  ')>-1) 
  {
    alert('Multiple space is not allowed');
    abc.value='';
  }
 if(yy.indexOf("'")>-1) 
  {
    alert("\' is not allowed");
    abc.value='';
  }

}
</script>
<?
include("opendb.php");
$us=mysqli_query($db,"select level from bruser where username='$user'")or die(mysqli_error($db));
$r=mysqli_fetch_row($us);
$user_level=$r[0];
 print "User Level:".$user_level;

if($user_level>='4'||$user=='admin')
{
?>
<body onLoad=document.f1.subgname.focus()>
<center>

<!-- <form name=f1 action="svacgroup.php" method=post>-->
<form name=f1 action="svhsnmast.php" method=post>

<table>
<tr><td colspan=2 bgcolor=#5b5858 align=center><font color=white size=3>HSN CODE MASTER</font></tr></td>
<tr><td>Head</td><td><input type=text name=subgname size=40 onKeyDown=chkey(this)></td></tr>

<tr><td>HSN CODE</td><td><input type=text name=ungrp size=40 style={background-color:silver}></td></tr>

<tr><td colspan=2 bgcolor=#5b5858 align=center>
<input type=submit value="Add"> <input type=button value="Cancel" onClick=document.location='blank.html'>
</tr></td>
</table>
</form>


<table border=0 cellspacing=1 cellpadding=1 bgcolor=black width=>
<tr bgcolor='silver'><td width=5><center><b>No.</td><td width=300><center><b>Head </td><td><center><b>HSN CODE</td></tr>
<?
include("opendb.php");
$result=mysqli_query($db,"select * from hsnmast  ")or die(mysqli_error($db));
$i=1;
while($row=mysqli_fetch_array($result))
{
print "\n<tr bgcolor='#fffcd6' onMouseOver=bgColor='#f7dbd4'; onMouseOut=bgColor='#fffcd6'>";
print "<td>".$i++."</td><td>$row[0]</td><td>$row[1]</td></tr>";
//<td><input type=button value='Edit' onClick=show('".str_replace(' ','-',$row[0])."')></tr>";
}
print "</table><br>";
?>
<?
}
//include("listacgroups.php");
?>

