| 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/data/ |
Upload File : |
<?
require_once "../config/confiteacher.inc.php";
$teach1=$objResult["teachcode"];
$crsql="SELECT ( kabto ) FROM `registeacher`
WHERE codeteach='$_GET[id]' and registeach='$teach1' and kabto!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$kabto=$dcrd[0];
?>
<?
require_once "../head.php";
?>
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=tis-620">
<title>ฝ่ายบริหารงานวิชาการ</title>
</head>
<body>
<?
require_once "../config/connectdb.php";
$year=date(" Y ")+542;
//*** Update Condition ***//
if($_GET["Action"] == "Save")
{
for($i=1;$i<=$_POST["hdnLine"];$i++)
{
$strSQL = "UPDATE transcripts SET ";
$strSQL .="time80 = '".$_POST["txttotal1$i"]."' ";
$strSQL .=",timegrade = '".$_POST["txttotal2$i"]."' ";
$strSQL .="WHERE id = '".$_POST["hdnid$i"]."' ";
$objQuery = mysql_query($strSQL);
}
echo "รอสักครู .";
echo "<script>window.alert(\"บันทึกข้อมูลเรียบแล้วครับ\");history.go (-2);</script>";
//header("location:$_SERVER[PHP_SELF]");
//exit();
}
$sql2="SELECT years FROM config";
$result2 = mysql_query($sql2);
while (list($years) = mysql_fetch_row($result2)) {
$xsc_years = $years;
$strSQL = "SELECT id,IDstudent,code,teach,xyy,xterm,Username,Name,surname,room,ordinal,timec1,timec2,timec3,timec4,timec5,timec6,timec7,timec8,timec9,timec10,timec11,timec12,timec13,timec14,timec15,timec16,timec17,timec18,timec19,timec20,timec21,timec22,timec23,timec24,timec25,time80,timegrade FROM transcripts JOIN klw ON klw.Username=transcripts.IDstudent WHERE code = '$_GET[id]' and xyy = '$_GET[xy]' and xterm = '$_GET[tx]' and teach='$teach1' and room='$_GET[rom]' order by room+1 asc,ordinal+1 asc";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$i = 1;
}
?>
<table width="773" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="198"><a href="regis.php"><font color="#FF0000" size="2">หน้าหลัก</font></a>
</td>
<td width="575"><table width="100%" border="0" cellspacing="1" cellpadding="1">
</table></td>
</tr>
</table>
<form name="frmMain" method="post" action="sumtime.php?Action=Save">
<table width="100%" border="0" bgcolor="#999999">
<center><font size='3' color='red'></font></center>
<tr bgcolor="#FFFFFF">
<th width="10"> <div align="center"></div></th>
<th width="10"> <div align="center">#</div></th>
<th width="10"> <div align="center">ID Student</div></th>
<th width="10"> <div align="center">code</div></th>
<th width="100"> <div align="center">Name</div></th>
<th width="100"> <div align="center">มา</div></th>
<th width="100"> <div align="center">ไม่มา</div></th>
<th width="10"> <div align="center">ประะมวลผล <br><? echo $kabto; ?>.คาบ</div></th>
<th width="10"> <div align="center">ผล <br><? echo $kabto; ?>.คาบ</div></th>
</tr>
<?
$i =0;
while($objResult = mysql_fetch_array($objQuery))
{
if($bg == "#EEEEEE") { //ส่วนของการ สลับสี
$bg = "#FFFFFF";
} else {
$bg = "#EEEEEE";
}
$i = $i + 1;
$unit1=$scor1+$scor2+$scor3;
$room =$objResult['room'];
$ordinal =$objResult['ordinal'];
$teach =$objResult['teach'];
$codin =$objResult['code'];
$timech1 =$objResult['time80'];
$Username =$objResult['Username'];
$che1="1";
$che2="s";
$che3="0";
$timec1 =$objResult['timec1'];
$timec2 =$objResult['timec2'];
$timec3 =$objResult['timec3'];
$timec4 =$objResult['timec4'];
$timec5 =$objResult['timec5'];
$timec6 =$objResult['timec6'];
$timec7 =$objResult['timec7'];
$timec8 =$objResult['timec8'];
$timec9 =$objResult['timec9'];
$timec10 =$objResult['timec10'];
$timec11 =$objResult['timec11'];
$timec12 =$objResult['timec12'];
$timec13 =$objResult['timec13'];
$timec14 =$objResult['timec14'];
$timec15 =$objResult['timec15'];
$timec16 =$objResult['timec16'];
$timec17 =$objResult['timec17'];
$timec18 =$objResult['timec18'];
$timec19 =$objResult['timec19'];
$timec20 =$objResult['timec20'];
$timec21 =$objResult['timec21'];
$timec22 =$objResult['timec22'];
$timec23 =$objResult['timec23'];
$timec24 =$objResult['timec24'];
$timec25 =$objResult['timec25'];
$crsql="SELECT count( timec1 ) FROM `transcripts`
WHERE IDstudent = '$Username' and code='$_GET[id]' and teach='$teach1' and timec1 !='1' and timec1!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$ncome1=$dcrd[0];
$crsql="SELECT count( timec2 ) FROM `transcripts`
WHERE IDstudent = '$Username' and code='$_GET[id]' and teach='$teach1' and timec2 !='1' and timec2!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$ncome2=$dcrd[0];
$crsql="SELECT count( timec3 ) FROM `transcripts`
WHERE IDstudent = '$Username' and code='$_GET[id]' and teach='$teach1' and timec3 !='1' and timec3!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$ncome3=$dcrd[0];
$crsql="SELECT count( timec4 ) FROM `transcripts`
WHERE IDstudent = '$Username' and code='$_GET[id]' and teach='$teach1' and timec4 !='1' and timec4!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$ncome4=$dcrd[0];
$crsql="SELECT count( timec5 ) FROM `transcripts`
WHERE IDstudent = '$Username' and code='$_GET[id]' and teach='$teach1' and timec5 !='1' and timec5!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$ncome5=$dcrd[0];
$crsql="SELECT count( timec6 ) FROM `transcripts`
WHERE IDstudent = '$Username' and code='$_GET[id]' and teach='$teach1' and timec6 !='1' and timec6!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$ncome6=$dcrd[0];
$crsql="SELECT count( timec7 ) FROM `transcripts`
WHERE IDstudent = '$Username' and code='$_GET[id]' and teach='$teach1' and timec7 !='1' and timec7!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$ncome7=$dcrd[0];
$crsql="SELECT count( timec8 ) FROM `transcripts`
WHERE IDstudent = '$Username' and code='$_GET[id]' and teach='$teach1' and timec8 !='1' and timec8!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$ncome8=$dcrd[0];
$crsql="SELECT count( timec9 ) FROM `transcripts`
WHERE IDstudent = '$Username' and code='$_GET[id]' and teach='$teach1' and timec9 !='1' and timec9!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$ncome9=$dcrd[0];
$crsql="SELECT count( timec10 ) FROM `transcripts`
WHERE IDstudent = '$Username' and code='$_GET[id]' and teach='$teach1' and timec10 !='1' and timec10!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$ncome10=$dcrd[0];
$crsql="SELECT count( timec11 ) FROM `transcripts`
WHERE IDstudent = '$Username' and code='$_GET[id]' and teach='$teach1' and timec11 !='1' and timec11!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$ncome11=$dcrd[0];
$crsql="SELECT count( timec12 ) FROM `transcripts`
WHERE IDstudent = '$Username' and code='$_GET[id]' and teach='$teach1' and timec12 !='1' and timec12!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$ncome12=$dcrd[0];
$crsql="SELECT count( timec13 ) FROM `transcripts`
WHERE IDstudent = '$Username' and code='$_GET[id]' and teach='$teach1' and timec13 !='1' and timec13!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$ncome13=$dcrd[0];
$crsql="SELECT count( timec14 ) FROM `transcripts`
WHERE IDstudent = '$Username' and code='$_GET[id]' and teach='$teach1' and timec14 !='1' and timec14!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$ncome14=$dcrd[0];
$crsql="SELECT count( timec15 ) FROM `transcripts`
WHERE IDstudent = '$Username' and code='$_GET[id]' and teach='$teach1' and timec15 !='1' and timec15!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$ncome15=$dcrd[0];
$crsql="SELECT count( timec16 ) FROM `transcripts`
WHERE IDstudent = '$Username' and code='$_GET[id]' and teach='$teach1' and timec16 !='1' and timec16!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$ncome11=$dcrd[0];
$crsql="SELECT count( timec17 ) FROM `transcripts`
WHERE IDstudent = '$Username' and code='$_GET[id]' and teach='$teach1' and timec17 !='1' and timec17!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$ncome17=$dcrd[0];
$crsql="SELECT count( timec18 ) FROM `transcripts`
WHERE IDstudent = '$Username' and code='$_GET[id]' and teach='$teach1' and timec18 !='1' and timec18!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$ncome18=$dcrd[0];
$crsql="SELECT count( timec19 ) FROM `transcripts`
WHERE IDstudent = '$Username' and code='$_GET[id]' and teach='$teach1' and timec19 !='1' and timec19!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$ncome19=$dcrd[0];
$crsql="SELECT count( timec20 ) FROM `transcripts`
WHERE IDstudent = '$Username' and code='$_GET[id]' and teach='$teach1' and timec20 !='1' and timec20!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$ncome20=$dcrd[0];
$crsql="SELECT count( timec21 ) FROM `transcripts`
WHERE IDstudent = '$Username' and code='$_GET[id]' and teach='$teach1' and timec21 !='1' and timec21!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$ncome21=$dcrd[0];
$crsql="SELECT count( timec22 ) FROM `transcripts`
WHERE IDstudent = '$Username' and code='$_GET[id]' and teach='$teach1' and timec22 !='1' and timec22!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$ncome22=$dcrd[0];
$crsql="SELECT count( timec23 ) FROM `transcripts`
WHERE IDstudent = '$Username' and code='$_GET[id]' and teach='$teach1' and timec23 !='1' and timec23!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$ncome23=$dcrd[0];
$crsql="SELECT count( timec24 ) FROM `transcripts`
WHERE IDstudent = '$Username' and code='$_GET[id]' and teach='$teach1' and timec24 !='1' and timec24!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$ncome24=$dcrd[0];
$crsql="SELECT count( timec25 ) FROM `transcripts`
WHERE IDstudent = '$Username' and code='$_GET[id]' and teach='$teach1' and timec25 !='1' and timec25!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$ncome25=$dcrd[0];
$come=$timec1+$timec2+$timec3+$timec4+$timec5+$timec6+$timec7+$timec8+$timec9+$timec10+$timec11+$timec12+$timec13+$timec14+$timec15+$timec16+$timec17+$timec18+$timec19+$timec20+$timec21+$timec22+$timec23+$timec24+$timec25;
$ncomeall=$ncome1+$ncome2+$ncome3+$ncome4+$ncome5+$ncome6+$ncome7+$ncome8+$ncome9+$ncome10+$ncome11+$ncome12+$ncome13+$ncome14+$ncome15+$ncome16+$ncome17+$ncome18+$ncome19+$ncome20+$ncome21+$ncome22+$ncome23+$ncome24+$ncome25;
@$percen=($come/@$kabto)*100
?>
<tr bgcolor="<?=$bg?>">
<td><div align="center">
<input type="hidden" name="hdnid<?=$i;?>" size="5" value="<?=$objResult["id"];?>">
<td><?=$i?></td>
<td><div align="right"><?=$objResult["Username"];?>
</div></td>
<td><div align="right"><?=$objResult["code"];?>
</div></td>
<td><div align="right"><?=$objResult["Name"];?> <?=$objResult["surname"];?> <? echo "$room"; ?></div></td>
<td><div align="right"><? echo $come; ?></div></td>
<td><div align="right"><? echo $ncomeall; ?></div></td>
<td>
<input type="text" name="txttotal1<?=$i;?>" size="3" maxlength="3" value="<? echo number_format($percen,0, '', ''); ?>" readonly='readonly'>
</td>
<td>
<input type="text" name="txttotal2<?=$i;?>" size="3" maxlength="3" value="
<? if($percen < 80)
{
echo "มผ";
}
else if($percen >= 80)
{
echo "";
}
?>" readonly='readonly' >
</td>
</tr>
<?
$i = $i;
}
?>
</table>
<input type="submit" name="submit" value="SAVE">
<input type="hidden" name="hdnLine" value="<?=$i;?>">
</form>
<?
?>
</body>
</html>