Exemplo n.º 1
0
ini_set('display_errors', 1);
require 'connect_to_db.php';
require_once __DIR__ . "/firephp/FirePHP.class.php";
$firePHP = FirePHP::getInstance(true);
$firePHP->setEnabled(true);
require 'HtmlOption.php';
require 'functions_DbSimple.php';
require 'Ad.php';
require 'AdStorage.php';
require 'AdCompany.php';
require 'AdPrivate.php';
$db->setErrorHandler('databaseErrorHandler');
$db->setLogger('myLogger');
if (!empty($_GET['action']) && $_GET['action'] === 'delete') {
    $ad = new Ad();
    $ad->setId($_GET['id']);
    echo $ad->delete($db);
    die;
}
$smarty_dir = __DIR__ . '/smarty/';
require_once $smarty_dir . 'libs/Smarty.class.php';
$smarty = new Smarty();
$smarty->compile_check = true;
$smarty->debugging = true;
$smarty->template_dir = $smarty_dir . 'templates/';
$smarty->compile_dir = $smarty_dir . 'templates_c/';
$smarty->config_dir = $smarty_dir . 'configs/';
$smarty->cache_dir = $smarty_dir . 'cache/';
if (!empty($_POST)) {
    $id = !empty($_POST['id']) ? $_POST['id'] : null;
    if ($_POST['type'] === 'private') {