Viewing file: AddPunish.php (7.12 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php session_start(); if (session_is_registered("valid_user")&&session_is_registered("Priority")&&session_is_registered("password") ) { include("../include/FunctionDB.php"); include("admin_menu.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); ?> <meta http-equiv="Content-Type" content="text/html; charset=TIS-620"> <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> <table width="835" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="835" ><br> <fieldset> <legend><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><a href="Edu_Menu.php">˹éÒËÅÑ¡</a> <img src="../picture/ico3.gif" width="10" height="10" border="0" align="absmiddle"></font><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><a href="StudentList.php?Student_id=<? echo $rs[Student_id]?>">¢éÍÁÙŹѡÈÖ¡ÉÒ</a></font><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><img src="../picture/ico3.gif" width="10" height="10" border="0" align="absmiddle" /></font><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><a href="menu_std.php?Student_id=<? echo $rs[Student_id]?>">¢éÍÁÙÅ»ÃÐÇѵԹѡÈÖ¡ÉÒ</a></font><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><a href="EditStudentList.php"></a> <img src="../picture/ico3.gif" width="10" height="10" border="0" align="absmiddle" /><a href="AddPunish.php?Student_id=<? echo $rs[Student_id]?>"> à¾ÔèÁ¢éÍÁÙŤÇÒÁ¼Ô´áÅÐâ·É</a></font><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"> <img src="../picture/ico3.gif" width="10" height="10" border="0" align="absmiddle" /><a href="EditPunishList.php?Student_id=<? echo $rs[Student_id]?>">á¡é䢢éÍÁÙŤÇÒÁ¼Ô´áÅÐâ·É</a></font></legend> <label> <form id="form1" name="form1" method="post" action="InsertPunish.php"> <table width="73%" border="0" align="center" cellpadding="0" cellspacing="1" bordercolor="#99CCFF"> <tr bgcolor="#FDDCCE"> <td height="25" colspan="3"><div align="center"><font face="Tahoma, MS Sans Serif"><strong><font color="#000000" size="4">à¾ÔèÁ</font><font face="Tahoma, MS Sans Serif"><strong><font size="4">¢éÍÁÙžĵԡÃÃÁ áÅÐ ÇԹѠ¹Ñ¡ÈÖ¡ÉÒ</font></strong></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" class="input1" id="mYear" size="5" maxlength="4"> </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="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="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> </fieldset> <br> <font color="<?php echo $GLOBALS["COLOR_FONT_3"];?>" size="2"><b>ËÁÒÂà赯 :</b> ãªéàÁÒÊì¤ÅÔ¡·Õèª×èÍ<br> </font></td> </tr> </table> <?php } else { echo"<meta http-equiv=\"refresh\" content=\"3;URL=../login.php\">\n"; echo"Please Login "; } ?>
|