<?php 
include("../../include/dbconnect.php");
?>
<title> Sales Tax Structure edit</title>
<body background="../../images/fibermat.gif">
<center>
<table cellpadding=0 cellspacing=4 width=590>
<tr>
<td style="padding:3px;" colspan=2 bgcolor="#93BEE2"><font face='Arial, Helvetica, sans-serif'><b>GST Structure edit</b></font></td>
</tr><tr valign="top"><td colspan=2>
<font >&nbsp;</font>
</td>
</tr>
</table>
<table border=0 cellpadding=3 cellspacing=4 width="590">
<form name="form1" method="POST"  action="update.php?<?echo($record);?>">

<? 	

$result=mysqli_query($conn,"select * from salestax where record = '$record' ");
$row1=mysqli_fetch_row($result);
?>

<tr><td><font face='Arial, Helvetica, sans-serif'><b>Tax Type </b></font></td><td>
<input type="text"    onKeyPress="return event.keyCode!=13"   maxlength=8 size="8" name="taxtype" value = <?php echo($row1[0]);?>></td></tr>


<tr><td><font face='Arial, Helvetica, sans-serif'><b>Description</b></font></td><td>
<input type="text"    onKeyPress="return event.keyCode!=13"   size="40" name="description" value = <?php echo("'$row1[1]'");?>>  </td></tr>


<tr><td><font face='Arial, Helvetica, sans-serif'><b>Tax %</b></font></td><td>
<input type="text"    onKeyPress="return event.keyCode!=13"   size="40" name="tax" value = <?php echo("'$row1[2]'");?>>  </td></tr>

<tr><td><font face='Arial, Helvetica, sans-serif'><b>Cess %</b></font></td><td>
<input type="text"    onKeyPress="return event.keyCode!=13"   size="40" name="cess" value = <?php echo("'$row1[3]'");?>>  </td></tr>

    <tr>
      <td width="104" height="31" align="left" ><b><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif">SGST GL</font></b></td>
      <td  ><?


$res = mysqli_query($conn,"SELECT distinct salestax.sgst_acctcode,acctmast.description from salestax,acctmast where salestax.sgst_acctcode = acctmast.acctcode and salestax.record = '$record' ") or die(mysqli_error());
$arr = mysqli_fetch_row($res);

$sBuyQuery = mysqli_query($conn,"SELECT distinct acctmast.acctcode,description from acctmast where acctgroup != '111206' and acctgroup != '111303' order  by acctmast.description ") or die(mysqli_error());
?>
          <select name='sgst_acctcode'>
            <?
		echo "<option selected value=\"$arr[0]\">$arr[1]";
		while($row = mysqli_fetch_row($sBuyQuery))
		{

				echo "<option value=\"$row[0]\">$row[1]";
		}
?>
        </select></td>
		
    </tr>



   <tr>
      <td width="104" height="31" align="left" ><b><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif">CGST GL</font></b></td>
      <td  ><?


$res = mysqli_query($conn,"SELECT distinct salestax.cgst_acctcode,acctmast.description from salestax,acctmast where salestax.cgst_acctcode = acctmast.acctcode and salestax.record = '$record' ") or die(mysqli_error());
$arr = mysqli_fetch_row($res);

$sBuyQuery = mysqli_query($conn,"SELECT distinct acctmast.acctcode,description from acctmast where acctgroup != '111206' and acctgroup != '111303' order  by acctmast.description ") or die(mysqli_error());
?>
          <select name='cgst_acctcode'>
            <?
		echo "<option selected value=\"$arr[0]\">$arr[1]";
		while($row = mysqli_fetch_row($sBuyQuery))
		{

				echo "<option value=\"$row[0]\">$row[1]";
		}
?>
        </select></td>
		
    </tr>


   <tr>
      <td width="104" height="31" align="left" ><b><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif">IGST GL</font></b></td>
      <td  ><?


$res = mysqli_query($conn,"SELECT distinct salestax.igst_acctcode,acctmast.description from salestax,acctmast where salestax.igst_acctcode = acctmast.acctcode and salestax.record = '$record' ") or die(mysqli_error());
$arr = mysqli_fetch_row($res);

$sBuyQuery = mysqli_query($conn,"SELECT distinct acctmast.acctcode,description from acctmast where acctgroup != '111206' and acctgroup != '111303' order  by acctmast.description ") or die(mysqli_error());
?>
          <select name='igst_acctcode'>
            <?
		echo "<option selected value=\"$arr[0]\">$arr[1]";
		while($row = mysqli_fetch_row($sBuyQuery))
		{

				echo "<option value=\"$row[0]\">$row[1]";
		}
?>
        </select></td>
		
    </tr>
    

   <tr>
      <td width="104" height="31" align="left" ><b><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif">Cess GL</font></b></td>
      <td  ><?


$res = mysqli_query($conn,"SELECT distinct salestax.sgst_acctcode,acctmast.description from salestax,acctmast where salestax.cess_acctcode = acctmast.acctcode and salestax.record = '$record' ") or die(mysqli_error());
$arr = mysqli_fetch_row($res);

$sBuyQuery = mysqli_query($conn,"SELECT distinct acctmast.acctcode,description from acctmast where acctgroup != '111206' and acctgroup != '111303' order  by acctmast.description ") or die(mysqli_error());
?>
          <select name='cess_acctcode'>
            <?
		echo "<option selected value=\"$arr[0]\">$arr[1]";
		while($row = mysqli_fetch_row($sBuyQuery))
		{

				echo "<option value=\"$row[0]\">$row[1]";
		}
?>
        </select></td>
		
    </tr>

   <tr>
      <td width="104" height="31" align="left" ><b><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif">GL for Sales / Purchase</font></b></td>
      <td  ><?


$res = mysqli_query($conn,"SELECT distinct salestax.sp_acctcode,acctmast.description from salestax,acctmast where salestax.sp_acctcode = acctmast.acctcode and salestax.record = '$record' ") or die(mysqli_error());
$arr = mysqli_fetch_row($res);

$sBuyQuery = mysqli_query($conn,"SELECT distinct acctmast.acctcode,description from acctmast where acctgroup != '111206' and acctgroup != '111303' order  by acctmast.description ") or die(mysqli_error());
?>
          <select name='sp_acctcode' >
            <?
		echo "<option selected value=\"$arr[0]\">$arr[1]";
		while($row = mysqli_fetch_row($sBuyQuery))
		{
			echo "<option value=\"$row[0]\">$row[1]";
		}
?>
        </select></td>
		
    </tr>


<tr>
  <td><font face='Arial, Helvetica, sans-serif'><b>Reserved word(GST)</b></font></td>
  <td>
<input type="text"    onKeyPress="return event.keyCode!=13"   size="40" name="reserved_word" value = <?php echo("'$row1[9]'");?>>  </td></tr>


<input type="hidden" name="record" value="<?echo $record;?>">

<table cellpading=0 cellspacing=10 width= 50>
<tr><blockquote>
<td>
   <input type =submit name=submit value = "Update"></td> <td><input type =submit name=submit value = "Delete"></td></blockquote></tr>
</table>

</table>
<br><br><font size=1><center><a href= "index.html">Return to index page</center></font>
                                                                             
</body>
</form>
