Viewing file: FrmEdit.php (6.04 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php /* session_start(); if (session_is_registered("valid_user")&&session_is_registered("password")) { $Username = $valid_user;*/ include("../../../include/FunctionDB.php"); include("../../../include/Function.php"); ConnectDB(); $sql ="SELECT * FROM student_tb WHERE Student_id='$Student_id'"; $result = mysql_query($sql) or die("Cannot Select").mysql_error(); $rs = mysql_fetch_array($result); $sql1 = "Select * From grade_tb Where code='$code'"; $result1 = mysql_query($sql1) or did("Error".mysql_error()); $row = mysql_fetch_array($result1);
?>
<html> <head> <title>Edit Gpa</title> <meta http-equiv="Content-Type" content="text/html; charset=windows-874"> <link rel="stylesheet" href="../../../teacher/css/cart4.css" type="text/css"> <script type="text/javascript"> function handleEnter (field, event) { var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; if (keyCode == 13) { var i; for (i = 0; i < field.form.elements.length; i++) if (field == field.form.elements[i]) break; i = (i + 1) % field.form.elements.length; field.form.elements[i].focus(); return false; } else return true; }
</script> <script language="JavaScript1.2"> var highlightcolor="lightyellow" var ns6=document.getElementById&&!document.all var previous='' var eventobj //Regular expression to highlight only form elements var intended=/INPUT|TEXTAREA|SELECT|OPTION/
//Function to check whether element clicked is form element function checkel(which){ if (which.style&&intended.test(which.tagName)){ if (ns6&&eventobj.nodeType==3) eventobj=eventobj.parentNode.parentNode return true } else return false }
//Function to highlight form element function highlight(e){ eventobj=ns6? e.target : event.srcElement if (previous!=''){ if (checkel(previous)) previous.style.backgroundColor='' previous=eventobj if (checkel(eventobj)) eventobj.style.backgroundColor=highlightcolor } else{ if (checkel(eventobj)) eventobj.style.backgroundColor=highlightcolor previous=eventobj } }
</script> </head>
<body bgcolor="#FFFFFF"> <form name="form1" method="POST" action="EditGrade.php" onKeyUp="highlight(event)" onClick="highlight(event)"> <table width="95%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#EEEEEE" style="border:1px solid gray"size="12"> <tr bgcolor="#9BDDDD"> <td height="25" colspan="3"> <div align="center"><font color="#FFFFFF" size="4" face="Tahoma"><strong><font color="#FF0000">แก้ไข</font> <font color="#000000">ผลการเรียนนักศึกษา</font></strong></font></div></td> </tr> <tr> <td width="30%" height="26" bgcolor="#EEEEEE"> <div align="center"><font size="2" face="Tahoma">ชื่อนักศึกษา</font></div></td> <td width="3%" bgcolor="#EEEEEE"> </td> <td width="67%" bgcolor="#EEEEEE"><font color="#003366" size="2" face="Tahoma"><strong><? echo $rs[First_name] ;?> <? echo $rs[Name] ;?> <? echo $rs[Lastname] ;?> </strong></font></td> </tr> <tr> <td bgcolor="#EEEEEE"> <div align="center"><font size="2" face="Tahoma">ชั้นปี</font></div></td> <td bgcolor="#EEEEEE"><div align="center"><font color="#FF0000" size="4" face="Tahoma"><strong>*</strong></font></div></td> <td bgcolor="#EEEEEE"><font size="2" face="Tahoma"> <input type="radio" name="Class" <?php if (!(strcmp("$row[Class]",1))) {echo "checked";} ?> value="1"> 1 <input type="radio" name="Class" <?php if (!(strcmp("$row[Class]",2))) {echo "checked";} ?> value="2"> 2 <input type="radio" name="Class" <?php if (!(strcmp("$row[Class]",3))) {echo "checked";} ?> value="3"> 3 <input type="radio" name="Class" <?php if (!(strcmp("$row[Class]",4))) {echo "checked";} ?> value="4"> 4 </font></td> </tr> <tr> <td height="26" bgcolor="#EEEEEE"> <div align="center"><font size="2" face="Tahoma">ภาคเรียน</font></div></td> <td bgcolor="#EEEEEE"><div align="center"><font color="#FF0000" size="4" face="Tahoma"><strong>*</strong></font></div></td> <td bgcolor="#EEEEEE"> <font size="2" face="Tahoma"> <input type="radio" name="Term" <?php if (!(strcmp("$row[Term]",1))) {echo "checked";} ?> value="1"> เทอม1 <input type="radio" name="Term" <?php if (!(strcmp("$row[Term]",2))) {echo "checked";} ?> value="2"> เทอม2 <input type="radio" name="Term" <?php if (!(strcmp("$row[Term]",3))) {echo "checked";} ?> value="3"> เทอม3</font></td> </tr> <tr> <td bgcolor="#EEEEEE"> <div align="center"><font size="2" face="Tahoma">จำนวนหน่วยกิตทฤษฏี</font></div></td> <td bgcolor="#EEEEEE"> </td> <td bgcolor="#EEEEEE"> <font size="2" face="Tahoma"> <input name="Tb" type="text" class="input" id="Tb" value="<? echo $row[Tb]?>" size="30"> </font></td> </tr> <tr> <td bgcolor="#EEEEEE"> <div align="center"><font size="2" face="Tahoma">จำนวนหน่วยกิตปฏิบัติและทดลอง</font></div></td> <td bgcolor="#EEEEEE"> </td> <td bgcolor="#EEEEEE"><font size="2" face="Tahoma"> <input name="Tp" type="text" class="input" id="Tp" value="<? echo $row[Tp]?>" size="30"> </font></td> </tr> <tr> <td height="23" bgcolor="#EEEEEE"> <div align="center"><font size="2" face="Tahoma">G.P.A</font></div></td> <td bgcolor="#EEEEEE"> </td> <td bgcolor="#EEEEEE"><font size="2" face="Tahoma"> <input name="Gpa" type="text" class="input" id="Gpa" value="<? echo $row[Gpa]?>" size="30"> </font> </td> </tr> <tr bgcolor="#9BDDDD" > <td height="25" colspan="3"> <div align="center"> <input name="code" type="hidden" id="code" value="<? echo $row[code]?>"> <input name="Student_id" type="hidden" id="Student_id" value="<? echo $rs[Student_id]?>"> <input type="submit" name="Submit" value=" บันทึก " class="button"> </div></td> </tr> </table> </form> </body> </html> <?php /* } else { echo"<meta http-equiv=\"refresh\" content=\"3;URL=../../login.php\">\n"; echo"Please Login "; }*/ ?>
|