<? 
session_start();
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
//$br=$_SESSION['branch'];
if(strlen($user)<=0)
{
  print "<script> alert('Invalid User'); document.location='inde.php' </script>";
  return;
}


include("opendb.php");
include("test.php");
?>
<link href="css/form.css" type="text/css" rel="stylesheet" media="screen" />
<?
if(isset($_POST[sprint]))

{ 
$jtype=$_REQUEST['jtype'];
$jtype1=$_REQUEST['jtype1'];
$jtype2=$_REQUEST['jtype2'];
$jtype3=$_REQUEST['jtype3'];
$jtype4=$_REQUEST['jtype4'];
$jtype5=$_REQUEST['jtype5'];
$jtype6=$_REQUEST['jtype6'];
$jtype7=$_REQUEST['jtype7'];
$jtype8=$_REQUEST['jtype8'];
$col3name=$_REQUEST['col3name'];
$col4name=$_REQUEST['col4name'];
$col5name=$_REQUEST['col5name'];
$col6name=$_REQUEST['col6name'];
$col7name=$_REQUEST['col7name'];
$col8name=$_REQUEST['col8name'];
$col9name=$_REQUEST['col9name'];
$col10name=$_REQUEST['col10name'];




$sql="insert into reportmast(trnstype,col3,col4,col5,col6,col7,col8,col9,col10,brcode,col3name,col4name,col5name,col6name,col7name,col8name,col9name,ccol10name) values('$jtype','$jtype1','$jtype2','$jtype3','$jtype4','$jtype5','$jtype6','$jtype7','$jtype8','$brcode','$col3name','$col4name','$col5name','$col6name','$col7name','$col8name','$col9name','$col10name')";

mysqli_query($db,$sql) or die(mysqli_error($db));


	
 print "<script> alert('Data hasbeen Saved'); document.location='reportmaster.php' ; </script>";

} // end save
?>

<? include('includes/top.php'); ?>

<link rel="stylesheet" href="cal/jquery-ui.css" />
    <script src="cal/jquery-1.9.1.js"></script>
    <script src="cal/jquery-ui1.js"></script>
    <link rel="stylesheet" href="/resources/demos/style.css" />

  
   







 
<body bgcolor='lavender'>





<form name='f1' id='f1' action='<?print $PHP_SELF?>' method='POST' onSubmit="return valid()">


<br>
<CENTER>

<table border=1 cellspacing=1 cellpadding=1 class=report>
<tr bgColor='c1d7bb'><td colspan=7 align=center bgcolor='8A8D89'>
</TD></TR>
<tr><td bgcolor="8A8D89" align='left'><font color='ivory'><b>Account Head</b></td><td bgcolor="8A8D89" align='left'><font color='ivory'><b>Transaction</b></td><td bgcolor="8A8D89" align='left'><font color='ivory'><b>Column Name</b></td></tr>

<?
$qry=mysqli_query($db,"select * from  transactmast order by trnstyp ASC");

?>
<tr>
<td>Report For</td>
<td><select name='jtype' onChange=getdata(this.value)>
<option value='select'>-select-</option>
<?
while($row=mysqli_fetch_array($qry))
{
?>
<option value='<? echo $row[trnsid] ?>'><? echo $row[trnstyp] ?></option>
<?
}
?>
</select>
</td>
<td></td>
</tr>

<div id="tabtd"></div>


<tr><td colspan=6 align=center bgcolor='8A8D89'>
<input type=submit value='SAVE' name='sprint'>
<input type=reset value='CANCEL'></td></tr>
</table>
</form>
</td></tr>
</table>
</center>
<script type="text/javascript">
function getdata(str1)
{
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {

  document.getElementById("tabtd").innerHTML=xmlhttp.responseText;
 
	
    }
  }
var strurl="getdesc.php?prod="+str1;

xmlhttp.open("GET",strurl,true);
xmlhttp.send();
}
</script>