Viewing file: AddPunish.php (5.98 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php 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("Error".mysql_error()); $rs = mysql_fetch_array($result); ?> <html> <head> <title>Add Student's Punishment</title> <meta http-equiv="Content-Type" content="text/html; charset=windows-874"> <link href="../../../css/style1.css" rel="stylesheet" type="text/css"> <script language="JavaScript"> function formCheck(formobj){ // Enter name of mandatory fields var fieldRequired = Array("mDate","mMonth","mYear","Punish_type","Perform", "Consider"); // Enter field description to appear in the dialog box var fieldDescription = Array("Date","Month","Year","Punish type","Perform", "Consider"); // dialog message var alertMsg = "Please complete the following fields:\n"; var l_Msg = alertMsg.length; for (var i = 0; i < fieldRequired.length; i++){ var obj = formobj.elements[fieldRequired[i]]; if (obj){ switch(obj.type){ case "select-one": if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){ alertMsg += " - " + fieldDescription[i] + "\n"; } break; case "select-multiple": if (obj.selectedIndex == -1){ alertMsg += " - " + fieldDescription[i] + "\n"; } break; case "text": case "textarea": if (obj.value == "" || obj.value == null){ alertMsg += " - " + fieldDescription[i] + "\n"; } break; default: } if (obj.type == undefined){ var blnchecked = false; for (var j = 0; j < obj.length; j++){ if (obj[j].checked){ blnchecked = true; } } if (!blnchecked){ alertMsg += " - " + fieldDescription[i] + "\n"; } } } }
if (alertMsg.length == l_Msg){ return true; }else{ alert(alertMsg); return false; } } // --> </script> </head>
<body bgcolor="#FFFFFF"> <font face="Tahoma, MS Sans Serif"> </font> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="329" colspan="2"> <form name="form1" method="post" action="InsertPunish.php" onSubmit="return formCheck(this);"> <table width="95%" border="0" align="center" cellpadding="0" cellspacing="1" bordercolor="#99CCFF"> <tr bgcolor="#FDDCCE"> <td height="22" colspan="3"> <div align="center"><font face="Tahoma, MS Sans Serif"><strong><font color="#000000" size="4">à¾ÔèÁ</font><font size="4"> ¢éÍÁÙžĵԡÃÃÁ áÅÐ ÇԹѠ¹Ñ¡ÈÖ¡ÉÒ</font></strong></font></div></td> </tr> <tr> <td bgcolor="#EEEEEE"><div align="center"><font size="2" face="Tahoma, MS Sans Serif">ÃËÑʹѡÈÖ¡ÉÒ</font></div></td> <td bgcolor="#EEEEEE"> </td> <td bgcolor="#EEEEEE"><font face="Tahoma, MS Sans Serif"><strong><font size="2"><? echo $rs[Student_id]?></font></strong></font></td> </tr> <tr> <td width="27%" bgcolor="#EEEEEE"><div align="center"><font size="2" face="Tahoma, MS Sans Serif">ª×èÍ-¹ÒÁÊ¡ØÅ</font></div></td> <td width="3%" bgcolor="#EEEEEE"> </td> <td width="70%" bgcolor="#EEEEEE"><font face="Tahoma, MS Sans Serif"><strong><font size="2"><? echo $rs[First_name]?> <? echo $rs[Name]?> <? echo $rs[Lastname]?></font></strong></font></td> </tr> <tr> <td bgcolor="#EEEEEE"> <div align="center"><font size="2" face="Tahoma, MS Sans Serif">Çѹ·ÕèºÑ¹·Ö¡</font></div></td> <td bgcolor="#EEEEEE"><div align="center"><font color="#FF0000" size="4" face="Tahoma, MS Sans Serif"><strong>*</strong></font></div></td> <td bgcolor="#EEEEEE"><font color="#000000" size="2" face="Tahoma, MS Sans Serif">Çѹ·Õè <select name="mDate" id="select" class="select" > <option value=""></option> <? getDay1to31();?> </select> à´×͹ <select name="mMonth" id="select2" class="select" > <option></option> <? getThaiMonth();?> </select> »Õ ¾.È. <input name="mYear" type="text" id="mYear2" size="10" class="input1" > </font></td> </tr> <tr> <td bgcolor="#EEEEEE"> <div align="center"><font size="2" face="Tahoma, MS Sans Serif">»ÃÐàÀ·¤ÇÒÁ¼Ô´</font></div></td> <td bgcolor="#EEEEEE"><div align="center"><font color="#FF0000" size="4" face="Tahoma, MS Sans Serif"><strong>*</strong></font></div></td> <td bgcolor="#EEEEEE"> <p> <font face="Tahoma, MS Sans Serif"> <input name="Punish_type" type="text" id="Punish_type" size="60"> </font></p></td> </tr> <tr bordercolor="#CCCCCC"> <td nowrap bordercolor="#CCCCCC" bgcolor="#EEEEEE"> <div align="center"><font color="#000000" size="2" face="Tahoma, MS Sans Serif">¾ÄµÔ¡ÃÃÁ·Õè·Ó¼Ô´</font></div></td> <td bordercolor="#CCCCCC" bgcolor="#EEEEEE"> </td> <td nowrap bordercolor="#CCCCCC" bgcolor="#EEEEEE"><font size="2" face="Tahoma, MS Sans Serif"> <textarea name="Perform" cols="40" rows="5" id="textarea"></textarea> </font></td> </tr> <tr> <td bgcolor="#EEEEEE"> <div align="center"><font color="#000000" size="2" face="Tahoma, MS Sans Serif">¡ÒþԨÒÃ³Ò </font></div></td> <td bgcolor="#EEEEEE"> </td> <td bgcolor="#EEEEEE"> <font face="Tahoma, MS Sans Serif"> <textarea name="Consider" cols="40" rows="5" id="textarea2"></textarea> </font></td> </tr> <tr bgcolor="#FDDCCE"> <td colspan="3"> <div align="center"> <font face="Tahoma, MS Sans Serif"> <input type="hidden" name="Student_id" value="<? echo $rs[Student_id]?>"> <input type="submit" name="Submit" value=" à¾ÔèÁ "> </font></div></td> </tr> </table> </form></td> </tr> </table> </body> </html>
|