01.
<?
02.
include
(
"connect.inc"
);
03.
?>
04.
<?
05.
$strSQL
=
"UPDATE animal SET "
;
06.
$strSQL
.=
"Enable = 'F' "
;
07.
$strSQL
.=
"WHERE an_id = '"
.
$_POST
[
"text_an_id"
].
"' "
;
08.
$objQuery
= mssql_query(
$strSQL
);
09.
?>
10.
<?
11.
$strSQL
=
"INSERT INTO animal"
;
12.
$strSQL
.=
"(an_tel1,ThaiName,EngName,an_word,an_type,an_orther,Address, an_province,an_amphur,an_district,an_zip,an_fax1,an_fax2,an_mail, an_web, an_hotline,an_busi,an_bg,an_service,an_detail,an_price,an_branch, an_commonday,an_holiday,an_note,an_town1,an_town2,an_town3, an_town4,an_rate,an_animal_service,an_con_name,an_c_name, an_c_lastname,an_c_tel1,an_c_tel2,an_c_add,an_c_province, an_c_amphur,an_c_district,an_c_zip,Updated,UpdatedBy,IsActive,Enable)"
;
13.
$strSQL
.=
"VALUES "
;
14.
$strSQL
.=
"('"
.
$_POST
[
"text_an_tel1"
].
"','"
.
$_POST
[
"text_an_name"
].
"','"
.
$_POST
[
"text_an_name2"
].
"', '"
.
$_POST
[
"text_an_word"
].
"','"
.
$_POST
[
"select_an_type"
].
"','"
.
$_POST
[
"text_an_orther"
].
"' ,'"
.
$_POST
[
"text_an_add"
].
"','"
.
$_POST
[
"select_an_province"
].
"','"
.
$_POST
[
"select_an_amphur"
].
"' ,'"
.
$_POST
[
"select_an_district"
].
"','"
.
$_POST
[
"text_an_zip"
].
"','"
.
$_POST
[
"text_an_fax1"
].
"' ,'"
.
$_POST
[
"text_an_fax2"
].
"','"
.
$_POST
[
"text_an_mail"
].
"','"
.
$_POST
[
"text_an_web"
].
"' ,'"
.
$_POST
[
"text_an_hotline"
].
"','"
.
$_POST
[
"select_an_busi"
].
"','"
.
$_POST
[
"select_an_bg"
].
"', '"
.
$_POST
[
"select_an_service"
].
"','"
.
$_POST
[
"area_an_detail"
].
"','"
.
$_POST
[
"text_an_price"
].
"' ,'"
.
$_POST
[
"area_an_branch"
].
"','"
.
$_POST
[
"text_an_commonday"
].
"','"
.
$_POST
[
"text_an_holiday"
].
"' ,'"
.
$_POST
[
"area_an_note"
].
"','"
.
$_POST
[
"text_an_town1"
].
"','"
.
$_POST
[
"text_an_town2"
].
"', '"
.
$_POST
[
"text_an_town3"
].
"','"
.
$_POST
[
"text_an_town4"
].
"','"
.
$_POST
[
"select_an_rate"
].
"' ,'"
.
$_POST
[
"text_an_animal_service"
].
"','"
.
$_POST
[
"text_an_con_name"
].
"','"
.
$_POST
[
"text_an_c_name"
].
"' ,'"
.
$_POST
[
"text_an_c_lastname"
].
"','"
.
$_POST
[
"text_an_c_tel1"
].
"','"
.
$_POST
[
"text_an_c_tel2"
].
"' ,'"
.
$_POST
[
"text_an_c_add"
].
"','"
.
$_POST
[
"select_an_c_province"
].
"','"
.
$_POST
[
"select_an_c_amphur"
].
"' ,'"
.
$_POST
[
"select_an_c_district"
].
"','"
.
$_POST
[
"text_an_c_zip"
].
"','"
.
$_POST
[
"text_an_user_modify"
].
"', '"
.
$_POST
[
"text_an_date_modify"
].
"','"
.
$_POST
[
"IsActive"
].
"','"
.
$_POST
[
"text_enable"
].
"') "
;
15.
$objQuery
= mssql_query(
$strSQL
);
16.
if
(
$objQuery
)
17.
{
18.
echo
"<script language=\"JavaScript\">"
;
19.
echo
"alert('แก้ไขเรียบร้อย');"
;
20.
echo
"</script>"
;
21.
echo
"<script>window.location.href='animal_show.php';</script>"
;
22.
}
23.
else
24.
{
25.
echo
"Error Save ["
.
$strSQL
.
"]"
;
26.
}
27.
mssql_close(
$objConnect
);
28.
?>