001.
<?php
002.
003.
ini_set
(
'post_max_size'
,
'2000M'
);
004.
005.
ini_set
(
'upload_max_filesize'
,
'40M'
);
006.
007.
session_start();
008.
009.
require_once
"connect.php"
;
010.
011.
if
(isset(
$_POST
[
'submit'
])) {
012.
013.
014.
$post_id
=
$_POST
[
'id'
];
015.
$post_nameth
=
$_POST
[
'nameth'
];
016.
$post_nameen
=
$_POST
[
'nameen'
];
017.
$post_weight
=
$_POST
[
'weight'
];
018.
$post_height
=
$_POST
[
'height'
];
019.
$post_address
=
$_POST
[
'address'
];
020.
$post_birthday
=
$_POST
[
'birthday'
];
021.
$post_age
=
$_POST
[
'age'
];
022.
$post_religion
=
$_POST
[
'religion'
];
023.
$post_tel
=
$_POST
[
'tel'
];
024.
$post_email
=
$_POST
[
'email'
];
025.
$post_image
=
$_FILES
[
'image'
][
'name'
];
026.
$image_tmp
=
$_FILES
[
'image'
][
'tmp_name'
];
027.
$post_resume
=
$_FILES
[
'image1'
][
'name'
];
028.
$image_tmp
=
$_FILES
[
'image1'
][
'tmp_name'
];
029.
030.
move_uploaded_file(
$image_tmp
,
"../img/$post_image"
);
031.
move_uploaded_file(
$image_tmp
,
"../img/$post_resume"
);
032.
033.
$insert_query
= "INSERT INTO job (post_personal_id, post_nameth, post_nameen, post_weight, post_height, post_address, post_birthday, post_age, post_religion, post_tel, post_email, post_image, post_resume )
034.
VALUES (
'$post_id'
,
'$post_nameth'
,
'$post_nameen'
,
'$post_weight'
,
'$post_height'
,
'$post_address'
,
'$post_birthday'
,
'$post_age'
,
'$post_religion'
,
'$post_tel'
,
'$post_email'
,
'$post_image'
,
'$post_resume'
)";
035.
036.
037.
if
(mysqli_query(
$conn
,
$insert_query
)) {
038.
039.
echo
"<script>alert('Post published successfully');</script>"
;
040.
header(
"location: viewjob.php"
);
041.
}
else
{
042.
echo
"<script>alert('Something wrong!');</script>"
;
043.
}
044.
045.
}
046.
?>
047.
048.
<!DOCTYPE html>
049.
<html lang=
"en"
dir=
"ltr"
>
050.
<head>
051.
<meta charset=
"utf-8"
>
052.
<title>Insert Page</title>
053.
054.
<link rel=
"stylesheet"
href=
"css/stylemew.css"
>
055.
056.
</head>
057.
<body>
058.
059.
<header align=
"center"
>
060.
<div
class
=
"container"
>
061.
<h1>ยินดีต้อนรับเข้าสู่เว็บไซต์บริษัท</h1>
062.
</div>
063.
</header>
064.
065.
<style>
066.
input[type=text], select {
067.
width: 100%;
068.
padding: 12px 20px;
069.
margin: 8px 0;
070.
display: inline-block;
071.
border: 1px solid #ccc;
072.
border-radius: 4px;
073.
box-sizing: border-box;
074.
}
075.
076.
input[type=submit] {
077.
width: 100%;
078.
background-color: #4CAF50;
079.
color: white;
080.
padding: 14px 20px;
081.
margin: 8px 0;
082.
border: none;
083.
border-radius: 4px;
084.
cursor: pointer;
085.
}
086.
087.
input[type=submit]:hover {
088.
background-color: #45a049;
089.
}
090.
091.
div.sidebar{
092.
border-radius: 5px;
093.
background-color: #f2f2f2;
094.
padding: 20px;
095.
}
096.
div.showinfo{
097.
border-radius: 5px;
098.
background-color: #f2f2f2;
099.
padding: 20px;
100.
}
101.
</style>
102.
103.
<section
class
=
"content"
>
104.
<div
class
=
"content_grid"
>
105.
106.
<div
class
=
"sidebar"
>
107.
<h1>Welcome : </h1>
108.
<h3><a href=
"index.php"
>Home</a></h3>
109.
<h3><a href=
"viewjob.php"
>View</a></h3>
110.
<h3><a href=
"insertjob.php"
>แบบฟอร์มสมัครงาน</a></h3>
111.
<h3><a href=
"logout.php"
>Logout</a></h3>
112.
</div>
113.
114.
<div
class
=
"showinfo"
>
115.
<h1>แบบฟอร์มสมัครงาน</h1>
116.
117.
<form action=
"insertjob.php"
method=
"post"
enctype=
"multipart/form-data"
>
118.
<table width=
"100%"
align=
"center"
border=
"1"
>
119.
120.
<tr>
121.
<td align=
"center"
colspan=
"6"
><h1>Insert</h1></td>
122.
</tr>
123.
124.
<tr>
125.
<td>เลขประจำตัวประชาชน</td>
126.
<td><input type=
"text"
name=
"id"
size=
"25"
></td>
127.
</tr>
128.
129.
<tr>
130.
<td>ชื่อ-นามสกุล (ภาษาไทย)</td>
131.
<td><input type=
"text"
name=
"nameth"
size=
"25"
></td>
132.
</tr>
133.
134.
<tr>
135.
<td>ชื่อ-นามสกุล (ภาษาอังกฤษ)</td>
136.
<td><input type=
"text"
name=
"nameen"
size=
"25"
></td>
137.
</tr>
138.
139.
<tr>
140.
<td>น้ำหนัก</td>
141.
<td><input type=
"text"
name=
"weight"
size=
"25"
></td>
142.
</tr>
143.
144.
<tr>
145.
<td>ส่วนสูง</td>
146.
<td><input type=
"text"
name=
"height"
size=
"25"
></td>
147.
</tr>
148.
149.
<tr>
150.
<td>ที่อยู่</td>
151.
<td><textarea name=
"address"
cols=
"35"
rows=
"10"
></textarea></td>
152.
</tr>
153.
154.
<tr>
155.
<td>วันเกิด</td>
156.
<td><input type=
"text"
name=
"birthday"
size=
"25"
>Ex.01/01/10</td>
157.
</tr>
158.
159.
<tr>
160.
<td>อายุ</td>
161.
<td><input type=
"text"
name=
"age"
size=
"25"
></td>
162.
</tr>
163.
164.
<tr>
165.
<td>ศาสนา</td>
166.
<td><input type=
"text"
name=
"religion"
size=
"25"
></td>
167.
</tr>
168.
169.
<tr>
170.
<td>เบอร์โทรศัพท์</td>
171.
<td><input type=
"text"
name=
"tel"
size=
"25"
></td>
172.
</tr>
173.
174.
<tr>
175.
<td>E-mail</td>
176.
<td><input type=
"text"
name=
"email"
size=
"25"
></td>
177.
</tr>
178.
179.
<tr>
180.
<td>แนบรูป</td>
181.
<td><input type=
"file"
name=
"image"
size=
"50"
></td>
182.
</tr>
183.
184.
<tr>
185.
<td>resume</td>
186.
<td><input type=
"file"
name=
"image1"
size=
"50"
></td>
187.
</tr>
188.
189.
190.
191.
<tr>
192.
193.
<td align=
"center"
colspan=
"6"
><input type=
"submit"
name=
"submit"
value=
"Publish Now"
></td>
194.
</tr>
195.
196.
</table>
197.
198.
</form>
199.
200.
</div>
201.
</div>
202.
203.
</section>
204.
205.
</body>
206.
</html>