function mysticalshop_uninstall()
{
    require_once './modules/mysticalshop/run/editor_what/delete.php';
    $items = db_query('SELECT id FROM ' . db_prefix('magicitems'));
    while ($item = db_fetch_assoc($items)) {
        mysticalshop_delete_item($item['id']);
    }
    $sql = 'DROP TABLE IF EXISTS ' . db_prefix('magicitems');
    db_query($sql);
    if (getsetting('usedatacache', false)) {
        require_once './modules/mysticalshop/libcoredup.php';
        mysticalshop_massinvalidate('modules-mysticalshop-');
    }
}
<?php

$mode = httpget('mode');
if ($mode == 'delete' && is_numeric($id)) {
    require_once './modules/mysticalshop/run/editor_what/delete.php';
    mysticalshop_delete_item($id);
}
$edit = translate_inline("Edit");
$del = translate_inline("Delete");
$give = translate_inline("Preview");
$delconfirm = translate_inline("Are you sure you wish to delete this item?");
$sql = 'SELECT * FROM ' . db_prefix('magicitems') . ' WHERE id>=0 AND category=' . $cat . ' ORDER BY gold';
$result = db_query_cached($sql, 'modules-mysticalshop-view-' . $cat, 3600);
$count = db_num_rows($result);
if ($count == 0) {
    if ($cat != 100) {
        output('`6No items in %s department on record yet.`0', $names[$cat]);
    } else {
        output('`6No items on record yet.`0');
    }
} else {
    $ops = translate_inline('Operations');
    $itemid = translate_inline("Item ID");
    $name = translate_inline("Name");
    $goldc = translate_inline("Cost Gold");
    $gemc = translate_inline("Cost Gems");
    $cate = translate_inline("Category");
    rawoutput('<table cellspacing="2" cellpadding="2" width="100%">');
    rawoutput('<tr class="trhead"><td>' . $ops . '</td><td>' . $itemid . '</td><td>' . $name . '</td><td>' . $goldc . '</td><td>' . $gemc . '</td><td>' . $cate . '</td></tr>');
    $i = false;
    while ($row = db_fetch_assoc($result)) {