<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:ivory}
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>
<?
/*$link=mysqli_connect("localhost.localdomain","root");
mysqli_select_db("alpdb") or die ("<h3> Error:Database could not be connected-".mysqli_error($db));
*/
include("opendb.php");
$cde=$_REQUEST['cde'];
$type=$_REQUEST['type'];



$cde=str_replace("-"," ",$cde);
if($type!='sub')
{
$result=mysqli_query($db,"select * from acgroups where gname='$cde'");
$row=mysqli_fetch_row($result);
?>
<center>
<form action="updagroup.php" method=post>
<table>
<tr><td colspan=2 bgcolor=#5b5858 align=center><font color=white size=3>GROUP MODIFICATION</font></tr></td>
<tr><td>Group Name</td><td><input type=text readonly name=gname size=40 value='<?print $row[0]?>' style={background-color:silver}></td></tr>
<tr><td>Nature of Group </td><td>
<select name=nature>
<option><?print $row[1]?></option>
<option>Assets</option>
<option>Liablities</option>
<option>Income</option>
<option>Expenses</option>
</select>
Level <input type=text name=level value='<?print $row[2]?>' size=3>
</td></tr>
<tr><td colspan=2 bgcolor=#5b5858 align=center>
<input type=submit value="Change"> <input type=button value="Cancel" onClick=history.back(1)>
</tr></td>
</table>
</form>
<?
}
else
{
$result=mysqli_query($db,"select * from acgroups where gname='$cde'")or die(mysqli_error($db));
$row=mysqli_fetch_array($result)
?>
<center>
<form name=f1 action='updsubgroup.php'>
<input type=hidden name=code value='<?print $cde?>'>
<table>
<tr><td colspan=2 bgcolor=#5b5858 align=center><font color=white size=3>UPDATE SUBGROUP</font></tr></td>
<tr><td>Sub Group Name</td><td><input type=text READONLY name=subgname size=40 value='<?print $row[gname]?>'></td></tr>
<tr><td>Sub Group Name</td><td><input type=text  name=subgname1 size=40 value='<?print $row[gname]?>'></td></tr>

<tr><td>Nature of Group </td><td>
<select name=nature onChange='showexgrp(this)'>
<option value='<?print $row[nature]?>'><?print $row[nature]?></option>
<option value='Assets'>Assets</option>
<option value='Liabilities'>Liabilities</option>
<option value='Income'>Income</option>
<option value='Expenses'>Expenses</option>
</select>
Level <input type=text name=level size=3 value='<?print $row[level]?>'>
P&L Level <input type=text name=ghlevel size=3 value='<?print $row[ghlevel]?>'></td></tr>
<tr><td>Under Group</td><td><input type=text readonly name=ungrp size=40 value='<?print $row[headgroup]?>'></td></tr>
<tr><td>Receipt&Payment Aspect</td><td>
<select name=rnd>
<?
$re=mysqli_query($db,"select rnd from acgroups where gname='$cde'") or die(mysqli_error($db));
$ro=mysqli_fetch_row($re);
print "<option>$ro[0]</option>";
?>
<option>No</option>
<option>Yes</option>
</select>
<tr><td colspan=2 bgcolor=#5b5858 align=center>
<input type=submit value="Update" style={font-weight:bold}> <input type=button value="Cancel" onClick=document.location='acgroup.php'>
</tr></td>
</table>
</form>
<?
}
?>
<script>
function showexgrp(nat)
{
  nature=nat.value;
  if(nature!='')
   window.open('exgrp.php?nature='+nature,menubar=false,resizable=false);
}
</script>

