0 && $_SESSION['profile']['adadmin'] >= 2) { $approve = intval($_REQUEST['approve']); $query = "select * from `advertising` where `id`='$approve' and `expires`='0000-00-00 00:00:00'"; $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 `expires`='$end', `active`=1, `approvedby`='".$_SESSION['profile']['id']."' where `id`='$approve'"; mysql_query($query); 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"; } } ?> Approve\n"; } ?> 0 "; $query .= "order by `id` desc"; $res = mysql_query($query); while($row = mysql_fetch_assoc($res)) { if($row['expires'] == "0000-00-00 00:00:00") $status = "Pending"; else if($row['active'] == 1 && $row['timeleft'] > 0) $status = "Active"; else if($row['timeleft'] <= 0) $status = "Expired"; else if($row['active'] != 1) $status = "Disabled"; else $status = "Unknown"; echo ""; echo ""; echo ""; if($_SESSION['profile']['adadmin'] == 2) { if($status == "Pending" && $row['expires'] == "0000-00-00 00:00:00") echo ""; else if($status == "Active") echo ""; else echo ""; } echo "\n"; } ?>
ID Link Status Expires Edit Disable
".$row['id']."".$row['title']."$status".$row['expires']."EditDisableApproveDe-ActivateN/A