Viewing file: FunctionDB1.php (73.47 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<!-- <meta http-equiv="Content-Type" content="text/html; charset=windows-874" /> -->
<?php
include("Config.php");
//// Function ติอต่อฐานข้อมูล
function ConnectDB() {
global $con;
global $ServerName;
global $UserName;
global $UserPassword;
global $DataBaseName;
$con = mysql_connect( $ServerName, $UserName, $UserPassword );
if (!$con)
die("Can't Connect DataBase".mysql_error());
mysql_query("SET NAMES 'tis620'");
mysql_select_db($DataBaseName) or die ("Can't Select DataBase ManageDB");
}
/////////////////////// Uses Close DB ////////////////////////////
function CloseDB()
{
global $con;
mysql_close($con);
}
///////////////////////////// * 1 * InsertTreat //////////
function InsertTreat( $Code_1, $Name, $Price, $Description_1, $Description_2, $Description_3 )
{
global $conn;
$sql = " INSERT INTO treatment_tb (Code_1,Name,Price,Description_1,Description_2,Description_3) ";
$sql .= " VALUES ('$Code_1','$Name','$Price','$Description_1','$Description_2','$Description_3') ";
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
///////////////////////////////////////////////////// ** 2 ** ////////////////
function InsertLab_type($Code_id,$Lab,$Description)
{
global $conn;
$sql = " INSERT INTO labtype_tb (Code_id,Lab,Description) ";
$sql .= " VALUES ('$Code_id','$Lab','$Description') " ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
///////////////////////////////////////////////////// InsertFormation /////////////////////////
function InsertFormation($InforName, $InforDetail, $Teacher_code,$date_updated )
{
global $conn;
$sql = " INSERT INTO formation_tb ( InforName, InforDetail, Teacher_code, date_updated) ";
$sql .= " VALUES ( '$InforName', '$InforDetail', '$Teacher_code',NOW() ) ";
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
///////////////////////////////////////////////////// ** 2 ** ////////////////
function Inserttooth($Code_id,$Description_1,$Description_2)
{
global $conn;
$sql = " INSERT INTO tooth_tb (Code_id,Description_1,Description_2) ";
$sql .= " VALUES ('$Code_id','$Description_1','$Description_2') ";
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
///////////////////////////////////////////////////// ** 4 ** ///////////////////////
function InsertDescription($Code_id,$Description_1,$Description_2)
{
global $conn;
$sql = " INSERT INTO descriptionplan_tb (Code_id,Description_1,Description_2)";
$sql .= " VALUES ('$Code_id','$Description_1','$Description_2')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
/////////////////////////////////////////////////// ** 5 ** ///////////////////////
function InsertDentis($Orderlist,$Dental_code,$First_name,$Name,$Lastname,$Name_eng, $Lastname_eng,$Sex,$DateBirth,$Datetype,$Religion,$Address,$Img1,$ProvinceId,$Phone_1, $Phone_2,$Email,$Description_1,$Description_2,$Year_1,$Flag)
{
global $conn;
$sql = " INSERT INTO dentis_tb (Orderlist,Dental_code,First_name,Name,Lastname,Name_eng, Lastname_eng,Sex,DateBirth,Datetype,Religion,Address,Img1,ProvinceId,Phone_1,Phone_2,Email,Description_1,Description_2,Year_1,Flag)";
$sql .= " VALUES ('$Orderlist','$Dental_code','$First_name','$Name','$Lastname','$Name_eng',' $Lastname_eng','$Sex','$DateBirth','$Datetype','$Religion','$Address','$Img1','$ProvinceId','$Phone_1','$Phone_2','$Email','$Description_1','$Description_2','$Year_1','$Flag')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
///////////////////////////////////////////////////// ** 6 ** /////////////////////
function InsertTreatcat($Code_id,$Description_1,$Description_2)
{
global $conn;
$sql = "INSERT INTO treatcat_tb (Code_id,Description_1,Description_2)";
$sql = $sql."VALUES ('$Code_id','$Description_1','$Description_2')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
///////////////////////////////////////////////////// * * 7 * * /////////////////////////
function InsertDiagnosis($Code_id,$Description_1,$Description_2)
{
global $conn;
$sql = "INSERT INTO diagnosis_tb (Code_id,Description_1,Description_2)";
$sql = $sql."VALUES ('$Code_id','$Description_1','$Description_2')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
////////////////// * * 8 * * Insert Person ทันตกรรม /////////
function
InsertPersonDen($HN_code,$Teacher_code,$First_name,$Name,$Lastname,$DateBirth,$Datetype,$Sex,$Hostpital,
$Nationality,$Nation,$Religion,$Citizen_id,$Father_name,$Mother_name,$Age,$ProvinceId, $Zipcode,$Phone,$Mobile,$Work,$Education,$Email_name,$Email_1,$Status2, $Status3,$Phone_1,$Mobile_1,$Address,$Img1,$Degree_code, $Person_type,$Club_nid,$Group_1,$Group_2,$Group_3,$Group_4,$Dental_code,$Username,$Password, $Permision)
{
global $conn;
$strSQL = "INSERT INTO personal_den_tb (HN_code,Teacher_code,First_name,Name,Lastname,DateBirth,Datetype,Sex,Hostpital,Nationality,Nation,Religion,Citizen_id,Father_name,Mother_name,Age,ProvinceId, Zipcode,Phone,Mobile,Work,Education,Email_name,Email_1,Status2, Status3,Phone_1,Mobile_1,Address,Img1,Degree_code, Person_type,Club_nid,Group_1,Group_2,Group_3,Group_4,Dental_code,Username,Password, Permision)";
$strSQL = $strSQL." VALUES('$HN_code','$Teacher_code','$First_name','$Name','$Lastname','$DateBirth','$Datetype','$Sex','$Hostpital','$Nationality','$Nation','$Religion','$Citizen_id','$Father_name','$Mother_name','$Age','$ProvinceId',' $Zipcode','$Phone','$Mobile','$Work','$Education','$Email_name','$Email_1','$Status2',' $Status3','$Phone_1','$Mobile_1','$Address','$Img1','$Degree_code',' $Person_type','$Club_nid','$Group_1','$Group_2','$Group_3','$Group_4','$Dental_code','$Username','$Password','$Permision')";
mysql_query($strSQL) or die(" INSERT HAS INCORRECT $result $strSQL".mysql_error());
}
////////////////// * * 8 * * Insert Personal Health Database//////////
function InsertPersonHealth($HN_code,$Dentis_code,$First_name,$Name,$Lastname,$DateBirth,$Datetype,$Sex,$Hostpital,
$Nationality,$Nation,$Religion,$Citizen_id,$Father_name,$Mother_name,$Age,$ProvinceId, $Zipcode,$Phone,$Mobile,$Work,$Education,$Email_name,$Email_1,$Status2, $Status3,$Phone_1,$Mobile_1,$Address,$Img1,$Degree_code, $Person_type,$Club_nid,$Group_1,$Group_2,$Group_3,$Group_4,$Dental_code)
{
global $conn;
$strSQL = "INSERT INTO personal_health_tb (HN_code,Dentis_code,First_name,Name,Lastname,DateBirth,Datetype,Sex,Hostpital,Nationality,Nation,Religion,Citizen_id,Father_name,Mother_name,Age,ProvinceId, Zipcode,Phone,Mobile,Work,Education,Email_name,Email_1,Status2, Status3,Phone_1,Mobile_1,Address,Img1,Degree_code, Person_type,Club_nid,Group_1,Group_2,Group_3,Group_4,Dental_code,)";
$strSQL = $strSQL." VALUES('$HN_code','$Dentis_code','$First_name','$Name','$Lastname','$DateBirth','$Datetype','$Sex','$Hostpital','$Nationality','$Nation','$Religion','$Citizen_id','$Father_name','$Mother_name','$Age','$ProvinceId',' $Zipcode','$Phone','$Mobile','$Work','$Education','$Email_name','$Email_1','$Status2',' $Status3','$Phone_1','$Mobile_1','$Address','$Img1','$Degree_code',' $Person_type','$Club_nid','$Group_1','$Group_2','$Group_3','$Group_4','$Dental_code')";
mysql_query($strSQL) or die(" INSERT HAS INCORRECT $result $strSQL".mysql_error());
}
/////////////////////// * * 9 * * InsertTeachPlan ////////////////////////////
function InsertTeachPlan($Person_code,$HN_code,$Tooth_code,$Teach_code,$Teacher_code,$Code ,$Time_in,$Time_out,$Date,$Date_1,$Time ,$Religion ,$Teach1,$Teach2,$Teach3,$Teach4,
$Teach5,$Teach6,$Teach7,$Teach8,$Teach9,$Teach10,$Teach11,$Teach12,$Teach13,$Teach_13,$Tooth_code1,$Tooth_code3 ,$Tooth_code4,$Tooth_code5,$Tooth_code6,$Tooth_code7,$Tooth_code8,$Tooth_code11,$Tooth_code12)
{
global $conn;
$strSQL = "INSERT INTO teachplan_tb (Person_code,HN_code,Tooth_code,Teach_code,Teacher_code,Code ,Time_in,Time_out,Date,Date_1,Time ,Religion ,Teach1,Teach2,Teach3,Teach4,
Teach5,Teach6,Teach7,Teach8,Teach9,Teach10,Teach11,Teach12,Teach13,Teach_13,Tooth_code1,Tooth_code3 ,Tooth_code4,Tooth_code5,Tooth_code6,Tooth_code7,Tooth_code8,Tooth_code11,Tooth_code12)";
$strSQL = $strSQL." VALUES ('$Person_code','$HN_code','$Tooth_code','$Teach_code','$Teacher_code','$Code','$Time_in','$Time_out','$Date','$Date_1','$Time','$Religion','$Teach1','$Teach2','$Teach3','$Teach4','
$Teach5','$Teach6','$Teach7','$Teach8','$Teach9','$Teach10','$Teach11','$Teach12','$Teach13','$Teach_13','$Tooth_code1','$Tooth_code3','$Tooth_code4','$Tooth_code5','$Tooth_code6','$Tooth_code7','$Tooth_code8','$Tooth_code11','$Tooth_code12')";
mysql_query($strSQL) or die(" INSERT HAS INCORRECT $result $strSQL".mysql_error());
}
/////////////// * * * 10 ** InsertAccount * * * /////
function InsertAccount($Person_code,$No_code,$HN_code,$Tooth_code,$Teach_code,$Teacher_code,$Code ,$Time_in,$Time_out,$Date,$Price ,$Mount,$Cost_total,$Percen,$Hostpital,$Roug)
{
global $conn;
$sql = "INSERT INTO account (Person_code,No_code,HN_code,Tooth_code,Teach_code,Teacher_code,Code ,Time_in,Time_out,Date,Price ,Mount,Cost_total,Percen,Hostpital,Roug)";
$sql = $sql."VALUES('$Person_code','$No_code','$HN_code','$Tooth_code','$Teach_code','$Teacher_code','$Code' ,'$Time_in','$Time_out','$Date','$Price' ,'$Mount','$Cost_total','$Percen','$Hostpital','$Roug')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
/////////////// * * * 11 * * InsertPlanTeach * * * /////
function InsertPlanTeach($Person_code,$No_code,$HN_code,$Teach_code,$Tooth_code,$Teacher_code,$Code ,$Time_in,$Img1,$Time_out,$Date,$Religion,$Discrition,$Flag)
{
global $conn;
$sql = "INSERT INTO planteach_tb (Person_code,No_code,HN_code,Teacher_code,Tooth_code,Teach_code,Code ,Time_in,Img1,Time_out,Date,Religion,Discrition,Flag)";
$sql = $sql."VALUES('$Person_code','$No_code','$HN_code','$Teacher_code','$Tooth_code','$Teacher_code','$Code' ,'$Time_in','$Img1','$Time_out','$Date','$Religion','$Discrition','$Flag')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
///////////////////////////// InsertCommit //////////
function InsertCommit($Teacher_code,$Title,$Year_com,$Edu,$Edu_job,$Tsis,$Check_tool,$Scp10,$Club_bcnlp,$North_network,$Else_commit,$Houn,$Filetex)
{
global $conn;
$sql = "INSERT INTO committee_tb (Teacher_code,Title,Year_com,Edu,Edu_job,Tsis,Check_tool,Scp10,Club_bcnlp,North_network,Else_commit,Houn,Filetex)";
$sql = $sql."VALUES ('$Teacher_code','$Title','$Year_com','$Edu','$Edu_job','$Tsis','$Check_tool','$Scp10','$Club_bcnlp','$North_network','$Else_commit','$Houn','$Filetex')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
///////////////////////////////////////////////////// InsertEdu_Service //////////
function InsertEdu_Service($Project_name,$Faculty_code,$Date_start,$Date_finish,$Date_in,$Date_out,$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)
{
global $conn;
$sql = "INSERT INTO edu_service_tb (Project_name,Faculty_code,Date_start,Date_finish,Date_in,Date_out,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)";
$sql = $sql."VALUES ('$Project_name','$Faculty_code','$Date_start','$Date_finish','$Date_in','$Date_out','$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')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
/////////////////////////////////////////////////// Insert_Res_project ///////////////
function Insert_Res_project( $Teacher_code , $Project_name , $Year_res , $Duty , $Duty_else , $Apply )
{
global $conn;
$sql = " INSERT INTO res_project_tb ( Teacher_code , Project_name , Year_res , Duty , Duty_else, Apply, date_added ) ";
$sql .= " VALUES ( '$Teacher_code' , '$Project_name' , '$Year_res' , '$Duty' , '$Duty_else' , '$Apply' , NOW() ) " ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
/////////////////////////////////////////////////// CHECK PLANT CODE /////////////
function CheckTeacher_code($Teacher_code)
{
global $conn;
$strSQL = "SELECT * FROM teachertb WHERE Teacher_code = $Teacher_code";
$result = mysql_query($strSQL) or die(" SELECT HAS ERROR $result".mysql_error());
$num = mysql_num_rows($result);
return empty($num);
}
////////////////////////////////////// Check Research Code /////////////////
function UpdateLimit($Id4)
{
global $conn;
$strSQL = "UPDATE limittb SET Id4=Id4+1 ";
$result = mysql_query($strSQL) or die("$result $strSQL".mysql_error());
}
/////////////////////// Insert Personal History To Database /////////////////////
function 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,$Img1,$Skill, $Type_Degree,$Degree_code,$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,$Salary_1,$Salary_2,$Salary_3,$Type_degree1,$Type_degree2, $Type_degree3,$Year_1,$Year_2,$Year_3, $Person_type,$Teacher_type,$Gover_id,$Forum_nid,$Club_nid,$Year_gov, $Year_coll,$Year_fac, $Gover_pos, $PositionId , $Manage_pos,$Faculty_code,$Email,$Username,$Password, $Permission,$date_updated)
{
global $conn;
$strSQL = "INSERT INTO personal_tb (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, Img1,Skill,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,Salary_1,Salary_2,Salary_3,Type_degree1,Type_degree2,Type_degree3,Year_1,Year_2,Year_3,Person_type,Teacher_type,Gover_id,Forum_nid,Club_nid,Year_gov,Year_coll,Year_fac,Gover_pos, PositionId, Manage_pos,Faculty_code,Email,Username,Password,Permission,date_updated)";
$strSQL = $strSQL." VALUES('$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','$Img1','$Skill','$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','$Salary_1','$Salary_2','$Salary_3','$Type_degree1','$Type_degree2','$Type_degree3','$Year_1','$Year_2','$Year_3','$Person_type','$Teacher_type','$Gover_id','$Forum_nid','$Club_nid','$Year_gov','$Year_coll','$Year_fac','$Gover_pos','$PositionId','$Manage_pos','$Faculty_code','$Email','$Username','$Password','$Permission',NOW() )";
mysql_query($strSQL) or die(" INSERT HAS INCORRECT $result $strSQL".mysql_error());
}
/////////////////////// Insert Personal Poisiton History To Database ///////////////
function
Insert_Position_History($Teacher_code,$Position_id,$Date_post,$Gover_pos,$Manage_pos, $Level,$Salary,$Salary_2,$Salary_3,$Skill, $Order_id,$Ref_doc,$Flag,$date_updated)
{
global $conn;
$strSQL = "INSERT INTO history_position_tb (Teacher_code,Position_id,Date_post,Gover_pos,Manage_pos,Level,Salary,Salary_2,Salary_3,Skill,Order_id,Ref_doc,Flag,date_updated)";
$strSQL = $strSQL." VALUES('$Teacher_code','$Position_id','$Date_post','$Gover_pos','$Manage_pos','$Level','$Salary','$Salary_2','$Salary_3','$Skill','$Order_id','$Ref_doc','$Flag',NOW())";
mysql_query($strSQL) or die(" $strSQL INSERT HAS INCORRECT $result $sql".mysql_error());
}
////// /////////////// Insert_Salary//////////
function
Insert_Salary ($Salary,$Teacher_code,$Start_mont,$Start_year,$Cost_1,$Cost_2,$Cost_3,$Cost_4,$Cost_5, $Cost_6,$Cost_7,$Cost_8, $Cost_9,$Cost_10,$Cost_11,$Cost_12,$Cost_13,$Cost_14,$Cost_15,$Cost_16,$Flag)
{
global $conn;
$strsql = "INSERT INTO salary_tb(Salary,Teacher_code,Start_mont,Start_year,Cost_1,Cost_2,Cost_3,Cost_4,Cost_5,Cost_6,Cost_7,Cost_8,Cost_9,Cost_10,Cost_11,Cost_12,Cost_13,Cost_14,Cost_15,Cost_16,Flag)";
$strsql =
$strsql. "VALUES ('$Salary','$Teacher_code','$Start_mont','$Start_year','$Cost_1','$Cost_2','$Cost_3','$Cost_4','$Cost_5','$Cost_6','$Cost_7',' $Cost_8','$Cost_9','$Cost_10','$Cost_11','$Cost_12','$Cost_13','$Cost_14','$Cost_15','$Cost_16','$Flag')";
mysql_query($strsql) or die("$strSQL INSERT HAS INCORRECT $result $sql".mysql_error());
}
///////// Insert_Salary_repot //////
function
Insert_Salary_repot ($Teacher_code,$Teacher_id,$StatusId,$Faculty_code,$Person_type,$Start_mont,$Start_year,$Salary_1,$Salary_2,$Salary_3,$Costt_1,$Costt_2, $Costt_3,$Costt_4,$Costt_5, $Costt_6,$Costt_7,$Costt_8, $Costt_9,$Costt_10,$Costt_11,$Costt_12,$Costt_13,$Costt_14,$Costt_15,$Costt_16,$Costt_17, $Costt_18,$Costt_19,$Costt_20,$Costt_21,$Costt_22,$Costt_23,$Costt_24,$Costt_25, $Costt_26 , $Costt_27, $Costt_28, $Costt_29, $Costt_30, $Costt_salary,$Costt_to,$Costt_total,$Flag)
{
global $conn;
$strsql = "INSERT INTO salary_repot_tb(Teacher_code,Teacher_id,StatusId,Faculty_code,Person_type,Start_mont,Start_year,Salary_1,Salary_2,Salary_3,Costt_1,Costt_2,Costt_3,Costt_4,Costt_5,Costt_6,Costt_7,Costt_8,Costt_9,Costt_10,Costt_11,Costt_12,Costt_13,Costt_14,Costt_15,Costt_16,Costt_17,Costt_18,Costt_19,Costt_20,Costt_21,Costt_22,Costt_23,Costt_24,Costt_25, Costt_26 , Costt_27, Costt_28, Costt_29,Costt_30,Costt_salary,Costt_to,Costt_total,Flag)";
$strsql =
$strsql. "VALUES ('$Teacher_code','$Teacher_id','$StatusId','$Faculty_code','$Person_type','$Start_mont','$Start_year','$Salary_1','$Salary_2','$Salary_3','$Costt_1','$Costt_2','$Costt_3','$Costt_4','$Costt_5','$Costt_6','$Costt_7',' $Costt_8','$Costt_9','$Costt_10','$Costt_11','$Costt_12','$Costt_13','$Costt_14','$Costt_15','$Costt_16','$Costt_17','$Costt_18','$Costt_19','$Costt_20','$Costt_21','$Costt_22','$Costt_23','$Costt_24','$Costt_25','$Costt_26' , '$Costt_27', '$Costt_28', '$Costt_29','$Costt_30','$Costt_salary','$Costt_to','$Costt_total','$Flag')";
mysql_query($strsql) or die("$strSQL INSERT HAS INCORRECT $result $sql".mysql_error());
}
////////////////////// Insert Personal Research ////////////////////
function InsertResearch($Teacher_code,$Branch,$Research_name,$Research_type,$Research_char,$R_position,$Research_st,$Filetex,$name1,$name2,$name3,$name4,$name5,$name6,$name7,$name8, $Year_start,$Year_finish,$Fund,$FundIn,$FundOut,$FundUse,$Fund_resourceIn,$Fund_resourceOut,$Resource_des,$Propagate,$Propagate_des, $Prop_type,$Prop_type1,$Prop_type2,$Prop_type3,$Apply1,$Apply2,$Apply3, $Apply4,$Apply_des,$Year_sprop,$Year_prop,$abbStract,$r_type,$academic_year,$fiscal_year,$academic_year_finish,$fiscal_year_finish)
{
global $conn;
$sql = "INSERT INTO research_tb (Teacher_code,Branch,Research_name,Research_type,Research_char,R_position,Research_st,Filetex,name1,name2,name3,name4,name5,name6,name7,name8,Year_start,Year_finish,Fund,FundIn,FundOut,FundUse,Fund_resourceIn,Fund_resourceOut,Resource_des,Propagate,Propagate_des,Prop_type,Prop_type1,Prop_type2,Prop_type3,Apply1,Apply2,Apply3,Apply4,Apply_des,Year_sprop,Year_prop,abbStract,r_type,academic_year,fiscal_year,academic_year_finish,fiscal_year_finish)";
$sql = $sql."VALUES('$Teacher_code','$Branch','$Research_name','$Research_type','$Research_char','$R_position','$Research_st','$Filetex','$name1','$name2','$name3','$name4','$name5','$name6','$name7','$name8','$Year_start','$Year_finish','$Fund','$FundIn','$FundOut','$FundUse','$Fund_resourceIn','$Fund_resourceOut','$Resource_des','$Propagate','$Propagate_des','$Prop_type','$Prop_type1','$Prop_type2','$Prop_type3','$Apply1','$Apply2','$Apply3','$Apply4','$Apply_des','$Year_sprop','$Year_prop','$abbStract','$r_type','$academic_year','$fiscal_year','$academic_year_finish','$fiscal_year_finish')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
//////////////// InsertProject_edu ///////////////////
function InsertProject_edu( $Code_no , $Project_code , $First_name , $Name , $Last_name , $Class , $Addname , $citizenId , $Work , $Addwork , $Room , $Amount , $Program , $Program_1 , $Program_2 , $Program_3 , $Program_4 , $Program_5 , $Teacher_code , $Faculty_code , $Foot , $programId , $collegeCode , $Code , $Age , $Sex , $Address , $Amper , $ProvinceId , $Img1 , $Zipcode , $Email , $Phone , $Education , $Education_1 , $Education_2 , $Detail , $Flag )
{
global $conn;
$sql = " INSERT INTO persnal_project_tb( Code_no , Project_code , First_name , Name , Last_name , Class , Addname , citizenId , Work , Addwork , Room , Amount , Program , Program_1 , Program_2 , Program_3 , Program_4 , Program_5 , Teacher_code , Faculty_code , Foot , programId , collegeCode , Code , Age , Sex , Address , Amper , ProvinceId , Img1 , Zipcode , Email , Phone , Education , Education_1 , Education_2 , Detail , Flag ) ";
$sql .= " VALUES( '$Code_no' , '$Project_code' , '$First_name' , '$Name' , '$Last_name' , '$Class' , '$Addname' , '$citizenId' , '$Work' , '$Addwork' , '$Room' , '$Amount' , '$Program' , '$Program_1' , '$Program_2' , '$Program_3' , '$Program_4' , '$Program_5' , '$Teacher_code' , '$Faculty_code' , '$Foot' , '$programId' , '$collegeCode' , '$Code' , '$Age' , '$Sex' , '$Address' , '$Amper' , '$ProvinceId' , '$Img1' , '$Zipcode' , '$Email' , '$Phone' , '$Education' , '$Education_1' , '$Education_2' , '$Detail' , '$Flag' ) ";
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
/////////// ตารางแผนดำนเนิการ projectStdPlan ///////////
function InsertProjectStd($Teacher_code,$Faculty_code,$Orderlist_2,$Orderlist,$Project_plan, $Project_name, $Project_rep,$Period,$Period_1,$Budget_Year)
{
global $conn;
$sql = "INSERT INTO projectStdPlan_tb ( Teacher_code,Faculty_code,Orderlist_2,Orderlist,Project_plan,Project_name,Project_rep,Period,Period_1,Budget_Year)";
$sql = $sql. " VALUES('$Teacher_code','$Faculty_code','$Orderlist_2','$Orderlist','$Project_plan','$Project_name','$Project_rep','$Period','$Period_1','$Budget_Year') " ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
//////////////////////// Eduction Project //////////////////
function InsertEdu_Project($Project_name,$Addwork,$Project_desc,$Period,$Start_Date,$Supervisor,$Term, $Faculty_code,$Budget_Year,$Budget,$Budget_use,$Percent_ans,$Result_oper,$Dif_result,$Flag)
{
global $conn;
$sql = "INSERT INTO edu_project_tb (Project_name,Addwork,Project_desc,Period,Start_Date,Supervisor,Term,Faculty_code,Budget_Year,Budget,Budget_use,Percent_ans,Result_oper,Dif_result,Flag)";
$sql = $sql."VALUES('$Project_name','$Addwork','$Project_desc','$Period','$Start_Date','$Supervisor','$Term','$Faculty_code','$Budget_Year','$Budget','$Budget_use','$Percent_ans','$Result_oper','$Dif_result','$Flag')";
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
//////////////////////// Insert Ptoject /////////////////
function
InsertProject ($Training_code,$Project_code,$ProjectId,$MoneyId,$MoneyS_C,$Faculty_code,$Teacher_code,$Ind,$Orderlist,$Project_plan,$Training_name,$Date,$Budget_use,$Spending_use, $programId,$Budget_Year,$Year,$date_updated)
{
global $conn;
$sql = "INSERT INTO project_tb (Training_code,Project_code,ProjectId,MoneyId,MoneyS_C,Faculty_code,Teacher_code,Ind,Orderlist,Project_plan,Training_name,Date,Budget_use, Spending_use, programId,Budget_Year,Year,date_updated )";
$sql = $sql."VALUES('$Training_code','$Project_code','$ProjectId','$MoneyId','$MoneyS_C','$Faculty_code','$Teacher_code','$Ind','$Orderlist','$Project_plan','$Training_name','$Date','$Budget_use','$Spending_use','$programId','$Budget_Year','$Year',NOW() )";
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
/////////////////// InsertProjectName ///////////
function
InsertProjectName($Project_code,$Faculty_code,$Teacher_code,$Orderlist_2,$Orderlist,$Project_plan,$Project_name,$Project_rep,$MoneyS_C,$Period,$Period_1,$Date_start ,$Date_finish,$Budget_Year,$Budget_use,$January,$February,$March,$April,$May,$June,$July,$Augus,$September,$October,$November,$December)
{
global $conn;
$sql = "INSERT INTO project_type_tb (Project_code,Faculty_code,Teacher_code,Orderlist_2,Orderlist,Project_plan,Project_name, Project_rep,MoneyS_C,Period,Period_1,Date_start,Date_finish,Budget_Year,Budget_use,January,February,March,April,May,June,July,Augus,September, October,November,December)";
$sql = $sql. "VALUES('$Project_code','$Faculty_code','$Teacher_code','$Orderlist_2','$Orderlist','$Project_plan','$Project_name',' $Project_rep','$MoneyS_C','$Period','$Period_1','$Date_start','$Date_finish','$Budget_Year','$Budget_use','$January','$February','$March','$April','$May','$June','$July','$Augus','$September','$October','$November','$December')";
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
////////////// Insert User ///////
function InsertUser( $Teacher_code, $Username, $Password, $PasswordR, $Priority, $Flag, $date_create )
{
global $conn;
$sql = " INSERT INTO user_tb ( Teacher_code, Username, Password, PasswordR, Priority, Flag, date_create ) ";
$sql .= " VALUES ( '$Teacher_code', '$Username', '$Password', '$PasswordR', '$Priority', '$Flag', NOW() )" ;
mysql_query($sql) or die( "$sql Insert has incorrect" .mysql_error() );
}
////////////////////// insert Decoration 's teacher
function InsertDecoration( $Decoration_name , $Teacher_code , $Year_receive , $Volumn , $Col , $Page , $Orderlist )
{
global $conn;
$sql = " INSERT INTO history_decoration_tb ( Decoration_name , Teacher_code, Year_receive , Volumn , Col , Page , Orderlist ) ";
$sql .= " VALUES ( '$Decoration_name' , '$Teacher_code' , '$Year_receive' , '$Volumn' , '$Col' , '$Page' , '$Orderlist' ) ";
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
/////////////////// InserAbsent ////////////////////////////////
function
InsertAbsent( $Absent_code , $Year , $Absent_type , $Teacher_code , $Absent_times ,$Times_total , $Times_sum, $Date, $Date_start , $Date_finish , $Address ,$Status, $AbsentNo, $date_added )
{
global $conn;
$sql = "INSERT INTO history_absent_tb (Absent_code,Year,Absent_type,Teacher_code,Absent_times,Times_total ,Times_sum,Date, Date_start,Date_finish,Address , Status, AbsentNo ,date_added )";
$sql = $sql."VALUES('$Absent_code','$Year','$Absent_type','$Teacher_code','$Absent_times','$Times_total' ,'$Times_sum','$Date','$Date_start','$Date_finish','$Address','$Status','$AbsentNo', NOW() )" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
/////////////////// InserAddAbsent ////////////////////////////////
function InsertAddAbsent( $Teacher_code , $Absent_code , $Absent_times , $Year )
{
global $conn;
$sql = " INSERT INTO history_absent ( Teacher_code , Absent_code , Absent_times , Year ) ";
$sql .= " VALUES ('$Teacher_code' , '$Absent_code' , '$Absent_times' , '$Year' ) " ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
////////////// Insert Course ////////////////////////
function InsertCourse( $Course_id , $Course_name , $Course_nameE , $Degree_Thai , $Short_Thai , $Degree_Eng , $Short_Eng , $Course_type , $TotalUnit , $Term , $Spec , $Affect_class , $Course_desc )
{
global $conn;
$sql = " INSERT INTO course_tb ( Course_id , Course_name , Course_nameE , Degree_Thai , Short_Thai , Degree_Eng , Short_Eng , Course_type , TotalUnit , Term , Spec , Affect_class , Course_desc ) ";
$sql .= " VALUES( '$Course_id' , '$Course_name' , '$Course_nameE' , '$Degree_Thai' , '$Short_Thai' , '$Degree_Eng' , '$Short_Eng' , '$Course_type' , '$TotalUnit' , '$Term' , '$Spec' , '$Affect_class' , '$Course_desc' ) " ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
////////////// Insert Subject ////////////////////////
function InsertSubject($Course_code,$SubCate_code,$Subject_group,$Subject_code,$Subject_name,$Unit,$Term,$Class_level,$Total_hour,$Objective,$Detail,$Class_Affect,$Affect_sub)
{
global $conn;
$sql = "INSERT INTO subject_tb (Course_code,SubCate_code,Subject_group,Subject_code,Subject_name,Unit,Term,Class_level,Total_hour,Objective,Detail,Class_Affect,Affect_sub)";
$sql = $sql."VALUES('$Course_code','$SubCate_code','$Subject_group','$Subject_code','$Subject_name','$Unit','$Term','$Class_level','$Total_hour','$Object','$Detail','Class_Affect','$Affect_sub')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
//////////////////// Update Degree Count
function UpdateDegree($Degree_code)
{
global $conn;
$strSQL ="UPDATE degreetb";
$strSQL .=" SET Rate=Rate+1";
$strSQL .=" WHERE Degree_code = $Degree_code";
mysql_query( $strSQL) or die("update error".mysql_error());
}
/////////////////////// Insert Training /////////////////////*/
function
InsertTraining ($Teacher_code,$Training_name,$Period_code,$Training_type,$Training_std,$Day,$Major,$Year_std,$Place,$Place_des,$Date_start,$Date_finish, $Total_hour,$Fund,$Budget_use,$Fund_resource, $Organiz, $CNEU, $Date_send,$Period_prop,$Apply,$date_updated)
{
global $conn;
$sql = " INSERT INTO training_tb ( Teacher_code , Training_name , Period_code , Training_type , Training_std, Day , Major , Year_std , Place , Place_des , Date_start , Date_finish , Total_hour , Fund ,Budget_use, Fund_resource , Organiz , CNEU , Date_send , Period_prop , Apply,date_updated ) ";
$sql .= " VALUES ( '$Teacher_code' , '$Training_name' , '$Period_code', '$Training_type' , '$Training_std', '$Day' , '$Major' , '$Year_std' , '$Place' , '$Place_des' , '$Date_start' , '$Date_finish' , '$Total_hour' , '$Fund' , '$Budget_use','$Fund_resource' , '$Organiz' , '$CNEU' ,'$Date_send' , '$Period_prop' , '$Apply' ,NOW() )" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
/////////////// Insert Media /////
function InsertMedia ( $Media_name , $Media_type , $Unit , $Producer )
{
global $conn;
$sql = " INSERT INTO mediatb ( Media_name , Media_type , Unit , Producer ) ";
$sql .= " VALUES( '$Media_name' , '$Media_type' , '$Unit' , '$Producer' ) " ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
//////////// Insert Information to Home Page
function InsertInfo($Info_name,$Date,$Info_detail,$Organiz,$Supervisor,$Flag)
{
global $conn;
$sql = "INSERT INTO information_tb (Info_name,Date,Info_detail,Organiz,Supervisor,Flag)";
$sql = $sql."VALUES('$Info_name','$Date','$Info_detail','$Organiz','$Supervisor','$Flag')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
//////////// InsertComment /////////////////
function InsertComment($Info_name,$Info_detail,$Organiz,$Supervisor,$IP,$Date)
{
global $conn;
$sql = "INSERT INTO comment_tb (Info_name,Info_detail,Organiz,Supervisor,IP,Date)";
$sql = $sql."VALUES('$Info_name','$Info_detail','$Organiz','$Supervisor','$IP',NOW() )" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
/////////////// Insert Production //////////////////
function InsertProduct($Teacher_code,$Product_name,$Date_start,$Date_finish,$Term,$Year_prop, $Product_type,$name1,$name2,$name3,$name4,$name5,$name6,$name7,$Fund_resource,$Fund,$Propagate,$Benefit,$Use_ref,$Filetex)
{
global $conn;
$sql = "INSERT INTO edu_product_tb (Teacher_code,Product_name,Date_start,Date_finish,Term,Year_prop,Product_type,name1,name2,name3,name4,name5,name6,name7,Fund_resource,Fund,Propagate,Benefit,Use_ref,Filetex)";
$sql = $sql."VALUES('$Teacher_code','$Product_name','$Date_start','$Date_finish','$Term','$Year_prop','$Product_type','$name1','$name2','$name3','$name4','$name5','$name6','$name7','$Fund_resource','$Fund','$Propagate','$Benefit','$Use_ref','$Filetex')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
//*-----ตารางการแจ้งซ่อม--------*///////
function
InsertDura($Date,$Faculty_code,$Acc_name,$Acc_type_code,$AccId ,$Acc_code,$Room_code,$Room_name,$Fix_History,$Store,$DetailDura,$DetailDura_name,$Detail,$Detail_name,$Status,$Budget_year,$Teacher_code,$DuraNo,$durableCode, $add_updated)
{
global $conn;
$sql = "INSERT INTO durable_tb ( Date,Faculty_code,Acc_name,Acc_type_code, AccId ,Acc_code,Room_code,Room_name,Fix_History,Store,DetailDura,DetailDura_name,Detail,Detail_name,Status,Budget_year,Teacher_code,DuraNo,durableCode,add_updated)";
$sql = $sql."VALUES('$Date','$Faculty_code','$Acc_name','$Acc_type_code','$AccId ','$Acc_code','$Room_code','$Room_name','$Fix_History','$Store','$DetailDura','$DetailDura_name','$Detail','$Detail_name','$Status','$Budget_year','$Teacher_code','$DuraNo','$durableCode',NOW() )" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
/////////////// Insert Teacher List //////////////////
function InsertTeacherList($Teacher_id,$Status,$Teacher_name,$Teacher_lastname)
{
global $conn;
$sql = "INSERT INTO accounttb (Teacher_id,Status,Teacher_name,Teacher_lastname)";
$sql = $sql."VALUES('$Teacher_id','$Status','$Teacher_name','$Teacher_lastname')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
//////////////// Insert Seminar //////////////
function InsertSeminar($Seminar_code,$Department,$Times,$Year,$Date,$Topic_no,$Topic,$Conclude,$Name)
{
global $conn;
$sql = "INSERT INTO seminartb (Seminar_code,Department,Times,Year,Date,Topic_no,Topic,Conclude,Name)";
$sql = $sql."VALUES('$Seminar_code','$Department','$Times','$Year','$Date','$Topic_no','$Topic','$Conclude','$Name')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
/////////////////////
function InsertStdUnit($Course_code,$Yearcome,$Maleunit,$Femaleunit,$Totalunit)
{
global $conn;
$sql = "INSERT INTO studentunittb (Course_code,Yearcome,Maleunit,Femaleunit,Totalunit)";
$sql = $sql."VALUES('$Course_code','$Yearcome','$Maleunit','$Femaleunit','$Totalunit')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
///////////////////////// ตารางอาคาร /////////////////
function
InsertBuilding($BuildD_ID,$Build_name,$Build_type,$Img1,$Short_name,$Class_unit,$Room_unit,$BuildD_Yr ,$BuildD_Pr,$MoneyS_C,$Description)
{
global $conn;
$sql = "INSERT INTO building_tb (BuildD_ID,Build_name,Build_type,Img1,Short_name,Class_unit,Room_unit,BuildD_Yr ,BuildD_Pr,MoneyS_C,Description)";
$sql = $sql."VALUES('$BuildD_ID','$Build_name','$Build_type','$Img1','$Short_name','$Class_unit','$Room_unit','$BuildD_Yr ','$BuildD_Pr','$MoneyS_C','$Description')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
///////////////////////// Document_tb /////////////////
function
InsertDocument($Docom_name,$conditionId,$Img1)
{
global $conn;
$sql = "INSERT INTO Document_tb (Docom_name,conditionId,Img1)";
$sql = $sql."VALUES('$Docom_name','$conditionId','$Img1')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
/////////////////// Insert Eech room to Building///////////////
function InsertRoom($BuildD_No,$Room_type,$Room_code,$Room_name,$Size,$Area,$Img1,$Eletric_meter)
{
global $conn;
$sql = "INSERT INTO room_tb (BuildD_No,Room_type,Room_code,Room_name,Size,Area,Img1,Eletric_meter)";
$sql = $sql."VALUES('$BuildD_No','$Room_type','$Room_code','$Room_name','$Size','$Area','$Img1','$Eletric_meter')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
////////////////////////////////////////////////////////
function Update_Room_Unit($BuildD_No)
{
$strSQL ="UPDATE building_tb";
$strSQL .=" SET Room_unit=Room_unit+1";
$strSQL .=" WHERE BuildD_No = $BuildD_No";
mysql_query( $strSQL) or die("update error".mysql_error());
}
//////////////////////////////////////////////////////////// InsertInstructor //////
function
InsertInstructor($First_name,$Name,$Lastname,$Sex,$Status,$Degree,$Exper,$Skill,$Img1,$Addr_work,$Addr_home,$Tel,$Email)
{
$sql = "INSERT INTO instructor_tb (First_name,Name,Lastname,Sex,Status,Degree,Exper,Skill,Img1,Addr_work,Addr_home,Tel,Email)";
$sql = $sql."VALUES('$First_name','$Name','$Lastname','$Sex','$Status','$Degree','$Exper','$Skill','$Img1','$Addr_work','$Addr_home','$Tel','$Email')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
//////////////////////// insert magazine to database//////////
function InsertMag($Magazine_name,$Magazine_type,$Ex_article,$Author,$Vol,$Year,$Month)
{
$sql = "INSERT INTO magazine_tb (Magazine_name,Magazine_type,Ex_article,Author,Vol,Year,Month)";
$sql = $sql."VALUES ('$Magazine_name','$Magazine_type','$Ex_article','$Author','$Vol','$Year','$Month')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
//////////////////////// insert Activity to database//////////
function InsertActivity ($Activity_name,$Activity_type,$Perform,$Activity,$Period,$Budget,$Budget_use,$Dif_result, $Source,$Target,$Amount,$Supervisor,$Duty,$Objective,$Index_mature,$Affect_class, $Ec41_1,$Ec41_2 ,$Ec41_3,$Ec41_4,$Ec41_5,$Ec41_6,$Ec41_7,$Ec41_8,$Ec41_9,$Ec41_10,$Ec41_11,$Ec42_1, $Ec42_2,$Ec42_3,$Ec42_4,$Ec42_5,$Ec42_6,$Ec42_7,$Ec42_8,$Ec42_9,$Ec42_10, $Ec42_11,$Ec42_12,$Ec42_13,$Ec42_14,$Ec42_15,$Ec43_1,$Ec43_2,$Ec43_3,$Ec43_4,$Ec43_5, $Ec43_6,$Ec43_7,$Ec43_8,$Ec43_9,$Ec43_10,$Ec44_1,$Ec44_2,$Ec44_3,$Ec44_4,$Ec44_5, $Ec44_6,$Ec44_7,$Ec44_8,$Ec44_9,$Ec44_10,$Ec44_11,$Ec44_12,$Ec44_13,$Ec44_14,$Ec44_15,$Result_oper)
{
$sql = "INSERT INTO std_activity_tb (Activity_name,Activity_type,Perform,Activity,Period,Budget,Budget_use,Dif_result,Source,Target,Amount,Supervisor,Duty,Objective,Index_mature,Affect_class,Ec41_1,Ec41_2 ,Ec41_3,Ec41_4,Ec41_5,Ec41_6,Ec41_7,Ec41_8,Ec41_9,Ec41_10,Ec41_11,Ec42_1,Ec42_2,Ec42_3,Ec42_4,Ec42_5,Ec42_6,Ec42_7,Ec42_8,Ec42_9,Ec42_10,Ec42_11,Ec42_12,Ec42_13,Ec42_14,Ec42_15,Ec43_1,Ec43_2,Ec43_3,Ec43_4,Ec43_5,Ec43_6,Ec43_7,Ec43_8,Ec43_9,Ec43_10,Ec44_1,Ec44_2,Ec44_3,Ec44_4,Ec44_5,Ec44_6,Ec44_7,Ec44_8,Ec44_9,Ec44_10,Ec44_11,Ec44_12,Ec44_13,Ec44_14,Ec44_15,Result_oper)";
$sql = $sql."VALUES ('$Activity_name','$Activity_type','$Perform','$Activity','$Period','$Budget','$Budget_use','$Dif_result','$Source','$Target','$Amount','$Supervisor','$Duty','$Objective','$Index_mature','$Affect_class','$Ec41_1','$Ec41_2','$Ec41_3','$Ec41_4','$Ec41_5','$Ec41_6','$Ec41_7','$Ec41_8','$Ec41_9','$Ec41_10','$Ec41_11','$Ec42_1','$Ec42_2','$Ec42_3','$Ec42_4','$Ec42_5','$Ec42_6','$Ec42_7','$Ec42_8','$Ec42_9','$Ec42_10','$Ec42_11','$Ec42_12','$Ec42_13','$Ec42_14','$Ec42_15','$Ec43_1','$Ec43_2','$Ec43_3','$Ec43_4','$Ec43_5','$Ec43_6','$Ec43_7','$Ec43_8','$Ec43_9','$Ec43_10','$Ec44_1','$Ec44_2','$Ec44_3','$Ec44_4','$Ec44_5','$Ec44_6','$Ec44_7','$Ec44_8','$Ec44_9','$Ec44_10','$Ec44_11','$Ec44_12','$Ec44_13','$Ec44_14','$Ec44_15','$Result_oper')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
/////////////////////// insert Scholarship //////////////////
function InsertScho($Scholarship_name,$Scholarship_type,$Source,$Fund,$Period)
{
$sql = "INSERT INTO scholarship_tb (Scholarship_name,Scholarship_type,Source,Fund,Period)";
$sql = $sql."VALUES ('$Scholarship_name','$Scholarship_type','$Source','$Fund','$Period')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
////////////////---- Insert Student Data ---////// First_name Name Lastname Sex BirthDate Religion Address
function InsertStudent ($Course_code,$ProvinceId,$Class,$Orderlist,$Student_id,$First_name,$Name,$Lastname,$Sex,$DateBirth, $Religion,$Address,$Img1,$Father_name,$Mother_name,$Address2,$Telno,$Pre_inst,$Pre_gpa, $Select_Method,$Term,$Date_in,$Institute,$Teacher_code,$Affect_class,$Scholarship_code, $Address_cur,$Coll_in,$Coll_out,$Circle_duty,$Circle,$Succ_Status)
{
$sql = "INSERT INTO student_tb (Course_code,ProvinceId,Class,Orderlist,Student_id,First_name,Name,Lastname,Sex,DateBirth,Religion,Address,Img1,Father_name,Mother_name,Address2,Telno,Pre_inst,Pre_gpa,Select_Method,Term,Date_in,Institute,Teacher_code,Affect_class,Scholarship_code,Address_cur,Coll_in,Coll_out,Circle_duty,Circle,Succ_Status)";
$sql = $sql."VALUES ('$Course_code','$ProvinceId','$Class','$Orderlist','$Student_id','$First_name','$Name','$Lastname','$Sex','$DateBirth','$Religion','$Address','$Img1','$Father_name','$Mother_name','$Address2','$Telno','$Pre_inst','$Pre_gpa','$Select_Method','$Term','$Date_in','$Institute','$Teacher_code','$Affect_class','$Scholarship_code','$Address_cur','$Coll_in','$Coll_out','$Circle_duty','$Circle','$Succ_Status')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
//////////////////////// Record Opinion 's Employer
function InsertEmployer ($Term,$Course_code,$Series,$x1,$x2,$x3,$x4,$x5,$x6,$x7,$x8,$x9,$x10,$x11,$x12,$x13,$sd1,$sd2,$sd3,$sd4,$sd5,$sd6,$sd7,$sd8,$sd9,$sd10,$sd11,$sd12,$sd13,$rate1,$rate2,$rate3,$rate4,$rate5,$rate6,$rate7,$rate8,$rate9,$rate10,$rate11,$rate12,$rate13)
{
$sql = "INSERT INTO std_employer_tb (Term,Course_code,Series,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,sd1,sd2,sd3,sd4,sd5,sd6,sd7,sd8,sd9,sd10,sd11,sd12,sd13,rate1,rate2,rate3,rate4,rate5,rate6,rate7,rate8,rate9,rate10,rate11,rate12,rate13)";
$sql = $sql."VALUES ('$Term','$Course_code','$Series','$x1','$x2','$x3','$x4','$x5','$x6','$x7','$x8','$x9','$x10','$x11','$x12','$x13','$sd1','$sd2','$sd3','$sd4','$sd5','$sd6','$sd7','$sd8','$sd9','$sd10','$sd11','$sd12','$sd13','$rate1','$rate2','$rate3','$rate4','$rate5','$rate6','$rate7','$rate8','$rate9','$rate10','$rate11','$rate12','$rate13')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
////////////////////// Record Graduate 's Student ///////////
function InsertStdSucc ($Student_id,$Year_grad,$Pass_test,$Times,$Past_test,$Place,$Work_addr,$Work_place,$Contact_addr,$Work_status,$Position,$Level,$Depart_name,$Depart,$Date_w1, $Date_w11,$Date_w2,$Date_w22,$Date_w3,$Date_w33,$Work_change,$Income_m,$Income_y, $Status,$Learn_flag,$Degree1,$Degree2,$Award_in,$Award_out)
{
$sql = "INSERT INTO std_success_tb (Student_id,Year_grad,Pass_test,Times,Past_test,Place,Work_addr,Work_place,Contact_addr,Work_status,Position,Level,Depart_name,Depart,Date_w1,Date_w11,Date_w2,Date_w22,Date_w3,Date_w33,Work_change,Income_m,Income_y,Status,Learn_flag,Degree1,Degree2,Award_in,Award_out)";
$sql = $sql."VALUES ('$Student_id','$Year_grad','$Pass_test','$Times','$Past_test','$Place','$Work_addr','$Work_place','$Contact_addr','$Work_status','$Position','$Level','$Depart_name','$Depart','$Date_w1','$Date_w11','$Date_w2','$Date_w22','$Date_w3','$Date_w33','$Work_change','$Income_m','$Income_y','$Status','$Learn_flag','$Degree1','$Degree2','$Award_in','$Award_out')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
////////////////////////// ตารางบันทึกปัญหานักศึกษา/////////////////
function InsertProb($Problem,$officerId1,$studentCode,$prefixId,$studentName,$studentSurname,$Prob1,$Prob2,$Prob3,$Prob4,$Prob_detail1,$Prob_detail2, $Prob_detail3,$Prob_detail4,$Recom,$Date_meet,$Unit_meet)
{
$sql = "INSERT INTO advice_problem_tb (Problem,officerId1,studentCode,prefixId,studentName,studentSurname,Prob1,Prob2,Prob3,Prob4,Prob_detail1,Prob_detail2,Prob_detail3,Prob_detail4,Recom,Date_meet,Unit_meet)";
$sql = $sql."VALUES ('$Problem','$officerId1','$studentCode','$prefixId','$studentName','$studentSurname','$Prob1','$Prob2','$Prob3','$Prob4','$Prob_detail1','$Prob_detail2','$Prob_detail3','$Prob_detail4','$Recom','$Date_meet','$Unit_meet')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
//////////////// Insert Subject Group
function InsertSubject_group($SubCate_code,$Eng_name,$Short_name,$Thai_name,$Description)
{
$sql = "INSERT INTO subject_group_tb (SubCate_code,Eng_name,Short_name,Thai_name,Description)";
$sql = $sql."VALUES ('$SubCate_code','$Eng_name','$Short_name','$Thai_name','$Description')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
////////////// Insert Subject Category
function InsertSubject_cate($Cate_name,$Cate_nameE)
{
$sql = "INSERT INTO subject_category_tb (Cate_name,Cate_nameE)";
$sql = $sql."VALUES ('$Cate_name','$Cate_nameE')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
////////////// Insert Faculty
function InsertFaculty($Faculty_name,$Faculty_nameE)
{
$sql = "INSERT INTO faculty_tb (Faculty_name,Faculty_nameE)";
$sql = $sql."VALUES ('$Faculty_name','$Faculty_nameE')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
////////////// Insert Faculty
function InsertSubCate($Cate_name,$Cate_nameE)
{
$sql = "INSERT INTO subject_category_tb (Cate_name,Cate_nameE)";
$sql = $sql."VALUES ('$Cate_name','$Cate_nameE')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
////////////// Insert Pi -CRI For QA Topic and Detail
function InsertPi_Cri($code,$Stand_code,$Ind_code,$Indicate,$Source,$IncFor,$Awa,$Att,$Ach1,$Ach2,$Ach3,$Ach4,$E_awa,$E_att,$E_ach1,$E_ach2)
{
$sql = "INSERT INTO qa_pi_cri_tb (code,Stand_code,Ind_code,Indicate,Source,IncFor,Awa,Att,Ach1,Ach2,Ach3,Ach4,E_awa,E_att,E_ach1,E_ach2)";
$sql = $sql."VALUES ('$code','$Stand_code','$Ind_code','$Indicate','$Source','$IncFor','$Awa','$Att','$Ach1','$Ach2','$Ach3','$Ach4','$E_awa','$E_att','$E_ach1','$E_ach2')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
////////////// Insert Method teach Plan and Specification Teah Plan
function InsertPlan ( $Teacher_code, $acadYear, $semester, $programId , $courseCode, $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,$Filetex )
{
global $conn;
$sql = " INSERT INTO tech_plan_tb (Teacher_code , acadYear, semester, programId , courseCode, 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 ,Filetex, date_updated ) ";
$sql .= " VALUES ('$Teacher_code' , '$acadYear','$semester', '$programId' , '$courseCode', '$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','$Filetex', NOW() ) " ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
/*////////////////////////////////////////////////////////////////////////*/
function 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 )
{
$sql = " INSERT INTO techplan_method_tb ( 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 , date_added )";
$sql .= " VALUES ( '$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' , NOW() ) " ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
/*/////////////////////////////// tech_spec_tb /////////////////////////////////////////*/
function
InsertSpt($Plan_code , $Teacher_code , $courseId , $Sp1 , $Sp2 , $Sp3 , $Sp4 , $Sp5 , $Sp6 , $Sp7 , $Sp8 , $Sp9 , $Sp10)
{
$sql = " INSERT INTO tech_spec_tb ( Plan_code , Teacher_code , courseId , Sp1 , Sp2 , Sp3 , Sp4 , Sp5 , Sp6 , Sp7 , Sp8 , Sp9 , Sp10 , date_added ) ";
$sql .= " VALUES( '$Plan_code' , '$Teacher_code' , '$courseId' , '$Sp1' , '$Sp2' , '$Sp3' , '$Sp4' , '$Sp5' , '$Sp6' , '$Sp7' , '$Sp8' , '$Sp9' , '$Sp10' , NOW() ) ";
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
/*/////////////////////////////// tech_text_tb /////////////////////////////////////////*/
function
InsertFiletex( $Plan_code , $Teacher_code , $courseId , $Filename , $Plan_title , $Plan_atty, $Plan_resou, $Plan_stiti, $Date, $Total_now, $Total_time, $Filetex )
{
$sql = " INSERT INTO tech_text_tb (Plan_code ,Teacher_code , courseId , Filename , Plan_title , Plan_atty,Plan_resou,Plan_stiti, Date, Total_now, Total_time, Filetex , date_updated ) ";
$sql .= " VALUES( '$Plan_code' , '$Teacher_code' , '$courseId' , '$Filename' , '$Plan_title' , '$Plan_atty','$Plan_resou', '$Plan_stiti', '$Date', '$Total_now','$Total_time','$Filetex' , NOW() ) ";
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
//////////////////////////////////// InsertMan /////////
function InsertMan($Acc_code,$Teacher_code,$Student_id,$Acc_name,$Store,$Img1,$Fix_History, $Contact, $Date_buy, $Date_year,$Price,$Fix_budget,$Status,$Status_1,$Statistic,$Description)
{
$sql = "INSERT INTO manament_tb (Acc_code,Teacher_code,Student_id,Acc_name,Store,Img1,Fix_History,Contact,Date_buy,Date_year,Price,Fix_budget,Status,Status_1,Statistic,Description)";
$sql = $sql."VALUES ('$Acc_code','$Teacher_code','$Student_id','$Acc_name','$Store','$Img1','$Fix_History','$Contact','$Date_buy','$Date_year','$Price','$Fix_budget','$Status','$Status_1','$Statistic','$Description')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
//////////////////////////////////// InsertManage /////////
function
InsertManage($Acc_code,$Teacher_code,$Student_id,$Acc_name,$Store,$Img1,$Fix_History, $Contact, $Date_buy, $Date_year,$Price,$Fix_budget,$Status,$Status_1,$Statistic,$Description)
{
$sql = "INSERT INTO manage_tb (Acc_code,Teacher_code,Student_id,Acc_name,Store,Img1,Fix_History,Contact,Date_buy,Date_year,Price,Fix_budget,Status,Status_1,Statistic,Description)";
$sql = $sql."VALUES ('$Acc_code','$Teacher_code','$Student_id','$Acc_name','$Store','$Img1','$Fix_History','$Contact','$Date_buy','$Date_year','$Price','$Fix_budget','$Status','$Status_1','$Statistic','$Description')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
// //////////// InserBook ///////////
function
InsertBook($Book_code,$Year,$No,$No_in,$conditionId,$Status,$Store_1,$Faculty_code,$Date_buy,$Description,$Img1)
{
$sql = "INSERT INTO bookmant_tb (Book_code,Year,No,No_in,conditionId,Status,Store_1,Faculty_code,Date_buy,Description,Img1)";
$sql = $sql."VALUES ('$Book_code','$Year','$No','$No_in','$conditionId','$Status','$Store_1','$Faculty_code','$Date_buy','$Description','$Img1')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
// //////////// InserPerson ///////////
function
InsertPerson($code,$Teacher_code,$No,$No_in,$Date_buy,$Faculty_code,$Year,$Statistic,$Description)
{
$sql = "INSERT INTO bookPerson_tb (code,Teacher_code,No,No_in,Date_buy,Faculty_code,Year,Statistic,Description)";
$sql = $sql."VALUES ('$code','$Teacher_code','$No','$No_in','$Date_buy','$Faculty_code','$Year','$Statistic','$Description')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
/////////////////// InsertAcc ////////
function
InsertAcc($Dura, $Acc_code,$Acc_no,$Acc_name,$Acc_module,$Acc_type_code,$MoneyS_C, $Fix_detail, $Date_buy, $Date_finish, $Year, $Price, $Fund , $Faculty_code, $RoomId ,$Statistic, $In_document ,$Price_document , $Modify_detail , $Modify_document , $Name , $Address, $Phone, $Img1,$date_updated)
{
$sql = "INSERT INTO accessories_tb (Dura, Acc_code,Acc_no, Acc_name, Acc_module, Acc_type_code, MoneyS_C, Fix_detail, Date_buy, Date_finish, Year, Price, Fund , Faculty_code, RoomId ,Statistic, In_document , Price_document , Modify_detail , Modify_document, Name ,Address, Phone, Img1, date_updated)";
$sql = $sql."VALUES ('$Dura', '$Acc_code','$Acc_no','$Acc_name','$Acc_module','$Acc_type_code','$MoneyS_C','$Fix_detail','$Date_buy',' $Date_finish','$Year','$Price','$Fund' , '$Faculty_code', '$RoomId' ,'$Statistic','$In_document' ,'$Price_document' , '$Modify_detail' , '$Modify_document' , '$Name' , '$Address', '$Phone', '$Img1',NOW() )" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
///////////////////////////////////////////
function InsertGrade($Student_id,$Class,$Term,$Tb,$Tp,$Total,$Gpa,$Total_unit,$Total_gpa)
{
$sql = "INSERT INTO grade_tb (Student_id,Class,Term,Tb,Tp,Total,Gpa,Total_unit,Total_gpa)";
$sql = $sql."VALUES ('$Student_id','$Class','$Term','$Tb','$Tp','$Total','$Gpa','$Total_unit','$Total_gpa')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
/////////////////////////
function InsertStand($Stand_code,$Topic)
{
$sql = "INSERT INTO qa_standard_tb (Stand_code,Topic)";
$sql = $sql."VALUES ('$Stand_code','$Topic')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
//*------------ ตารางคะแนน qa -----------------*//
function
InsertResult($Stand_code,$Ind_code,$projectId,$S11,$S12,$S13,$S14,$S15,$S16,$S17,$S18,$codeId,$Trem )
{
$sql = " INSERT INTO qa_result_tb (Stand_code,Ind_code,projectId,S11,S12,S13,S14,S15,S16,S17,S18,codeId,Trem)";
$sql = $sql."VALUES ('$Stand_code','$Ind_code','$projectId','$S11','$S12','$S13','$S14','$S15','$S16','$S17','$S18','$codeId','$Trem')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
/////////////////
function
InsertCulActivity($Activity_name,$Activity_type,$Perform,$Activity,$Period,$Fund,$Source,$Target,$Amount,$Supervisor,$Duty,$Objective,$Index_mature,$Spec,$Affect_class,$Asses)
{
$sql = "INSERT INTO cul_activity_tb (Activity_name,Activity_type,Perform,Activity,Period,Fund,Source,Target,Amount,Supervisor,Duty,Objective,Index_mature,Spec,Affect_class,Asses)";
$sql = $sql."VALUES ('$Activity_name','$Activity_type','$Perform','$Activity','$Period','$Fund','$Source','$Target','$Amount','$Supervisor','$Duty','$Objective','$Index_mature','$Spec','$Affect_class','$Asses')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
/////////////////////////
function InsertHealth($Student_id,$Weight,$Height,$Date_note,$B_group,$Presure,$Symptom,$Disease,$Treat,$Place_Treat,$Medicine,$Bad_Medic,$Bad_Food)
{
$sql = "INSERT INTO std_health_tb (Student_id,Weight,Height,Date_note,B_group,Presure,Symptom,Disease,Treat,Place_Treat,Medicine,Bad_Medic,Bad_Food)";
$sql = $sql."VALUES ('$Student_id','$Weight','$Height','$Date_note','$B_group','$Presure','$Symptom','$Disease','$Treat','$Place_Treat','$Medicine','$Bad_Medic','$Bad_Food')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
/////////////////////
function InsertPunish($Student_id,$Date_note,$Punish_type,$Perform,$Consider)
{
$sql = "INSERT INTO std_punish_tb (Student_id,Date_note,Punish_type,Perform,Consider)";
$sql = $sql."VALUES ('$Student_id','$Date_note','$Punish_type','$Perform','$Consider')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
////---ตาราง qa_prioject_tb---------///
function
InsertPi_qa($Stand_code,$Ind_code,$name1, $name2,$Indicate,$Source,$IncFor,$Awa,$Att1,$Att2,$Att3,$Att4,$codeId,$Trem,$qaId)
{
global $conn;
$sql = "INSERT INTO qa_project_tb (Stand_code,Ind_code,name1, name2, Indicate,Source,IncFor,Awa, Att1,Att2,Att3,Att4,codeId,Trem,qaId)";
$sql = $sql."VALUES ('$Stand_code','$Ind_code','$name1','$name2','$Indicate','$Source','$IncFor','$Awa','$Att1','$Att2','$Att3','$Att4','$codeId','$Trem','$qaId' )";
mysql_query($sql) or die("$sql Insert has incorrect ".mysql_error());
}
//////////////////////////
//code Project_name Objective Target Period Budget Budget_use Dif_result Fund_resource Director Join_co Join_type Result_oper
function InsertRelProject($Project_name,$Term,$Budget_year,$Objective,$Target,$Period,$Start_Date,$Budget,$Budget_use,$Dif_result,$Fund_resource,$Director,$Join_co,$Join_type, $Result_oper)
{
global $conn;
$sql = "INSERT INTO foreign_relation_tb (Project_name,Term,Budget_year,Objective,Target,Period,Start_Date,Budget,Budget_use,Dif_result,Fund_resource,Director,Join_co,Join_type,Result_oper)";
$sql = $sql."VALUES('$Project_name','$Term','$Budget_year','$Objective','$Target','$Period','$Start_Date','$Budget','$Budget_use','$Dif_result','$Fund_resource','$Director','$Join_co','$Join_type','$Result_oper')";
mysql_query($sql) or die("$sql Insert has incorrect ".mysql_error());
}
/////////////////////////////////////
/*function InsertEs($code,$Ec41_1,$Ec41_2 ,$Ec41_3,$Ec41_4,$Ec41_5,$Ec41_6,$Ec41_7,$Ec41_8)
{
global $conn;
$sql = "INSERT INTO std_ec_tb (code,Ec41_1,Ec41_2 ,Ec41_3,Ec41_4,Ec41_5,Ec41_6,Ec41_7,Ec41_8)";
$sql = $sql."VALUES('$code','$Ec41_1','$Ec41_2 ','$Ec41_3','$Ec41_4','$Ec41_5','$Ec41_6','$Ec41_7','$Ec41_8')";
mysql_query($sql) or die("$sql Insert has incorrect ".mysql_error());
}*/
////////////////////////////////////
function InsertFur($Student_id,$Date_note,$Case_ab,$Unit)
{
$sql = "INSERT INTO std_absent_tb (Student_id,Date_note,Case_ab,Unit)";
$sql = $sql."VALUES ('$Student_id','$Date_note','$Case_ab','$Unit')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
//////////////// Insert All Budget ///////////////
function
InsertCost4($Year_budget,$Month,$Date_note,$Cost1,$Cost2,$Cost3,$Cost4,$Cost5,$Cost6,$Cost7)
{
$sql = "INSERT INTO finance4_tb (Year_budget,Month,Date_note,Cost1,Cost2,Cost3,Cost4,Cost5,Cost6,Cost7)";
$sql = $sql."VALUES ('$Year_budget','$Month','$Date_note','$Cost1','$Cost2','$Cost3','$Cost4','$Cost5','$Cost6','$Cost7')";
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
/*//////////////////////////*/
function InsertCost3 ($Year_budget,$Month,$Date_note,$Cost1,$Cost2,$Cost3,$Cost4,$Cost5,$Cost6)
{
$sql = "INSERT INTO finance3_tb (Year_budget,Month,Date_note,Cost1,Cost2,Cost3,Cost4,Cost5,Cost6)";
$sql = $sql."VALUES ('$Year_budget','$Month','$Date_note','$Cost1','$Cost2','$Cost3','$Cost4','$Cost5','$Cost6')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
/*//////////////////////////*/
function InsertCost2($Year_budget,$Date_note,$Cost1,$Cost2)
{
$sql = "INSERT INTO finance2_tb (Year_budget,Date_note,Cost1,Cost2)";
$sql = $sql."VALUES ('$Year_budget','$Date_note','$Cost1','$Cost2')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
//*------- InsertState -------------*//////////
function InsertState($State,$Year_State,$Date_note,$No,$Disciption,$Cost1,$Cost2,$Cost3,$Cost4,$Cost5,$CostSum)
{
$sql = "INSERT INTO state_tb (State,Year_State,Date_note,No,Disciption,Cost1,Cost2,Cost3,Cost4,Cost5,CostSum)";
$sql = $sql." VALUES ('$State','$Year_State','$Date_note','$No','$Disciption','$Cost1','$Cost2','$Cost3','$Cost4','$Cost5','$CostSum')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
////////////////////////////////////
function InsertAccType($Acc_type,$Acc_Etype,$Year)
{
global $conn;
$sql = "INSERT INTO accessories_type_tb (Acc_type,Acc_Etype,Year)";
$sql = $sql."VALUES('$Acc_type','$Acc_Etype','$Year' )" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
////////////// Insert User
function
InsertDocontion ($Docom_name)
{
global $conn;
$sql = "INSERT INTO Docontion_tb (Docom_name)";
$sql = $sql."VALUES('$Docom_name')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
///*-------------------ตารางแหล่งเงิน------------//*
function
InsertMoneySource($MoneyS_M)
{
global $conn;
$sql = "INSERT INTO money_source_tb (MoneyS_M)";
$sql = $sql."VALUES('$MoneyS_M')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
//*---------ตารางสถานะงานวิจัย----------------/*
function
InsertDResearch($ResearchDetail)
{
global $conn;
$sql = "INSERT INTO research_source_tb (ResearchDetail)";
$sql = $sql."VALUES('$ResearchDetail')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
//////////////////// insert Relate ///////////////////
function InsertRel($Project_name,$Organize,$Objective,$Contact,$Address,$Email,$Website,$Country)
{
global $conn;
$sql = "INSERT INTO relation_tb (Project_name,Organize,Objective,Contact,Address,Email,Website,Country)";
$sql = $sql."VALUES('$Project_name','Organize','$Objective','$Contact','$Address','$Email','$Website','$Country')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
///------------ ระบบแพทย์แผนไทย ------------/////////////////////
function
InsertPersonMed($HN_code,$HN, $StatusId , $Teacher_code,$massegeId,$prefixId,$Name,$Lastname,$Datetype,$DateBirth,$Sex,$Hostpital,$Nationality,$Nation,$Religion,$Citizen_id,$Address,$Age,$amphurId,$districtId,$provinceId,$Zipcode,$Phone,$Mobile,$Work,$Education,$Email_name,$State_bank,$Status2, $Status3,$Img1,$Degree_code,$Club_nid,$Group_1,$Group_2,$Group_3,$Group_4,$MedCode )
{
global $conn;
$strSQL = "INSERT INTO personalMed (HN_code, HN, StatusId,Teacher_code,massegeId,prefixId,Name,Lastname,Datetype,DateBirth,Sex,Hostpital,Nationality,Nation,Religion,Citizen_id,Address,Age,amphurId,districtId,provinceId,Zipcode,Phone,Mobile,Work,Education,Email_name,State_bank,Status2, Status3,Img1,Degree_code,Club_nid,Group_1,Group_2,Group_3,Group_4,MedCode ) " ;
$strSQL = $strSQL." VALUES('$HN_code','$HN','$StatusId','$Teacher_code','massegeId','$prefixId','$Name','$Lastname','$Datetype','$DateBirth','$Sex','$Hostpital','$Nationality','$Nation','$Religion','$Citizen_id','$Address','$Age','$amphurId','$districtId','$provinceId','$Zipcode','$Phone','$Mobile','$Work','$Education','$Email_name','$State_bank','$Status2',' $Status3','$Img1','$Degree_code','$Club_nid','$Group_1','$Group_2','$Group_3','$Group_4','$MedCode' )" ;
mysql_query($strSQL) or die(" INSERT HAS INCORRECT $result $strSQL".mysql_error());
}
/////////////////////////////////////////////////// ** Massege ** ///////////////////////
function InsertMassege($Orderlist,$Dental_code,$First_name,$Name,$Lastname,$Name_eng, $Lastname_eng,$Sex,$DateBirth,$Datetype,$Religion,$Address,$Img1,$provinceId,$Phone_1,$Phone_2,$StatusId,$Email,$Description_1,$Description_2,$Year_1,$Flag)
{
global $conn;
$sql = "INSERT INTO massege_db (Orderlist,Dental_code,First_name,Name,Lastname,Name_eng, Lastname_eng,Sex,DateBirth,Datetype,Religion,Address,Img1,provinceId,Phone_1,Phone_2,StatusId,Email,Description_1,Description_2,Year_1,Flag)";
$sql = $sql."VALUES ('$Orderlist','$Dental_code','$First_name','$Name','$Lastname','$Name_eng',' $Lastname_eng','$Sex','$DateBirth','$Datetype','$Religion','$Address','$Img1','$provinceId','$Phone_1','$Phone_2','$StatusId','$Email','$Description_1','$Description_2','$Year_1','$Flag')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
/////////////// **-ตารางราคา** tInsertThprice /////////
function InsertThprice($Code_1,$Name,$Price,$Description_1,$Description_2,$Description_3)
{
global $conn;
$sql ="INSERT INTO treatMed_tb ( Code_1,Name,Price,Description_1,Description_2,Description_3)" ;
$sql =$sql. " VALUES ('$Code_1','$Name','$Price','$Description_1','$Description_2','$Description_3')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
/////////// ***- InsertAccount**///////////
function
InsertThAccount($personId,$No,$No_code,$HN_code,$Tooth_code,$Teach_code,$Teacher_code,$massegeId,$Code ,$Time_in,$Time_out,$Date,$Price ,$Mount,$Cost_total,$Percen,$prefixId,$Roug)
{
global $conn;
$sql = "INSERT INTO accountMed_db(personId,No,No_code,HN_code,Tooth_code,Teach_code,Teacher_code,massegeId,Code ,Time_in,Time_out,Date,Price ,Mount,Cost_total,Percen,prefixId,Roug)";
$sql = $sql."VALUES('$personId','$No','$No_code','$HN_code','$Tooth_code','$Teach_code','$Teacher_code','$massegeId','$Code' ,'$Time_in','$Time_out','$Date','$Price' ,'$Mount','$Cost_total','$Percen','$prefixId','$Roug')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
//*----------- ตารางการขอไปราชการ -----------------*//
function
InsertFormA($Training_code,$Teacher_code,$code,$Orderlist, $Project_plan,$ProjectId, $Travel , $No_in, $Status,$Detail,$Date,$Date_start,$Date_finish,$Training_name,$Training_type,$Day,$Year_std,$TeacherId, $Flag, $Flag1,$Flag2,$Budget_use,$maNo, $assignMent ,$assignmentName, $provinceId, $date_updated)
{
global $conn;
$sql ="INSERT INTO formaoffice (Training_code,Teacher_code,code,Orderlist,Project_plan, ProjectId, Travel, No_in, Status , Detail, Date, Date_start, Date_finish,Training_name,Training_type, Day,Year_std,TeacherId, Flag, Flag1,Flag2,Budget_use, maNo, assignMent ,assignmentName,provinceId, date_updated)" ;
$sql =$sql. " VALUES ('$Training_code','$Teacher_code','$code','$Orderlist','$Project_plan','$ProjectId','$Travel','$No_in','$Status','$Detail','$Date','$Date_start','$Date_finish','$Training_name','$Training_type','$Day','$Year_std','$TeacherId','$Flag','$Flag1','$Flag2','$Budget_use','$maNo','$assignMent','$assignmentName','$provinceId',NOW() )" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
////////////// ********//////////////
function InsertStdScho($Scholarship_code,$Date_rec,$Student_id,$Consider)
{
global $conn;
$sql = "INSERT INTO std_scholarship_tb (Scholarship_code,Date_rec,Student_id,Consider)";
$sql = $sql."VALUES('$Scholarship_code','$Date_rec','$Student_id','$Consider')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
//////////////**** InsertFormCar *////////////
function
InsertFormCar( $CarNo, $code , $makeWord, $Make, $Training_name , $Training_type ,$Date , $Date_start , $Date_finish ,$object , $PersonIn , $Personly, $provinceId , $Detail, $Place, $TelNo , $usecar, $Time_start, $Time_finish,$Teacher_code, $Budget_year , $Status , $date_updated )
{
global $conn;
$sql ="INSERT INTO formcaroffice ( CarNo , code , makeWord, Make, Training_name , Training_type ,Date , Date_start , Date_finish ,object , PersonIn ,Personly, provinceId, Detail, Place, TelNo , usecar, Time_start, Time_finish,Teacher_code,Budget_year, Status, date_updated )" ;
$sql =$sql. " VALUES ('$CarNo','$code','$makeWord','$Make','$Training_name','$Training_type','$Date','$Date_start','$Date_finish','$object','$PersonIn','$Personly','$provinceId','$Detail','$Place','$TelNo','$usecar',' $Time_start','$Time_finish','$Teacher_code','$Budget_year' ,'$Status', NOW() )" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
////----ตารางการใช้-น้ำมัน--------////
function
InsertOil( $carId , $CarmoId ,$Mile_start , $Mile_finish , $Num_Mile, $Num_Lish , $Lish_start , $Price_start , $Num_start ,$Lish_finish , $Price_finish , $Num_finish , $Teacher_code )
{
global $conn;
$sql =" INSERT INTO autocar_tb ( carId , CarmoId, Mile_start , Mile_finish , Num_Mile, Num_Lish , Lish_start , Price_start , Num_start ,Lish_finish , Price_finish , Num_finish , Teacher_code,date_updated)";
$sql = $sql. " VALUES ('$carId' , '$CarmoId', '$Mile_start' ,'$Mile_finish' , '$Num_Mile', '$Num_Lish', '$Lish_start' , '$Price_start' , '$Num_start' ,'$Lish_finish' , '$Price_finish' , '$Num_finish' , '$Teacher_code', NOW() )";
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
//* ----------*////////////
function
InsertDegreeHis( $Teacher_code ,$Degree_code , $Degree_His , $Degree_Major , $Degree_Institute ,$Degree_Year , $Type_degree)
{
global $conn;
$sql = "INSERT INTO degree_his_tb (Teacher_code ,Degree_code ,Degree_His , Degree_Major ,Degree_Institute ,Degree_Year ,Type_degree)";
$sql = $sql."VALUES('$Teacher_code' ,'$Degree_code' ,'$Degree_His' ,'$Degree_Major' ,'$Degree_Institute' ,'$Degree_Year' , '$Type_degree')" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
//*** ตารางเจ้าหน้าที่ซ่อม---- *///
function
InsertDuraTeacher($Teacher_code, $duraId, $Status, $DetailDura , $DetailDura_name , $Detail ,$DetailName ,$Time_total, $Budget_year ,$durableCode)
{
global $conn;
$sql = "INSERT INTO manament_tb (Teacher_code, duraId, Status, DetailDura ,DetailDura_name ,Detail,DetailName ,Time_total,Budget_year,durableCode )";
$sql = $sql."VALUES('$Teacher_code','$duraId','$Status','$DetailDura','$DetailDura_name','$Detail' ,'$DetailName','$Time_total' ,'$Budget_year','$durableCode' )" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
//*** ตารางภาพอาคาร---- *///
function
InsertMapsCollege( $Detail, $mapDetail, $collegeCode ,$Status,$date_updated)
{
global $conn;
$sql = "INSERT INTO mapcollege_tb ( Detail, mapDetail, collegeCode ,Status,date_updated )";
$sql = $sql."VALUES ( '$Detail','$mapDetail','$collegeCode','$Status',NOW() )" ;
mysql_query($sql) or die("$sql Insert has incorrect".mysql_error());
}
//*------------ ตารางบุคลากร ------------------*//
function
InsertTachername($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,$Img1,$Skill,$Type_Degree,$Degree_code,$Degree_else,$Degree_His1,$Degree_His1_Major,$Degree_His1_Institute,$Degree_His1_End_Year,$Type_degree1,$Degree_His2,$Degree_His2_Major,$Degree_His2_Institute,$Degree_His2_End_Year,$Type_degree2,$Degree_His3,$Degree_His3_Major,$Degree_His3_Institute,$Degree_His3_End_Year, $Type_degree3,$Person_type,$Teacher_type, $Gover_id,$Forum_nid,$Club_nid,$Year_gov,$Year_coll, $Year_fac, $Manage_pos, $Faculty_code, $PositionId,$Username,$Password,$permission)
{
global $conn; $sql ="INSERT INTO personal_tb (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,Img1,Skill,Type_Degree,Degree_code,Degree_else,Degree_His1,Degree_His1_Major,Degree_His1_Institute,Degree_His1_End_Year,Type_degree1,Degree_His2,Degree_His2_Major,Degree_His2_Institute,Degree_His2_End_Year,Type_degree2,Degree_His3,Degree_His3_Major,Degree_His3_Institute,Degree_His3_End_Year,Type_degree3,Person_type,Teacher_type, Gover_id,Forum_nid,Club_nid,Year_gov,Year_coll,Year_fac,Manage_pos, Faculty_code,PositionId,Username,Password,permission) ";
$sql =$sql. "VALUES ('$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','$Img1','$Skill','$Type_Degree','$Degree_code','$Degree_else','$Degree_His1','$Degree_His1_Major','$Degree_His1_Institute','$Degree_His1_End_Year','$Type_degree1','$Degree_His2','$Degree_His2_Major','$Degree_His2_Institute','$Degree_His2_End_Year','$Type_degree2','$Degree_His3','$Degree_His3_Major','$Degree_His3_Institute','$Degree_His3_End_Year','$Type_degree3','$Person_type','$Teacher_type','$Gover_id','$Forum_nid','$Club_nid','$Year_gov','$Year_coll','$Year_fac','$Manage_pos','$Faculty_code','$PositionId','$Username','$Password','$permission')";
mysql_query($sql) or die ("$sql Insert has incorrect".mysql_error());
}
?>
|