01.
<?
02.
03.
include
"config/connect.php"
;
04.
05.
$dur_id
=
$_GET
[
'dur_id'
];
06.
07.
$sql
=
"SELECT * FROM duration WHERE dur_id = '$dur_id'"
;
08.
$result
= mysql_query(
$sql
);
09.
$show
= mysql_fetch_array(
$result
);
10.
11.
12.
$dur_status
=
$_GET
[
'dur_status'
];
13.
14.
if
(
$dur_status
==
'0'
){
15.
$sql
=
"UPDATE duration SET dur_status = '1' WHERE dur_id = '$dur_id'"
;
16.
$result
= mysql_query(
$sql
);
17.
header(
"location: addDurationAdmin.php"
);
18.
}
else
if
(
$dur_status
==
'1'
){
19.
$sql
=
"UPDATE duration SET dur_status = '0' WHERE dur_id = '$dur_id'"
;
20.
$result
= mysql_query(
$sql
);
21.
header(
"location: addDurationAdmin.php"
);
22.
}
23.
?>