Example #1
0
$proccasttype = array(0 => "None/Proc");
$worncasttype = array(0 => "None", 2 => "Worn");
$focuscasttype = array(0 => "None", 6 => "Focus");
$scrollcasttype = array(0 => "None", 7 => "Scroll");
switch ($action) {
    case 0:
        //Default
        check_authorization();
        $body = new Template("templates/items/items.default.tmpl.php");
        break;
    case 1:
        // Search items
        check_authorization();
        $body = new Template("templates/items/items.searchresults.tmpl.php");
        if (isset($_GET['id']) && $_GET['id'] != "ID") {
            $results = search_item_by_id();
        } else {
            $results = search_items();
        }
        $body->set("results", $results);
        break;
    case 2:
        // Edit Item
        check_authorization();
        $javascript = new Template("templates/iframes/js.tmpl.php");
        $body = new Template("templates/items/items.edit.tmpl.php");
        $body->set("itemsize", $itemsize);
        $body->set("itemmaterial", $itemmaterial);
        $body->set("itemtypes", $itemtypes);
        $body->set("itemldontheme", $itemldontheme);
        $body->set("skilltypes", $skilltypes);
Example #2
0
<?php

session_start();
require_once 'includes/connect_db.php';
# Includes these helper functions
require_once 'includes/search_helper.php';
require_once 'includes/item_helper.php';
# If no id is set, give it a default of -1
if (empty($_GET['id'])) {
    $_GET['id'] = -1;
}
# Search for the item specified by id in the database
$data = search_item_by_id($dbc, $_GET['id']);
if ($data == -1) {
    # If no id matches, redirect to the search page
    header("Location: /searchreport.php");
}
if (isset($_POST['action'])) {
    # If the admin specified an update/delete action, perform it now
    perform_action($dbc, $_GET['id'], $_POST['action']);
    # Refresh to show updates
    header("Refresh:0");
}
?>

<head>
<title>Limbo - Item</title>
<link rel="stylesheet" type="text/css" href="limbo.css">
</head>
<?php 
include 'header.php';