Viewing file: InsertHistory_new.php (4.86 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
session_start();
if (session_is_registered("valid_user")){
require_once("../configuration.php");
include("../include/FunctionDB.php");
include("../include/Function.php");
ConnectDB();
list($d,$m,$y) = split('/',$_REQUEST["DateBirth"]);
$Flag = true;
$First_name = htmlspecialchars(trim($_POST[First_name]));
$Teacher_name = htmlspecialchars(trim($_POST[Teacher_name]));
$Teacher_lastname = htmlspecialchars(trim($_POST[Teacher_lastname]));
$Address = htmlspecialchars(trim($_POST[Address]));
$Skill = htmlspecialchars(trim($_POST[Skill]));
//$DateBirth = $_POST[mYear]."-".$_POST[mMonth]."-".$_POST[mDate];
$DateBirth = ($y+543)."-".$m."-".$d;
$Type_degree1 = htmlspecialchars(trim($_POST[Type_degree1]));
$Type_degree2 = htmlspecialchars(trim($_POST[Type_degree2]));
$Type_degree3 = htmlspecialchars(trim($_POST[Type_degree3]));
//$Teacher_id = $_POST[Id1]."-".$_POST[Id2]."-".$_POST[Id3]."-".$_POST[Id4];
$Teacher_id = $_POST[Username];
$Sex = htmlspecialchars(trim($_POST[Sex]));
$Nationality = htmlspecialchars(trim($_POST[Nationality]));
$Nation = htmlspecialchars(trim($_POST[Nation]));
//$Religion = htmlspecialchars(trim($_POST[Religion]));
$Religion = ($_REQUEST["Religion"] == "อื่นๆ")?$_REQUEST["Religion"]."@".$_REQUEST["ReligionOther"]:$_REQUEST["Religion"];
$Citizen_id = htmlspecialchars(trim(str_replace("-","",$_POST[Citizen_id])));
$Father_name = htmlspecialchars(trim($_POST[Father_name]));
$Mother_name = htmlspecialchars(trim($_POST[Mother_name]));
$Status =htmlspecialchars(trim($_POST[Status]));
$Status2 =htmlspecialchars(trim($_POST[Status2]));
$Status3 =htmlspecialchars(trim($_POST[Status3]));
$Soulmate = htmlspecialchars(trim($_POST[Soulmate]));
$Total_child = htmlspecialchars(trim($_POST[Total_child]));
$Type_Degree = $_POST[Type_Degree];
$Degree_code = $_POST[Degree_code];
$Degree_else = $_POST[Degree_else];
$Club_nid = $_POST[Club_nid];
$Skill = htmlspecialchars(trim($_POST[Skill]));
$Gover_id = $_POST[Gover_id];
$Forum_nid = $_POST[Club_nid];
$Year_gov = $_POST[Year_gov];
$Year_coll = $_POST[Year_coll];
$Year_fac = $_POST[Year_fac];
$Gover_pos = $_POST[Gover_pos];
$Manage_pos = $_POST[Manage_pos];
$Faculty_code = $_POST[Faculty_code];
$Group = htmlspecialchars(trim($_POST[Group]));
$Username = $_POST[Username];
$Password = $_POST[Password];
$conId = $_REQUEST["conId"];
$Img1 = $defaultPicFile;
$StatusId=1;
$Priority = $_REQUEST['permission'];
$Permission = $_REQUEST['permission'];
$PasswordR = $Password;
$Password = md5($Password);
$Flag = 1;
InsertHistory($Teacher_id,$First_name,$Teacher_name,$Teacher_lastname,$DateBirth,$Sex, $Nationality,$Nation,$Religion,$Citizen_id,$Father_name,$Mother_name,$Status,$Status2,$Status3,$StatusId,$Soulmate,$Total_child,$Address,$districtId,$amphurId,$provinceId,$conId,$Img1,$Type_Degree,$Degree_code,$Degree_else,$Degree_His1,$Degree_His1_Major,$Degree_His1_Institute,$Degree_His1_End_Year,$Degree_His2,$Degree_His2_Major,$Degree_His2_Institute,$Degree_His2_End_Year,$Degree_His3,$Degree_His3_Major,$Degree_His3_Institute,$Degree_His3_End_Year,$Type_degree1, $Type_degree2,$Type_degree3,$Person_type,$Teacher_type,$Gover_id,$Forum_nid,$Club_nid,$Year_gov,$Year_coll,$Year_fac,$PositionId,$Manage_pos,$Faculty_code,$Username,$Password,$Permission);
$Teacher_code = mysql_insert_id();
InsertUser($Teacher_code,$Username,$Password,$PasswordR,$Priority,$Flag);
$msg = "ระบบจัดเก็บข้อมูลของ คุณ ".$Teacher_name." ".$Teacher_lastname." เรียบร้อยแล้ว";
CloseDB();
?>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<link href="../css/style1.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0"marginwidth="0"marginheight="0"><br>
<table width="70%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<table width="50%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td bgcolor="#D7EBF4" align="center">
<font color="#000000" size="3" face="Tahoma"><b>ระบบแจ้งผลการทำงาน</b></font>
</td>
</tr>
<tr>
<td height="40" align="center"><b><?=$msg;?></b></td>
</tr>
</table>
<meta http-equiv="refresh" content="2;URL=AddHistory_new.php">
</td>
</tr>
</table>
</body>
</html>
<?php
}
else{
echo"<body bgcolor=\"#CCCCCC\">";
echo"<meta http-equiv=\"refresh\" content=\"3;URL=../logout.php\" target=\"mainFrame\">\n";
echo"<center>";
echo"<br><br><br><b><font face=\"Tahoma\" size=\"4\" color=\"#FF0000\">Please Login</font> </b><br>";
echo"<br><br><font face=\"Tahoma\" size=\"10\" color=\"#000000\"> ERROR 404 PERMISION DENY</font><br>";
echo"<br><font face=\"Tahoma\" size=\"4\" color=\"#000000\"> คุณไม่มีสิทธ์ใช้งาน</font>";
echo"</center>";
echo"</body>";
}
?>
|