$examcount=mysql_num_rows($resultexam);
		$exammean=0;
		while($rowexam=mysql_fetch_array($resultexam))
		{
			$examid=$rowexam['ExamId'];			
			$subjectids=$rowexam['SubjectIDs'];
			$subjectidarr=explode(',',$subjectids);
			$subjectmean=0;
			$subjectcount=count($subjectidarr);
			for($i=0;$i<count($subjectidarr);$i++)
			{
				$subjectid=$subjectidarr[$i];
				if(!in_array($subjectid,$addedsubjectarr))
				{
					$addedsubjectarr[]=$subjectid;
					$subjectname=getsubjectname($subjectid);
					$option.="<option value='$subjectid'>$subjectname</option>";
				}
				
			}
		}
	?>
	<div id='portionheading'>
	<input type='hidden' name='sortoption' id='sortoption' value='<? echo $sortoption;?>' />
	Select Subject:
	<select name='subjectid' id='subjectid'   onchange='getallstudentoverallsubjectmark()'>
		<? echo "$option";?>
	</select>
	</div>
	<div class="span5 areaselect">
		Student Name
	</th>
	<?
		for($i=0;$i<count($subjectidarr);$i++)
		{
			$subjectid=$subjectidarr[$i];
				$sqlmax="select * from subjectexams where SchoolId='$schoolid' and ClassId='$classid' and ExamId='$examid' and SubjectId='$subjectid'";
				$resultmax=mysql_query($sqlmax) or die("error: ". mysql_error());
				while($rowmax=mysql_fetch_array($resultmax))
				{
					$maxmark=$rowmax['MaximumMark'];
					$maxmarkarr[$i]=$maxmark;
					$totalmaxmark+=$maxmark;
				}
			echo "<th>";
				echo getsubjectname($subjectid)."<br/>(/$maxmark)";
			echo "</th>";
			
		}
	?>
	<?
	if($gradesystem!=1)
	{
	?>
	<th>
		<? echo "Total<br/>(/$totalmaxmark)"; ?>
	</th>
	<th>
		<? echo "Section Rank<br/>(/$studentcount)"; ?>
	</th>
	<th>
示例#3
0
		$distinctsubjectidarr=array();
		$colorcount=0;
		?>
		Select Subject:<select name='subjectid' id='subjectid' onchange='getexamanalysis()'>
		<option value='0'>All Subjects</option>
		<?
		
		$sqlexam="select * from exams where SchoolId='$schoolid' and ClassId='$classid' and MarkUploaded='1'";
		$resultexam=mysql_query($sqlexam) or die("error:". mysql_error());
		$examcount=mysql_num_rows($resultexam);
		while($rowexam=mysql_fetch_array($resultexam))
		{
			$examid=$rowexam['ExamId'];			
			$examname=$rowexam['ExamName'];			
			$subjectids=$rowexam['SubjectIDs'];
			$subjectidarr=explode(',',$subjectids);
			for($i=0;$i<count($subjectidarr);$i++)
			{
				$subjectid=$subjectidarr[$i];
				if(!in_array($subjectid,$distinctsubjectidarr))
				{
				
					$entered=1;
					$distinctsubjectidarr[]=$subjectid;
					echo "<option value='$subjectid'>".getsubjectname($subjectid)."</option>";
				}
			}	
		}
		
?>		
</select>
示例#4
0
function gethomework($schoolid,$classid,$sectionid,$homeworkdate)
{
	$flag=0;
	
	
		$j=1;	
		
		$sql="select * from homeworkmessage where SchoolId='$schoolid' and ClassId='$classid' and SectionId='$sectionid' and HomeworkDate='$homeworkdate' order by DateTimeRecordInserted desc";
		$result = mysql_query($sql) or die('Query failed1: ' . mysql_error());
			while($row=mysql_fetch_array($result))
			{
							$flag=1;
				$homeworkarr=explode('#',$row['Homework']);
				$subjectidarr=explode(',',$row['SubjectIDs']);
				$homework="";
				for($j=0;$j<count($subjectidarr);$j++)
				{
					$subjectid=$subjectidarr[$j];
					if($subjectid==0)
					{
						$subjectname="EXTRA";
					}
					else
					{
						$subjectname=strtoupper(getsubjectname($subjectid));
					}
					if($homeworkarr[$j]!="")
					{
						$homework.="<tr><td>$subjectname</td><td>$homeworkarr[$j]</td></tr>";
					}
					
				}				
			}
		
		
	
	if($flag==0)
	{
	$homework="<tr><td colspan='2'>Homework has not been uploaded.</td></tr>";
	}
	$date=$homeworkdate;
	$datearr=explode('-',$date);
	$monthname=getmonth($datearr[1]);
	$day=$datearr[2];
	?>
	<table class="table table-striped">
                	<tr>
                    	<th align='left'>
						<?
						echo "$day $monthname";
						?>
						</th>
						<th>
                        </th>
                    </tr>
					<?
					echo $homework;
					?>
                </table>
	<?
}