$sectionid=$row1['SectionId']; $sectionname=$row1['SectionName']; $count=0; $score=0; $sqlst="select * from sliptest where SchoolId='$schoolid' and ClassId='$classid' and SectionId='$sectionid'"; $resultst=mysql_query($sqlst) or die("error in sliptest fetching:". mysql_error()); while($rowst=mysql_fetch_array($resultst)) { $average=$rowst['AverageMark']; $markentered=$rowst['MarkEntered']; $maxmark=$rowst['MaximumMark']; if($markentered==1) { //echo "<script>alert('".ceil(($average*3)/$maxmark)."')</script>"; $score+=ceil(($average*100)/$maxmark); $count++; } } $color=""; if($count!=0) { $temp=ceil($score/$count); ?> <li class="<? echo gettdcolor2($temp);?>"><a href="javascript: void(0)" onclick='getsubjectsliptest(<? echo "$classid,$sectionid"; ?>);getsectiontabs(<? echo "$classid,$sectionid"; ?>)'><? echo $sectionname;?></a></li> <? } } ?> </ul>
{ $average=$rowst['AverageMark']; $markentered=$rowst['MarkEntered']; $maxmark=$rowst['MaximumMark']; if($markentered==1) { //echo "<script>alert('".ceil(($average*3)/$maxmark)."')</script>"; $score+=ceil(($average*100)/$maxmark); $count++; } } $color=""; if($count!=0) { $temp=ceil($score/$count); $selected="dim"; if($selectedclassid==$classid) { $selected="selected"; } ?> <li class="<? echo gettdcolor2($temp)." ".$selected;?>"><a href="javascript: void(0)" onclick='getsectionsliptest(<? echo $classid; ?>);getclasstabs(<? echo $classid?>)'><? echo $classname;?></a></li> <? } } ?> </ul>