hello friends.. am trying to display some data from the database into a table. in that table there is one button when i click that button should display another table below that table. here the first table ill come. the second table is not coming. i tried one whole day day to remove this but unfortunately i cant solve... if anyone know this please help me...
code is here...
<?php
$orgID=$_GET['orgName'];
$schoolID=$_GET['schoolName'];
$classID=$_GET['className'];
$repSub=$_GET['repSub'];
$cancel=$_GET['cancel'];
$detailsinfo=$_GET['detailsinfo'];
function getMoreClassDetails($classbuttonid)
{
$ResultAllDetails=QrySelect("Select cls_id , cls_desc From sm_classdetails WHERE cls_id='$classbuttonid'");
$arrDetails=array();
while($details=mysql_fetch_row($ResultAllDetails))
{
$arrDetails[]=$details;
}
mysql_free_result($ResultAllDetails);
return $arrDetails;
}
?>
<?php
if(isset($repSub))
{
$resOrgname=QrySelect("SELECT org_name from sm_organization_master where org_id='$orgID'");
$orgname=mysql_fetch_row($resOrgname);
$resSchname=QrySelect("SELECT sch_name from sm_schools_master where org_id='$orgID'");
$schname=mysql_fetch_row($resSchname);
$resClsname=QrySelect("SELECT cls_desc from sm_classdetails where sch_id='$schoolID'");
$clsname=mysql_fetch_row($resClsname);
$details=getClassDetails($classID);
if(count($details)!=0)
{
?> <label class="boxtitle"><?php addHeading1($orgname[0]); ?></label>
<?php opentable(); ?>
<form action="" method="get" name="form2" id="form2">
<table width="77%" border="0" align="center" class="myTable">
<div align="left"><label class="boxtitle">Organization Name: <?php echo $orgname[0]; ?></label>
<label class="boxtitle"> School Name: <?php echo $schname[0]; ?></label></div>
<tr>
<th align="center">Class Id</th>
<th align="center">Class Name</th>
<th align="center">Details</th>
</tr>
<?php
foreach($details as $vals)
{
?>
<tr>
<td align="center"><?php echo $vals[0]; ?></td>
<td align="center"><?php echo $vals[1]; ?></td>
<td align="center"><input name="detailsinfo" type="submit" id="detailsinfo" value="." onclick="<?php sending($vals[0]);?>"/></td>
<?php
}//foreach ends here.
?>
</tr>
</table></form> <?php closetable();
}//inner if ends here.
else
{
ErrorDisplay("No Class Detail is Found ",getCurrentScriptName());
}
}//inner if ends here.
?> </td>
</tr>
<?php
function sending($id)
{
$classbuttonid = $id;
}
?>
</table>
<?php
if(isset($detailsinfo)
$display=getMoreClassDetails($classbuttonid);
$resClsname=QrySelect("SELECT cls_desc from sm_classdetails where cls_id='$classID'");
$clsname=mysql_fetch_row($resClsname);
title();?>
<LABEL class=commontitle>School Details Search Info</LABEL>
<?php closetitle();?>
<?php opentable2();
?>
<form action="" method="get" name="form3" id="form3">
<table width="60%" border="0" align="center" class="myTable">
<label class="boxtitle" style="position:static "> Class Name: <?php echo $clsname[0]; ?></label>
<TR>
<td width="50%"><div align="left">Class Id </div></td>
<?php
foreach($details as $vals)
{
?>
<td><div align="left"><?php echo $vals[0]; ?></div></td></tr>
</tr>
<tr>
<td width="50%"><div align="left">Class Name </div></td>
<td><div align="left"><?php echo $vals[1]; ?></div></td>
<?php } ?>
</tr>
</table></form> <?php closetable();
}
?>