| Server IP : 27.254.66.5 / Your IP : 216.73.217.39 Web Server : Apache/2 System : Linux cs82.hostneverdie.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64 User : technic2 ( 1951) PHP Version : 7.4.30 Disable Function : apache_child_terminate, apache_setenv, define_syslog_variables, escapeshellarg, escapeshellcmd,exec, fp, fput, highlight_file, ini_alter, ini_restore, inject_code, passthru,phpAds_remoteInfo, phpAds_XmlRpc,phpAds_xmlrpcDecode, phpAds_xmlrpcEncode, popen, posix_getpwuid, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid,posix_setuid, posix_setuid, posix_uname,proc_open,proc_close, proc_get_status, proc_nice, proc_terminate, shell_exec, syslog, system, xmlrpc_entity_decode, show_source,sleep,pcntl_exec,virtual,suexec,dbmopen,dl,symlink,disk_free_space,diskfreespace,leak MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/technic2/domains/technicrayong.ac.th/public_html/old-website/jivec58/nonthaburi/ |
Upload File : |
<?php
Ob_start();
session_start();
if ($_SESSION["osj_name"] == "no" or $_SESSION["osj_name"] == "")
{
header("Location:../index.php");
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Refresh" content="5;url=menu.php">
<title>Untitled Document</title>
</head>
<body>
<?php
require_once("config.php");
if (($_POST["image1"] <> "ไม่มีภาพ") && ($_POST["image11"] <> "ไม่มีภาพ"))
{
$image_name1 = $_POST["invention_id"] . "1.jpg";
}
elseif (($_POST["image1"] <> "ไม่มีภาพ") && ($_POST["image11"] == "ไม่มีภาพ"))
{
$image_name1 = $_POST["invention_id"] . "1.jpg";
}
elseif (($_POST["image1"] == "ไม่มีภาพ") && ($_POST["image11"] <> "ไม่มีภาพ"))
{
$image_name1 = $_POST["invention_id"] . "1.jpg";
}
elseif (($_POST["image1"] == "ไม่มีภาพ") && ($_POST["image11"] == "ไม่มีภาพ"))
{
$image_name1 = "ไม่มีภาพ";
}
if (($_POST["image2"] <> "ไม่มีภาพ") && ($_POST["image21"] <> "ไม่มีภาพ"))
{
$image_name2 = $_POST["invention_id"] . "2.jpg";
}
elseif (($_POST["image2"] <> "ไม่มีภาพ") && ($_POST["image21"] == "ไม่มีภาพ"))
{
$image_name2 = $_POST["invention_id"] . "2.jpg";
}
elseif (($_POST["image2"] == "ไม่มีภาพ") && ($_POST["image21"] <> "ไม่มีภาพ"))
{
$image_name2 = $_POST["invention_id"] . "2.jpg";
}
elseif (($_POST["image2"] == "ไม่มีภาพ") && ($_POST["image21"] == "ไม่มีภาพ"))
{
$image_name2 = "ไม่มีภาพ";
}
if (($_POST["pdf"] <> "ไม่แนบไฟล์ pdf") && ($_POST["pdf1"] <> "ไม่แนบไฟล์ pdf"))
{
$pdf_name = $_POST["invention_id"] . ".pdf";
}
elseif (($_POST["pdf"] <> "ไม่แนบไฟล์ pdf") && ($_POST["pdf1"] == "ไม่แนบไฟล์ pdf"))
{
$pdf_name = $_POST["invention_id"] . ".pdf";
}
elseif (($_POST["pdf"] == "ไม่แนบไฟล์ pdf") && ($_POST["pdf1"] <> "ไม่แนบไฟล์ pdf"))
{
$pdf_name = $_POST["invention_id"] . ".pdf";
}
elseif (($_POST["pdf"] == "ไม่แนบไฟล์ pdf") && ($_POST["pdf1"] == "ไม่แนบไฟล์ pdf"))
{
$pdf_name = "ไม่แนบไฟล์ pdf";
}
$sql = "UPDATE jivec SET invention_name = '" . $_POST["invention_name"] . "', invention_level = '" . $_POST["invention_level"] . "', budget = '" . $_POST["budget"] . "', college_name = '" . $_POST["college_name"] . "', address = '" . $_POST["address"] . "', moo = '" . $_POST["moo"] . "', sub_district = '" . $_POST["sub_district"] . "', district = '" . $_POST["district"] . "', province = '" . $_POST["province"] . "', postal_code = '" . $_POST["postal_code"] . "', vocational_name = '" . $_POST["vocational_name"] . "', invention_type = '" . $_POST["invention_type"] . "', creator_name1 = '" . $_POST["creator_name1"] . "', creator_level1 = '" . $_POST["creator_level1"] . "', creator_department1 = '" . $_POST["creator_department1"] . "', creator_name2 = '" . $_POST["creator_name2"] . "', creator_level2 = '" . $_POST["creator_level2"] . "', creator_department2 = '" . $_POST["creator_department2"] . "', creator_name3 = '" . $_POST["creator_name3"] . "', creator_level3 = '" . $_POST["creator_level3"] . "', creator_department3 = '" . $_POST["creator_department3"] . "', creator_name4 = '" . $_POST["creator_name4"] . "', creator_level4 = '" . $_POST["creator_level4"] . "', creator_department4 = '" . $_POST["creator_department4"] . "', creator_name5 = '" . $_POST["creator_name5"] . "', creator_level5 = '" . $_POST["creator_level5"] . "', creator_department5 = '" . $_POST["creator_department5"] . "', creator_name6 = '" . $_POST["creator_name6"] . "', creator_level6 = '" . $_POST["creator_level6"] . "', creator_department6 = '" . $_POST["creator_department6"] . "', creator_name7 = '" . $_POST["creator_name7"] . "', creator_level7 = '" . $_POST["creator_level7"] . "', creator_department7 = '" . $_POST["creator_department7"] . "', creator_name8 = '" . $_POST["creator_name8"] . "', creator_level8 = '" . $_POST["creator_level8"] . "', creator_department8 = '" . $_POST["creator_department8"] . "', creator_name9 = '" . $_POST["creator_name9"] . "', creator_level9 = '" . $_POST["creator_level9"] . "', creator_department9 = '" . $_POST["creator_department9"] . "', creator_name10 = '" . $_POST["creator_name10"] . "', creator_level10 = '" . $_POST["creator_level10"] . "', creator_department10 = '" . $_POST["creator_department10"] . "', advisor_name1 = '" . $_POST["advisor_name1"] . "', advisor_idcard1 = '" . $_POST["advisor_idcard1"] . "', advisor_position1 = '" . $_POST["advisor_position1"] . "', advisor_department1 = '" . $_POST["advisor_department1"] . "', advisor_phone1 = '" . $_POST["advisor_phone1"] . "', advisor_email1 = '" . $_POST["advisor_email1"] . "', advisor_name2 = '" . $_POST["advisor_name2"] . "', advisor_idcard2 = '" . $_POST["advisor_idcard2"] . "', advisor_position2 = '" . $_POST["advisor_position2"] . "', advisor_department2 = '" . $_POST["advisor_department2"] . "', advisor_phone2 = '" . $_POST["advisor_phone2"] . "', advisor_email2 = '" . $_POST["advisor_email2"] . "', advisor_name3 = '" . $_POST["advisor_name3"] . "', advisor_idcard3 = '" . $_POST["advisor_idcard3"] . "', advisor_position3 = '" . $_POST["advisor_position3"] . "', advisor_department3 = '" . $_POST["advisor_department3"] . "', advisor_phone3 = '" . $_POST["advisor_phone3"] . "', advisor_email3 = '" . $_POST["advisor_email3"] . "', advisor_name4 = '" . $_POST["advisor_name4"] . "', advisor_idcard4 = '" . $_POST["advisor_idcard4"] . "', advisor_position4 = '" . $_POST["advisor_position4"] . "', advisor_department4 = '" . $_POST["advisor_department4"] . "', advisor_phone4 = '" . $_POST["advisor_phone4"] . "', advisor_email4 = '" . $_POST["advisor_email4"] . "', advisor_name5 = '" . $_POST["advisor_name5"] . "', advisor_idcard5 = '" . $_POST["advisor_idcard5"] . "', advisor_position5 = '" . $_POST["advisor_position5"] . "', advisor_department5 = '" . $_POST["advisor_department5"] . "', advisor_phone5 = '" . $_POST["advisor_phone5"] . "', advisor_email5 = '" . $_POST["advisor_email5"] . "', power220v = '" . $_POST["power220v"] . "', power220a = '" . $_POST["power220a"] . "', power380v = '" . $_POST["power380v"] . "', power380a = '" . $_POST["power380a"] . "', use_water = '" . $_POST["use_water"] . "', use_gas = '" . $_POST["use_gas"] . "', use_fuel_engine = '" . $_POST["use_fuel_engine"] . "', pollution = '" . $_POST["pollution"] . "', have_noise = '" . $_POST["have_noise"] . "', have_exhaust = '" . $_POST["have_exhaust"] . "', have_smoke = '" . $_POST["have_smoke"] . "', other_data = '" . $_POST["other_data"] . "', invention_wide = '" . $_POST["invention_wide"] . "', invention_long = '" . $_POST["invention_long"] . "', invention_high = '" . $_POST["invention_high"] . "', male_student_amount = '" . $_POST["male_student_amount"] . "', female_student_amount = '" . $_POST["female_student_amount"] . "', male_advisor_amount = '" . $_POST["male_advisor_amount"] . "', female_advisor_amount = '" . $_POST["female_advisor_amount"] . "', total_person_amount = '" . $_POST["total_person_amount"] . "', college_phone = '" . $_POST["college_phone"] . "', advisor_phone6 = '" . $_POST["advisor_phone6"] . "', abstract = '" . $_POST["abstract"] . "', property = '" . $_POST["property"] . "', image1 = '" . $image_name1 . "', image2 = '" . $image_name2 . "', pdf = '" . $pdf_name . "', date_time_record = now() WHERE invention_id = " . $_POST["invention_id"];
//echo $sql; //เอาไว้ทดสอบว่า sql ถูกต้องหรือไม่
mysql_query($sql) or die("sql ผิด เพิ่มข้อมูลไม่สำเร็จ");
echo "แก้ไขข้อมูลสำเร็จแล้ว ครับบบบบบ";
?>
<?php
//if (($_POST["image1"] <> "ไม่มีภาพ") && ($_POST["image"] <> "ไม่มีภาพ"))
//{
// unlink("image/" . $_POST["image1"]);
//}
if ($_POST["image11"] <> "ไม่มีภาพ")
{
//move_uploaded_file("tmp/" . $_POST["image"] , "image/" . iconv('UTF-8', 'windows-874', $_POST["image"]));
//copy("tmp/" . iconv('UTF-8', 'windows-874', $_POST["image"]) ,"image/" . iconv('UTF-8', 'windows-874', $_POST["image"]));
rename("tmp/" . iconv('UTF-8', 'windows-874', $_POST["image11"]) ,"image/" . $image_name1);
//copy("tmp/rtc.jpg" ,"image/rtc.jpg");
}
if ($_POST["image21"] <> "ไม่มีภาพ")
{
//move_uploaded_file("tmp/" . $_POST["image"] , "image/" . iconv('UTF-8', 'windows-874', $_POST["image"]));
//copy("tmp/" . iconv('UTF-8', 'windows-874', $_POST["image"]) ,"image/" . iconv('UTF-8', 'windows-874', $_POST["image"]));
rename("tmp/" . iconv('UTF-8', 'windows-874', $_POST["image21"]) ,"image/" . $image_name2);
//copy("tmp/rtc.jpg" ,"image/rtc.jpg");
}
if ($_POST["pdf1"] <> "ไม่แนบไฟล์ pdf")
{
//move_uploaded_file("tmp/" . $_POST["image"] , "image/" . iconv('UTF-8', 'windows-874', $_POST["image"]));
//copy("tmp/" . iconv('UTF-8', 'windows-874', $_POST["image"]) ,"image/" . iconv('UTF-8', 'windows-874', $_POST["image"]));
rename("tmp/" . iconv('UTF-8', 'windows-874', $_POST["pdf1"]) ,"pdf/" . $pdf_name);
//copy("tmp/rtc.jpg" ,"image/rtc.jpg");
}
?>
</body>
</html>