| Server IP : 61.19.30.66 / Your IP : 216.73.216.59 Web Server : Apache/2.2.22 (Ubuntu) System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 User : www-data ( 33) PHP Version : 5.3.10-1ubuntu3.48 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /var/www/gpa/ |
Upload File : |
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
<title>gpa</title>
</head>
<body>
<?
require_once "head.php";
require_once "config/connectdb.php";
$strSQL = "SELECT * FROM transcripts JOIN klw ON transcripts.IDstudent=klw.Username where code = '$_GET[id]' and teach='$_GET[teach]' and xyy='$_GET[xyy]' group by room order by room+1 asc";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
?>
<br>
<br>
<?
$sql2="SELECT namesc,tumbolsc,amps,dissc,years FROM config";
mysql_query("SET character_set_results=tis620");//ตั้งค่าการดึงข้อมูลออกมาให้เป็น tis620
mysql_query("SET character_set_client=tis620");//ตั้งค่าการส่งข้อมุลลงฐานข้อมูลออกมาให้ เป็น tis620
mysql_query("SET character_set_connection=tis620");//ตั้งค่าการติดต่อฐานข้อมูลให้เป็น ti
$result2 = mysql_query($sql2);
while (list($namesc,$tumbolsc,$amps,$dissc,$years) = mysql_fetch_row($result2)) {
$xsc_Name = $namesc;
$xsc_tumbolsc = $tumbolsc;
$xsc_disc = $dissc;
$xsc_amps = $amps;
$xsc_years = $years;
}
?>
<br>
<center><font size="5">ผลการเรียนรายวิชาโรงเรียน <? echo $xsc_Name; ?> </font> </center>
<br>
<tr>
</tr>
<table width="100%" border="0" bgcolor="000000">
<tr bgcolor="FFFFFF">
<th width="5%"> <div align="left">ที่</div></th>
<th width="5%"> <div align="left">ห้อง</div></th>
<th width="10%"> <div align="center">รหัสวิชา</div></th>
<th width="20%"> <div align="center">รายวิชา</div></th>
<th width="10%"> <div align="center">ปี</div></th>
<th width="2%"> <div align="center"></div></th>
<th width="2%"> <div align="center"></div></th>
<th width="2%"> <div align="center"></div></th>
<th width="2%"> <div align="center"></div></th>
<th width="40%"> <div align="center">หมายเหตุุ</div></th>
</tr>
<?
$i =0;
while($objResult = mysql_fetch_array($objQuery))
{
$i = $i + 1;
$room =$objResult["room"];
?>
<tr bgcolor="FFFFFF">
<td><? echo "$i"; ?></td>
<td><div align="left">
<a href="gradestudent.php?id=<?=$objResult["code"];?>&&teach=<?=$objResult["teach"];?>&&xyy=<?=$objResult["xyy"];?>&&room=<?=$objResult["room"];?>
" style="text-decoration: none;">
<input type="hidden" name="hdnIDstudent<?=$i;?>" size="2" value="<?=$objResult["code"];?>">
<?=$objResult["room"];?>
</div></a></td>
<td><?=$objResult["code"];?></td>
<td> <?=$objResult["Titles"];?></td>
<td> <?=$objResult["xyy"];?>/<?=$objResult["xterm"];?></td>
<td></td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
<td align="right"><?=$objResult["teach"];?></td>
</tr>
<?
}
?>
</table>
<br>
<br>
<?
//////////////
$crsql="SELECT count( grad ) FROM `transcripts` JOIN mainsubject ON
mainsubject.Codesub=transcripts.code WHERE grad LIKE '%0%' and code = '$_GET[id]' and teach='$_GET[teach]' and xyy='$_GET[xyy]'";
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$slipnum_0=$dcrd[0];
$crsql="SELECT count( grad ) FROM `transcripts` JOIN mainsubject ON
mainsubject.Codesub=transcripts.code WHERE grad =1 and code = '$_GET[id]' and teach='$_GET[teach]' and xyy='$_GET[xyy]'";
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$slipnum_1=$dcrd[0];
$crsql="SELECT count( grad ) FROM `transcripts` JOIN mainsubject ON
mainsubject.Codesub=transcripts.code WHERE grad =1.5 and code = '$_GET[id]' and teach='$_GET[teach]' and xyy='$_GET[xyy]'";
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$slipnum_15=$dcrd[0];
$crsql="SELECT count( grad ) FROM `transcripts` JOIN mainsubject ON
mainsubject.Codesub=transcripts.code WHERE grad =2 and code = '$_GET[id]' and teach='$_GET[teach]' and xyy='$_GET[xyy]'";
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$slipnum_2=$dcrd[0];
$crsql="SELECT count( grad ) FROM `transcripts` JOIN mainsubject ON
mainsubject.Codesub=transcripts.code WHERE grad =2.5 and code = '$_GET[id]' and teach='$_GET[teach]' and xyy='$_GET[xyy]'";
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$slipnum_25=$dcrd[0];
$crsql="SELECT count( grad ) FROM `transcripts` JOIN mainsubject ON
mainsubject.Codesub=transcripts.code WHERE grad =3 and code = '$_GET[id]' and teach='$_GET[teach]' and xyy='$_GET[xyy]'";
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$slipnum_3=$dcrd[0];
$crsql="SELECT count( grad ) FROM `transcripts` JOIN mainsubject ON
mainsubject.Codesub=transcripts.code WHERE grad =3.5 and code = '$_GET[id]' and teach='$_GET[teach]' and xyy='$_GET[xyy]'";
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$slipnum_35=$dcrd[0];
$crsql="SELECT count( grad ) FROM `transcripts` JOIN mainsubject ON
mainsubject.Codesub=transcripts.code WHERE grad =4 and code = '$_GET[id]' and teach='$_GET[teach]' and xyy='$_GET[xyy]'";
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$slipnum_4=$dcrd[0];
$crsql="SELECT count( grad ) FROM `transcripts` JOIN mainsubject ON
mainsubject.Codesub=transcripts.code WHERE total LIKE '%-1%' and code = '$_GET[id]' and teach='$_GET[teach]' and xyy='$_GET[xyy]'";
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$slipnum_i=$dcrd[0];
$crsql="SELECT count( IDstudent ) FROM `transcripts` JOIN mainsubject ON
mainsubject.Codesub=transcripts.code WHERE code = '$_GET[id]' and teach='$_GET[teach]' and xyy='$_GET[xyy]'";
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$slipnum_total=$dcrd[0];
$slipnum_total1=$slipnum_0+$slipnum_1+$slipnum_15+$slipnum_2+$slipnum_25+$slipnum_3+$slipnum_35+$slipnum_4+$slipnum_i;
///////MAX
$crsql="SELECT max( total ) FROM `transcripts` JOIN mainsubject ON
mainsubject.Codesub=transcripts.code WHERE code = '$_GET[id]' and teach='$_GET[teach]' and xyy='$_GET[xyy]'";
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$slipnum_MAX=$dcrd[0];
///////MIN
$crsql="SELECT min( total ) FROM `transcripts` JOIN mainsubject ON
mainsubject.Codesub=transcripts.code WHERE code = '$_GET[id]' and teach='$_GET[teach]' and xyy='$_GET[xyy]'";
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$slipnum_MIN=$dcrd[0];
//////////รihvp]t//รih
$slipnum_p0=($slipnum_0/$slipnum_total)*100;
$slipnum_p1=($slipnum_1/$slipnum_total)*100;
$slipnum_p15=($slipnum_15/$slipnum_total)*100;
$slipnum_p2=($slipnum_2/$slipnum_total)*100;
$slipnum_p25=($slipnum_25/$slipnum_total)*100;
$slipnum_p3=($slipnum_3/$slipnum_total)*100;
$slipnum_p35=($slipnum_35/$slipnum_total)*100;
$slipnum_p4=($slipnum_4/$slipnum_total)*100;
$slipnum_pi=($slipnum_i/$slipnum_total)*100;
$slipnum_ptotal=($slipnum_total/$slipnum_total)*100;
$slipnum_gpa=($slipnum_1*1+$slipnum_15*1.5+$slipnum_2*2+$slipnum_25*2.5+$slipnum_3*3+$slipnum_35*3.5+$slipnum_4*4)/$slipnum_total;
?>
<table width="100%" border="0" bgcolor="#BDBDBD">
<tr bgcolor="FFFFFF">
<th width="10%"> <div align="left">ผลการเรียน</div></th>
<th width="10%"> <div align="left">0</div></th>
<th width="10%"> <div align="center">1</div></th>
<th width="10%"> <div align="center">1.5</div></th>
<th width="10%"> <div align="center">2</div></th>
<th width="10%"> <div align="center">2.5</div></th>
<th width="10%"> <div align="center">3</div></th>
<th width="10%"> <div align="center">3.5</div></th>
<th width="10%"> <div align="center">4</div></th>
<th width="10%"> <div align="center">ร</div></th>
<th width="10%"> <div align="center">รวม</div></th>
</tr>
<tr bgcolor="FFFFFF">
<th width="10%"> <div align="left">จำนวนนักเรียน</div></th>
<th width="10%"> <div align="left"><? echo number_format($slipnum_0); ?></div></th>
<th width="10%"> <div align="left"><? echo number_format($slipnum_1); ?></div></th>
<th width="10%"> <div align="left"><? echo number_format($slipnum_15); ?></div></th>
<th width="10%"> <div align="left"><? echo number_format($slipnum_2); ?></div></th>
<th width="10%"> <div align="left"><? echo number_format($slipnum_25); ?></div></th>
<th width="10%"> <div align="left"><? echo number_format($slipnum_3); ?></div></th>
<th width="10%"> <div align="left"><? echo number_format($slipnum_35); ?></div></th>
<th width="10%"> <div align="left"><? echo number_format($slipnum_4); ?></div></th>
<th width="10%"> <div align="left"><? echo number_format($slipnum_i); ?></div></th>
<th width="10%"> <div align="left"><? echo number_format($slipnum_total); ?></div></th>
</tr>
<tr bgcolor="FFFFFF">
<th width="10%"> <div align="left">ร้อยละ</div></th>
<th width="10%"> <div align="left"><? echo number_format($slipnum_p0,2); ?></div></th>
<th width="10%"> <div align="left"><? echo number_format($slipnum_p1,2); ?></div></th>
<th width="10%"> <div align="left"><? echo number_format($slipnum_p15,2); ?></div></th>
<th width="10%"> <div align="left"><? echo number_format($slipnum_p2,2); ?></div></th>
<th width="10%"> <div align="left"><? echo number_format($slipnum_p25,2); ?></div></th>
<th width="10%"> <div align="left"><? echo number_format($slipnum_p3,2); ?></div></th>
<th width="10%"> <div align="left"><? echo number_format($slipnum_p35,2); ?></div></th>
<th width="10%"> <div align="left"><? echo number_format($slipnum_p4,2); ?></div></th>
<th width="10%"> <div align="left"><? echo number_format($slipnum_pi,2); ?></div></th>
<th width="10%"> <div align="left"><? echo number_format($slipnum_ptotal,2); ?></div></th>
</tr>
<tr bgcolor="FFFFFF">
<th width="10%"> <div align="left">gpa</div></th>
<th width="10%"> <div align="left"><? echo number_format($slipnum_gpa,2); ?></div></th>
</tr>
<tr bgcolor="FFFFFF">
<th width="10%"> <div align="left">MAX</div></th>
<th width="10%"> <div align="left"><? echo number_format($slipnum_MAX); ?></div></th>
</tr>
<tr bgcolor="FFFFFF">
<th width="10%"> <div align="left">MIN</div></th>
<th width="10%"> <div align="left"><? echo number_format($slipnum_MIN); ?></div></th>
</tr>
<tr>
<!--Load the AJAX API-->
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
// Load the Visualization API and the corechart package.
google.charts.load('current', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
google.charts.setOnLoadCallback(drawChart);
// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawChart() {
// Create the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'Topping');
data.addColumn('number', 'Slices');
data.addRows([
['grade 4',5],
['grade 3.5', 2],
['grade 3', 2],
['grade 2.5', 2],
['grade 2', 8],
['grade 1.5', 1],
['grade 1', 8],
['grade 0', 7],
['grade I', 2]
]);
// Set chart options
var options = {'title':'grade',
'width':800,
'height':800};
// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
<td> <div id="chart_div"></div></div></td>
</tr>
</table>
<input type="button" value="Print this page" onclick="window.print()">
</body>
</html>