Viewing file: InsertProject.php (4.18 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"); ConnectDB(); $Flag = true; $Project_name = htmlspecialchars(trim($_POST[Project_name])); $Faculty_code = htmlspecialchars(trim($_POST[Faculty_code])); $Period = $_POST['mYear']."-".$_POST['mMonth']."-".$_POST['mDate']; $Date_start = $_POST['mYear2']."-".$_POST['mMonth2']."-".$_POST['mDate2']; $Term = htmlspecialchars(trim($_POST[Term])); $Res = htmlspecialchars(trim($_POST[Res])); $Detail = htmlspecialchars(trim($_POST[Detail])); $Year_budget = htmlspecialchars(trim($_POST[Year_budget])); $Budget = htmlspecialchars(trim($_POST[Budget])); $Budget_use = htmlspecialchars(trim($_POST[Budget_use])); $Target_group = htmlspecialchars(trim($_POST[Target_group])); $Objective = htmlspecialchars(trim($_POST[Objective])); $Fund_support = htmlspecialchars(trim($_POST[Fund_support])); $Fee = htmlspecialchars(trim($_POST[Fee])); $Response = htmlspecialchars(trim($_POST[Response])); $Total_time_project = htmlspecialchars(trim($_POST[Total_time_project])); $Total_time_insi = htmlspecialchars(trim($_POST[Total_time_insi])); $Total_time_inso = htmlspecialchars(trim($_POST[Total_time_inso])); $Result_oper = htmlspecialchars(trim($_POST[Result_oper])); $Dif_result = $_POST[Budget] - $_POST[Budget_use]; ///////////////////// check name if ($Project_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; } /////////////////// if ($Budget =="") { $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 Status to Insert Data ///////////////////////////// if( $Flag) { $Path = "../Project_plan"; if ( isset($Img1)) if (copy($Img1,"$Path/$Img1_name")) { unlink ($Img1); $Img1 = "$Path/$Img1_name"; } else echo"Can't Copy"; InsertEdu_Service($Project_name,$Faculty_code,$Period,$Date_start,$Term,$Res,$Detail,$Year_budget,$Budget,$Budget_use,$Target_group,$Objective, $Fund_support, $Fee,$Response,$Total_time_project ,$Total_time_insi ,$Total_time_inso,$Dif_result,$Result_oper,$Img1); $msg.="<li>ระบบจัดเก็บข้อมูลของท่านเรียบร้อยแล้ว"; echo"<meta http-equiv=\"refresh\" content=\"1;URL=ProjectList.php?Faculty_code=$Faculty_code\">\n"; } CloseDB(); ?> <html> <head> <title>Project Detail</title> <meta http-equiv="Content-Type" content="text/html; charset=windows-874"> <link rel="stylesheet" href="../../css/style1.css" type="text/css"> </head> <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0"marginwidth="0"marginheight="0"> <form> <br> <table width="57%" border="0" cellspacing="0"cellpadding="2"align="center"> <tr> <td><div align="center"><span><b><font color="#003366" size="4" face="Tahoma">::แบบฟอร์มการโครงการ::</font></b></span></div></td> </tr> <tr> <td> <table width="100%" border="0" cellspacing="1"cellpadding="0"align="center"bordercolor="#0B62D9" class="table"> <tr> <td bgcolor="#E0F9DF"><div align="center"><b><font color="#003399" size="4" face="Tahoma">ระบบแจ้ง</font></b></div></td> </tr> <tr> <td bgcolor="#000000"> <table width="90%" border="0" cellspacing="0"cellpadding="2"align="center"> <tr> <td><strong><font color="#FFFFFF" size="3" face="Tahoma"><span><?php echo $msg;?></span></font></strong></td> </tr> </table></td> </tr> <tr> <td bgcolor="#E0F9DF"> <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 "; } ?>
|