Viewing file: InsertPlan_bkp.php (4.39 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include("../include/FunctionDB.php");
ConnectDB();
$Flag = true;
$Teacher_code = htmlspecialchars(trim($_POST[Teacher_code]));
$courseId = htmlspecialchars(trim($_POST[courseId]));
$Subject_group = htmlspecialchars(trim($_POST[Subject_group]));
$Objective = htmlspecialchars(trim($_POST[Objective]));
$Mainidea = htmlspecialchars(trim($_POST[Mainidea]));
$Media = htmlspecialchars(trim($_POST[Media]));
$Appendix = htmlspecialchars(trim($_POST[Appendix]));
$Place = htmlspecialchars(trim($_POST[Place]));
$Start_date = htmlspecialchars(trim($_POST[Start_date]));
//$Start_date = $mYear."-".$mMonth."-".$mDay;
$Res_unit = htmlspecialchars(trim($_POST[Res_unit]));
$Apply = htmlspecialchars(trim($_POST[Apply]));
///////////////////// check Code
if ($courseId =="")
{
$msg .="<li>กรุณาระบุ รหัสวิชา";
$button ="<input type=\"button\" value=\"Back to Edit\" onclick=\"history.back();\">";
$Flag = false;
}
///////////////////// check name
if ($Mainidea =="")
{
$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 name
if ($Objective =="")
{
$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 Lastname
if ($Total_hour =="")
{
$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
if ($Total_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 Status to Insert Data /////////////////////////////
if( $Flag)
{
InsertPlan($Teacher_code,$programId,$Status,$conditionId1,$conditionId2,$courseId,$Start_date,$Objective,$Mainidea,$Title_name,$Total_hour,$Total_std,$Assess_code,$Method_code,$Place,$Media,$Appendix,$Res_unit,$Apply,$Asses1,$Asses2,$Asses3,$Asses4);
$Plan_code = mysql_insert_id();
InsertMTP($Plan_code,$Teacher_code,$courseId,$M1,$M2,$M3,$M4,$M5,$M6,$M7,$M8,$M9,$M10,$M11,$M12,$M13,$M14,$M15,$M16,$M17,$M18,$M19,$M20,$M21,$M_else,$Else_desc);
InsertSpt($Plan_code,$Teacher_code,$courseId,$Sp1,$Sp2,$Sp3,$Sp4,$Sp5,$Sp6,$Sp7,$Sp8,$Sp9,$Sp10);
$msg.="<li>ระบบจัดเก็บข้อมูลของท่านเรียบร้อยแล้ว";
echo"<meta http-equiv=\"refresh\" content=\"1;URL=PlanList.php?Teacher_code=$Teacher_code\">";
}
CloseDB();
?>
<html>
<head>
<title>Insert Tech Plan....</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<link rel="stylesheet" href="cart4.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0"marginwidth="0"marginheight="0">
<form>
<br>
<table width="64%" border="0" cellspacing="0"cellpadding="2"align="center">
<tr>
<td><div align="center"><span><b><font color="#003399" size="4" face="Tahoma">::แบบฟอร์มการกรอกข้อมูลแผนการสอน::</font></b></span></div></td>
</tr>
<tr>
<td> <table width="81%" border="0" cellspacing="1"cellpadding="0"align="center"bordercolor="#666666">
<tr>
<td bgcolor="#D3E4F8"><div align="center"><b><font color="#333333" size="3" face="Tahoma">ระบบแจ้ง</font></b></div></td>
</tr>
<tr>
<td bgcolor="#000000">
<table width="90%" border="0" cellspacing="0"cellpadding="2"align="center"class="table">
<tr>
<td><span><b><font color="#FFFFFF"><?php echo $msg;?></font></b></span></td>
</tr>
</table></td>
</tr>
<tr>
<td bgcolor="#D3E4F8">
<div align="center"><b><font color="#CCFF00"><?php echo $button;?></font></b></div></td>
</tr>
</table></td>
</tr>
</table>
<br>
</form>
</body>
</html>
|