Exemple #1
0
            break;
    }
    header("Location: index.php");
    exit;
}
// Удаление объявления
if (isset($_GET['delete'])) {
    $del_id = (int) $_GET['delete'];
    Ad::delAd($db, $del_id);
    header("Location: index.php");
    exit;
}
// Показ конкретного объявления
if (isset($_GET['show'])) {
    $edit_id = (int) $_GET['show'];
    $editAd = Ad::showAd($db, $edit_id);
    $smarty->assign('id', $edit_id);
    $smarty->assign('title', $editAd->getTitle());
    $smarty->assign('price', $editAd->getPrice());
    $smarty->assign('seller_name', $editAd->getSeller_name());
    $smarty->assign('description', $editAd->getDescription());
    $smarty->assign('email', $editAd->getEmail());
    $smarty->assign('phone', $editAd->getPhone());
    $smarty->assign('private', $editAd->getPrivate());
    $smarty->assign('allow_mails', $editAd->getAllow_mails());
    $smarty->assign('location_id', $editAd->getLocation_id());
    $smarty->assign('category_id', $editAd->getCategory_id());
}
$smarty->assign('location_sel', 641780);
// Выбранный город по умолчанию
$smarty->assign('location', ServiceFunction::location_id($db));