01.
<?php
02.
include
"../connect.php"
;
03.
04.
?>
05.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
06.
<?php
07.
08.
$phpVersion
= phpversion();
09.
list(
$v_Upper
,
$v_Major
,
$v_Minor
) =
explode
(
"."
,
$phpVersion
);
10.
11.
if
((
$v_Upper
== 4 &&
$v_Major
< 1) ||
$v_Upper
< 4) {
12.
$_FILES
=
$HTTP_POST_FILES
;
13.
$_ENV
=
$HTTP_ENV_VARS
;
14.
$_GET
=
$HTTP_GET_VARS
;
15.
$_POST
=
$HTTP_POST_VARS
;
16.
$_COOKIE
=
$HTTP_COOKIE_VARS
;
17.
$_SERVER
=
$HTTP_SERVER_VARS
;
18.
$_SESSION
=
$HTTP_SESSION_VARS
;
19.
$_FILES
=
$HTTP_POST_FILES
;
20.
}
21.
22.
if
(!
ini_get
(
'register_globals'
)) {
23.
while
(list(
$key
,
$value
)=each(
$_FILES
))
$GLOBALS
[
$key
]=
$value
;
24.
while
(list(
$key
,
$value
)=each(
$_ENV
))
$GLOBALS
[
$key
]=
$value
;
25.
while
(list(
$key
,
$value
)=each(
$_GET
))
$GLOBALS
[
$key
]=
$value
;
26.
while
(list(
$key
,
$value
)=each(
$_POST
))
$GLOBALS
[
$key
]=
$value
;
27.
while
(list(
$key
,
$value
)=each(
$_COOKIE
))
$GLOBALS
[
$key
]=
$value
;
28.
while
(list(
$key
,
$value
)=each(
$_SERVER
))
$GLOBALS
[
$key
]=
$value
;
29.
while
(list(
$key
,
$value
)=@each(
$_SESSION
))
$GLOBALS
[
$key
]=
$value
;
30.
foreach
(
$_FILES
as
$key
=>
$value
){
31.
$GLOBALS
[
$key
]=
$_FILES
[
$key
][
'tmp_name'
];
32.
foreach
(
$value
as
$ext
=>
$value2
){
33.
$key2
=
$key
.
"_"
.
$ext
;
34.
$GLOBALS
[
$key2
]=
$value2
;
35.
}
36.
}
37.
}
38.
?>
39.
<?php
40.
41.
$id_cus
=
$_POST
[
'id_cus'
];
42.
43.
44.
?>
45.
<?php
46.
if
(
$_POST
[Update]){
47.
$sql
="UPDATE `emscomputer_sr`.`customer` SET
48.
`catagory` =
'$select_catagory'
,
49.
`namecus` =
'$txt_namecus'
,
50.
`phonecus_1` =
'$txt_phonecus'
,
51.
`phonecus_2` =
'$txt_phonecus2'
,
52.
`cargo` =
'$select_cargo'
,
53.
`brand` =
'$select_brand'
,
54.
`generation` =
'$txt_generation'
,
55.
`sn` =
'$txt_sn'
,
56.
`option` =
'$txt_option'
,
57.
`problem` =
'$txt_problem'
,
58.
`backup` =
'$txt_backup'
,
59.
`status` =
'$select_status'
,
60.
`solving` =
'$txt_edit'
61.
62.
WHERE `customer`.`ID_cus` =
$id_cus
;
63.
";
64.
65.
if
( mysql_query(
$sql
)
or
die
(mysql_error())); {
66.
67.
echo
"<br><center><h2> บันทึกแล้วจ๊ะ...</h2></center>"
;
68.
69.
exit
;
70.
}
71.
72.
}
else
{
73.
echo
"<br><center><h2>ไม่สามารถเพิ่มข้อมูลได้</h2></center>"
;
74.
echo
"<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1;URL=../print_repair.php\">"
;
75.
}
76.
77.
78.
?>