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.
$post_id
=
$_POST
[
'id'
];
014.
$post_nameth
=
$_POST
[
'nameth'
];
015.
$post_nameen
=
$_POST
[
'nameen'
];
016.
$post_weight
=
$_POST
[
'weight'
];
017.
$post_height
=
$_POST
[
'height'
];
018.
$post_address
=
$_POST
[
'address'
];
019.
$post_birthday
=
$_POST
[
'birthday'
];
020.
$post_age
=
$_POST
[
'age'
];
021.
$post_religion
=
$_POST
[
'religion'
];
022.
$post_tel
=
$_POST
[
'tel'
];
023.
$post_email
=
$_POST
[
'email'
];
024.
$post_image
=
$_FILES
[
'image'
][
'name'
];
025.
$image_tmp
=
$_FILES
[
'image'
][
'tmp_name'
];
026.
$post_resume
=
$_FILES
[
'image1'
][
'name'
];
027.
$image_tmp
=
$_FILES
[
'image1'
][
'tmp_name'
];
028.
029.
move_uploaded_file(
$image_tmp
,
"../img/$post_image"
);
030.
move_uploaded_file(
$image_tmp
,
"../img/$post_resume"
);
031.
032.
033.
$insert_query
= "INSERT INTO job (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)
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.
if
(mysqli_query(
$conn
,
$insert_query
)) {
037.
038.
echo
"<script>alert('Post published successfully');</script>"
;
039.
header(
"location: viewjob.php"
);
040.
}
else
{
041.
echo
"<script>alert('Something wrong!');</script>"
;
042.
}
043.
044.
}
045.
?>
046.
047.
<!DOCTYPE html>
048.
<html lang=
"en"
dir=
"ltr"
>
049.
<head>
050.
<meta charset=
"utf-8"
>
051.
<title>Insert Page</title>
052.
053.
<link rel=
"stylesheet"
href=
"css/stylemew.css"
>
054.
055.
</head>
056.
<body>
057.
058.
<header align=
"center"
>
059.
<div
class
=
"container"
>
060.
<h1>Welcome to Admin Page Miss </h1>
061.
062.
</div>
063.
</header>
064.
065.
<section
class
=
"content"
>
066.
<div
class
=
"content_grid"
>
067.
068.
<div
class
=
"sidebar"
>
069.
<h1>Welcome : </h1>
070.
<h3><a href=
"index.php"
>Home</a></h3>
071.
<h3><a href=
"viewjob.php"
>View</a></h3>
072.
<h3><a href=
"insertjob.php"
>Insert</a></h3>
073.
<h3><a href=
"logout.php"
>Logout</a></h3>
074.
</div>
075.
076.
<div
class
=
"showinfo"
>
077.
<h1>Insert</h1>
078.
079.
<form action=
"insertjob.php"
method=
"post"
enctype=
"multipart/form-data"
>
080.
<table width=
"100%"
align=
"center"
border=
"1"
>
081.
082.
<tr>
083.
<td align=
"center"
colspan=
"6"
><h1>Insert</h1></td>
084.
</tr>
085.
086.
<tr>
087.
<td>เลขประจำตัวประชาชน</td>
088.
<td><input type=
"text"
name=
"id"
size=
"25"
></td>
089.
</tr>
090.
091.
<tr>
092.
<td>ชื่อ-นามสกุล (ภาษาไทย)</td>
093.
<td><input type=
"text"
name=
"nameth"
size=
"25"
></td>
094.
</tr>
095.
096.
<tr>
097.
<td>ชื่อ-นามสกุล (ภาษาอังกฤษ)</td>
098.
<td><input type=
"text"
name=
"nameen"
size=
"25"
></td>
099.
</tr>
100.
101.
<tr>
102.
<td>น้ำหนัก</td>
103.
<td><input type=
"text"
name=
"weight"
size=
"25"
></td>
104.
</tr>
105.
106.
<tr>
107.
<td>ส่วนสูง</td>
108.
<td><input type=
"text"
name=
"height"
size=
"25"
></td>
109.
</tr>
110.
111.
<tr>
112.
<td>ที่อยู่</td>
113.
<td><textarea name=
"address"
cols=
"35"
rows=
"10"
></textarea></td>
114.
</tr>
115.
116.
<tr>
117.
<td>วันเกิด</td>
118.
<td><input type=
"text"
name=
"birthday"
size=
"25"
>Ex.01/01/10</td>
119.
</tr>
120.
121.
<tr>
122.
<td>อายุ</td>
123.
<td><input type=
"text"
name=
"age"
size=
"25"
></td>
124.
</tr>
125.
126.
<tr>
127.
<td>ศาสนา</td>
128.
<td><input type=
"text"
name=
"religion"
size=
"25"
></td>
129.
</tr>
130.
131.
<tr>
132.
<td>เบอร์โทรศัพท์</td>
133.
<td><input type=
"text"
name=
"tel"
size=
"25"
></td>
134.
</tr>
135.
136.
<tr>
137.
<td>E-mail</td>
138.
<td><input type=
"text"
name=
"email"
size=
"25"
></td>
139.
</tr>
140.
141.
<tr>
142.
<td>แนบรูป</td>
143.
<td><input type=
"file"
name=
"image"
size=
"50"
</td>
144.
</tr>
145.
146.
<tr>
147.
<td>resume</td>
148.
<td><input type=
"file"
name=
"image1"
size=
"50"
</td>
149.
</tr>
150.
151.
<tr>
152.
<td align=
"center"
colspan=
"6"
><input type=
"submit"
name=
"submit"
value=
"Publish Now"
></td>
153.
</tr>
154.
</table>
155.
156.
</form>
157.
158.
</div>
159.
</div>
160.
161.
</section>
162.
163.
</body>
164.
</html>