Viewing file: InsertTraining.php (4.23 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php session_start(); if (session_is_registered("valid_user")) { $Username = $valid_user; include("../include/FunctionDB.php"); ConnectDB(); $Flag = true; $Training_name = htmlspecialchars(trim($_POST["Training_name"])); $Period_code = htmlspecialchars(trim($_POST["Period_code"])); $Training_type = htmlspecialchars(trim($_POST["Training_type"])); $CNEU = htmlspecialchars(trim($_POST["CNEU"])); $Total_hour = htmlspecialchars(trim($_POST["Total_hour"])); $Place = htmlspecialchars(trim($_POST["Place"])); $Place_des = htmlspecialchars(trim($_POST["Place_des"])); $Fund_resource = htmlspecialchars(trim($_POST["Fund_resource"])); $Date_start = $_POST['mYear1']."-".$_POST['mMonth1']."-".$_POST['mDate1']; $Date_finish = $_POST['mYear2']."-".$_POST['mMonth2']."-".$_POST['mDate2']; $Date_sent = $_POST['mYear3']."-".$_POST['mMonth3']."-".$_POST['mDate3']; $Duty = htmlspecialchars(trim($_POST["Duty"])); $Resp = htmlspecialchars(trim($_POST["Resp"])); $Apply = htmlspecialchars(trim($_POST["Apply"])); $Period_prop = htmlspecialchars(trim($_POST["Period_prop"])); ///////////////////// check name if ($Training_name =="") { $msg .="<li>กรุณากรอก ชื่อเรื่อง"; $button ="<input type=\"button\" value=\"Back to Edit\" onclick=\"history.back();\" style=\"font-weight:bold;color:#FFF;background-color:#036;border-style:outset;border-color:#69F;font-family:Tohoma;\">"; $Flag = false; } ///////// check period time long or short if ($Period_code =="") { $msg .="<li>กรุณากรอก ระยะเวลา"; $button ="<input type=\"button\" value=\"Back to Edit\" onclick=\"history.back();\" style=\"font-weight:bold;color:#FFF;background-color:#036;border-style:outset;border-color:#69F;font-family:Tohoma;\">"; $Flag = false; } ///////// check period time long or short if ($Training_type =="") { $msg .="<li>กรุณาเลือก ประเภท"; $button ="<input type=\"button\" value=\"Back to Edit\" onclick=\"history.back();\" style=\"font-weight:bold;color:#FFF;background-color:#036;border-style:outset;border-color:#69F;font-family:Tohoma;\">"; $Flag = false; } /////////////////// Check Branch if ($Year_std =="") { $msg .="<li>กรุณากรอก ปี พ.ศ"; $button ="<input type=\"button\" value=\"Back to Edit\" onclick=\"history.back();\" style=\"font-weight:bold;color:#FFF;background-color:#036;border-style:outset;border-color:#69F;font-family:Tohoma;\">"; $Flag = false; } /////////////////////// Check Address if( $Flag) { InsertTraining($Teacher_code,$Training_name,$Period_code,$Training_type,$Level,$Major,$Year_std,$Place,$Place_des,$Date_start,$Date_finish,$CNEU,$Total_hour,$Fund,$Fund_resource,$Organiz,$Date_sent,$Period_prop,$Apply); $msg.="<li>ระบบจัดเก็บข้อมูลเรียบร้อยแล้ว"; echo"<meta http-equiv=\"refresh\" content=\"2;URL=TrainingMe.php?Teacher_code=$Teacher_code\">\n"; } CloseDB(); ?> <html> <head> <title>Inserting History Training</title> <link rel="stylesheet" href="../css/style1.css" type="text/css"> <meta http-equiv="Content-Type" content="text/html; charset=windows-874"></head> <body bgcolor="#F2FCED" leftmargin="0" topmargin="0"marginwidth="0"marginheight="0"> <form> <br> <table width="68%" border="0" cellspacing="0"cellpadding="2"align="center"> <tr> <td><div align="center"><span><b><font color="#000000" size="3" face="Tahoma">::ฟอร์มการเพิ่มข้อมูลการอบรม/ดูงาน::</font></b></span></div></td> </tr> <tr> <td> <table width="74%" border="0" cellspacing="1"cellpadding="2"align="center"bordercolor="#0B62D9" class="table"> <tr> <td bgcolor="#006633"> <div align="center"><b><font color="#CCFF00" size="3" face="Tahoma">ระบบแจ้งการทำงาน</font></b></div></td> </tr> <tr> <td> <table width="90%" border="0" cellspacing="0"cellpadding="2"align="center"> <tr> <td><font color="#FF0000"><strong><font size="3" face="Tahoma"><span><?php echo $msg;?></span></font></strong></font></td> </tr> </table></td> </tr> <tr> <td bgcolor="#006633"> <div align="center"><b><font color="#CCFF00"><?php echo $button;?></font></b></div></td> </tr> </table> </td> </tr> </table> <br> <br> </form> </body> </html> <?php } else { echo"<meta http-equiv=\"refresh\" content=\"3;URL=../../login.php\">\n"; echo"Please Login "; } ?>
|