Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header("Location-Type: text/html; charset=utf-8;");
- $ke = $_GET["key"];
- $type = $_POST["type_box"];
- $type = utf8_decode($type);
- if (isset($ke)) {
- include ('connect.php');
- if ($type == 'Vendido') {
- $q = mysql_query("select image from ads where adsid='$ke'");
- if ($q) {
- if (mysql_num_rows($q)) {
- $r = mysql_fetch_array($q);
- $img = $r["image"];
- $l = "ads/thumbs/".$img;
- unlink($l);
- $query = mysql_query("delete from ads where adsid='$ke'");
- if ($query) {
- echo "<script>alert('Obrigado por usar o CLS Classificados.\n Seu anúncio foi excluído do banco de dados pela alteração de status para Vendido.');</script>";
- echo "<script>window.setTimeout(\"location.href='index.php?pg=profile';\", 1000);</script>";
- }
- $s = mysql_query("update users set adsid=-1 where adsid='$ke'");
- }
- }
- } else {
- $q = mysql_query("update ads set status='$type' where adsid='$ke'");
- if ($q) {
- echo "<script>alert('Status alterado com sucesso!');</script>";
- echo "<script>window.setTimeout(\"location.href='index.php?pg=profile';\", 1000);</script>";
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement