diff --git a/pages/advertising/0.php b/pages/advertising/0.php index 2d4666e..bd0735c 100644 --- a/pages/advertising/0.php +++ b/pages/advertising/0.php @@ -31,6 +31,21 @@ echo "

The ad was approved and is now active.

\n"; } } + if(intval($_REQUEST['deactive']) > 0 && $_SESSION['profile']['adadmin'] >= 2) + { + $deactive = intval($_REQUEST['deactive']); + $query = "select * from `advertising` where `id`='$deactive'"; + $res = mysql_query($query); + if(mysql_num_rows($res) > 0) + { + $row = mysql_fetch_assoc($res); + $end = date("Y-m-d H:i:s", mktime(date("H"), date("i"), date("s"), date("m")+$row['months'], date("d"), date("Y"))); + $query = "update `advertising` set `active`=0 where `id`='$deactive'"; + mysql_query($query); + echo "

The ad was deactivated and is now inactive.

\n"; + } + } + ?>