<?php

if ($_POST) {
    include_once $_SERVER['DOCUMENT_ROOT'] . '/config/database.php';
    include_once $_SERVER['DOCUMENT_ROOT'] . '/objects/items.php';
    $database = new database();
    $db = $database->getConnection();
    $items = new items($db);
    $items->item_kode = $_POST['object_id'];
    if ($items->delete()) {
        echo "Jasa berhasil dihapus.";
    } else {
        echo "Jasa tidak bisa dihapus.";
    }
}
Exemple #2
0
<?php

// +----------------------------------------------------------------------
// | Demila [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
define('USING_LANGUAGE', false);
require_once '../../../config.php';
require_once $config['root_path'] . '/core/functions.php';
include_once $config['system_core'] . "/initEngine.php";
admin_login();
if (isset($_POST['delete']) && isset($_POST['id']) && isset($_SESSION['user']['access']['items'])) {
    require_once ROOT_PATH . "/apps/items/models/items.class.php";
    $cms = new items();
    $cms->delete(intval($_POST['id']));
    die(json_encode(array_merge($_POST, array('status' => 'true'))));
} elseif (isset($_POST['deleteComment']) && isset($_POST['id']) && isset($_SESSION['user']['access']['items'])) {
    require_once ROOT_PATH . "/apps/items/models/comments.class.php";
    $cms = new comments();
    $cms->delete(intval($_POST['id']));
    die(json_encode(array_merge($_POST, array('status' => 'true'))));
}
echo json_encode(array_merge($_POST, array('status' => 'unknown error')));
die;
Exemple #3
0
        addErrorMessage($message, '', 'error');
    }
} elseif (isset($_POST['upload'])) {
    $s = $itemsClass->edit_upload($itemID);
    if ($s === true) {
        refresh('/' . $languageURL . 'items/' . $itemID . '/', $langArray['complete_update_upload_item'], 'complete');
    } else {
        $message = '<ul>';
        foreach ($s as $e) {
            $message .= '<li>' . $e . '</li>';
        }
        $message .= '</ul>';
        addErrorMessage($message, '', 'error');
    }
} elseif (isset($_POST['delete'])) {
    $itemsClass->delete($itemID);
    refresh('/' . $languageURL . 'users/dashboard/', $langArray['complete_delete_item'], 'complete');
} else {
    $_POST = $item;
    unset($_POST['tags']);
    if (isset($item['tags']) && is_array($item['tags'])) {
        foreach ($item['tags'] as $type => $arr) {
            foreach ($arr as $t) {
                if (!isset($_POST['tags'][$type])) {
                    $_POST['tags'][$type] = '';
                }
                $_POST['tags'][$type] .= $t . ',';
            }
        }
    }
}