| 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";
$teachin=$objResult["teachcode"];
$crsql="SELECT ( kabto ) FROM `registeacher`
WHERE codeteach='$_GET[id]' and registeach='$teachin' 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 transcriptintall SET ";
$strSQL .="time80 = '".$_POST["txttotal1$i"]."' ";
$strSQL .=",timegrade = '".$_POST["txttotal2$i"]."' ";
$strSQL .="WHERE idin = '".$_POST["hdnid$i"]."' ";
$objQuery = mysql_query($strSQL);
}
echo "รอสักครู Deleted.";
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 idin,idstin,codin,teachin,yearsx,idgrupin,timec1,timec2,timec3,timec4,timec5,timec6,timec7,timec8,timec9,timec10,timec11,timec12,timec13,timec14,timec15,timec16,timec17,Username,Name,surname,room,ordinal FROM transcriptintall JOIN klw ON klw.Username=transcriptintall.idstin WHERE codin = '$_GET[id]' and idgrupin = '$_GET[dayin]' and timeins = '$_GET[timeins]' and teachin='$teachin' and yearsx='$xsc_years' 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="sumtimex.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="10"> <div align="center">มา <br></div></th>
<th width="10"> <div align="center">ไม่มา <br></div></th>
<th width="10"> <div align="center">ประมวลผล<br><? echo $kabto; ?>คาบ</div></th>
<th width="10"> <div align="center">ผล <br></div></th>
</tr>
<?
$i =0;
while($objResult = mysql_fetch_array($objQuery))
{
if($bg == "#EEEEEE") { //ส่วนของการ สลับสี
$bg = "#FFFFFF";
} else {
$bg = "#EEEEEE";
}
$i = $i + 1;
$idstin =$objResult["idstin"];
$room =$objResult['room'];
$ordinal =$objResult['ordinal'];
$teach =$objResult['teachin'];
$codin =$objResult['codin'];
$time80=$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'];
$crsql="SELECT count( timec1 ) FROM `transcriptintall`
WHERE idstin = '$Username' and codin='$_GET[id]' and teachin='$teachin' and timec1 !='1' and yearsx='$_GET[year]' 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 `transcriptintall`
WHERE idstin = '$Username' and codin='$_GET[id]' and teachin='$teachin' and timec2 !='1' and yearsx='$_GET[year]' 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 `transcriptintall`
WHERE idstin = '$Username' and codin='$_GET[id]' and teachin='$teachin' and timec3 !='1' and yearsx='$_GET[year]' 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 `transcriptintall`
WHERE idstin = '$Username' and codin='$_GET[id]' and teachin='$teachin' and timec4 !='1' and yearsx='$_GET[year]' 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 `transcriptintall`
WHERE idstin = '$Username' and codin='$_GET[id]' and teachin='$teachin' and timec5 !='1' and yearsx='$_GET[year]' 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 `transcriptintall`
WHERE idstin = '$Username' and codin='$_GET[id]' and teachin='$teachin' and timec6 !='1' and yearsx='$_GET[year]' 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 `transcriptintall`
WHERE idstin = '$Username' and codin='$_GET[id]' and teachin='$teachin' and timec7 !='1' and yearsx='$_GET[year]' 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 `transcriptintall`
WHERE idstin = '$Username' and codin='$codin' and teachin='$teachin' and timec8 !='1' and yearsx='$_GET[year]' 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 `transcriptintall`
WHERE idstin = '$Username' and codin='$codin' and teachin='$teachin' and timec9 !='1' and yearsx='$_GET[year]' and timec8!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$ncome9=$dcrd[0];
$crsql="SELECT count( timec10) FROM `transcriptintall`
WHERE idstin = '$Username' and codin='$codin' and teachin='$teachin' and timec10 !='1' and yearsx='$_GET[year]' 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 `transcriptintall`
WHERE idstin = '$Username' and codin='$codin' and teachin='$teachin' and timec11 !='1' and yearsx='$_GET[year]' 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 `transcriptintall`
WHERE idstin = '$Username' and codin='$codin' and teachin='$teachin' and timec12 !='1' and yearsx='$_GET[year]' 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 `transcriptintall`
WHERE idstin = '$Username' and codin='$codin' and teachin='$teachin' and timec13 !='1' and yearsx='$_GET[year]' 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 `transcriptintall`
WHERE idstin = '$Username' and codin='$codin' and teachin='$teachin' and timec14 !='1' and yearsx='$_GET[year]' 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 `transcriptintall`
WHERE idstin = '$Username' and codin='$codin' and teachin='$teachin' and timec15 !='1' and yearsx='$_GET[year]' 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 `transcriptintall`
WHERE idstin = '$Username' and codin='$codin' and teachin='$teachin' and timec16 !='1' and yearsx='$_GET[year]' and timec16!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$ncome16=$dcrd[0];
$crsql="SELECT count( timec17 ) FROM `transcriptintall`
WHERE idstin = '$Username' and codin='$codin' and teachin='$teachin' and timec17 !='1' and yearsx='$_GET[year]' 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 `transcriptintall`
WHERE idstin = '$Username' and codin='$codin' and teachin='$teachin' and timec18 !='1' and yearsx='$_GET[year]' 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 `transcriptintall`
WHERE idstin = '$Username' and codin='$codin' and teachin='$teachin' and timec19 !='1' and yearsx='$_GET[year]' 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 `transcriptintall`
WHERE idstin = '$Username' and codin='$codin' and teachin='$teachin' and timec20 !='1' and yearsx='$_GET[year]' and timec20!=''" ;
$slr=mysql_query($crsql) or die(mysql_error()."<br>".$crsql);
$dcrd = mysql_fetch_array($slr);
$ncome20=$dcrd[0];
$come=$timec1+$timec2+$timec3+$timec4+$timec5+$timec6+$timec7+$timec8+$timec9+$timec10+$timec11+$timec12+$timec13+$timec14+$timec15+$timec16+$timec17+$timec18+$timec19+$timec20;
$ncomeall=$ncome1+$ncome2+$ncome3+$ncome4+$ncome5+$ncome6+$ncome7+$ncome8+$ncome9+$ncome10+$ncome11+$ncome12+$ncome13+$ncome14+$ncome15+$ncome16+$ncome17+$ncome18+$ncome19+$ncome20;
@$percen=($come/@$kabto)*100
?>
<tr bgcolor="<?=$bg?>">
<td><div align="center">
<input type="hidden" name="hdnid<?=$i;?>" size="5" value="<?=$objResult["idin"];?>">
<td><?=$i?></td>
<td><div align="right"><?=$objResult["idstin"];?>
</div></td>
<td><div align="right"><?=$objResult["codin"];?>
</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>