コード例 #1
0
function drawContainer($guid, $bag)
{
    $item_data = getItemData($guid);
    if ($item_data == 0 || @$item_data[ITEM_FIELD_TYPE] != TYPE_CONTAINER) {
        return;
    }
    $slot = $item_data[CONTAINER_FIELD_NUM_SLOTS];
    echo "<div style=\"position: relative; width: 185px;\">";
    echo generateBagTable($slot);
    $bagico = getItemIconFromItemId($item_data[ITEM_FIELD_ENTRY]);
    echo "<img src={$bagico} width=38 style=\"position: absolute; left: 3px; top: 3px;\">";
    $sub = $slot & 3 ? 21 : 0;
    foreach ($bag as $id => $container) {
        $pos = $id + ($slot & 3);
        $posx = ($pos & 3) * 41 + 16;
        $posy = ($pos >> 2) * 41 + 49 - $sub;
        show_item_by_guid($container['item'], 'armory', $posx, $posy);
    }
    echo "</div>";
}
コード例 #2
0
    $name_exists = $tproject_mgr->check_tplan_name_existence($args->tproject_id, $args->testplan_name);
    $name_id_rel_ok = isset($gui->tplans[$args->tplan_id]) && $gui->tplans[$args->tplan_id]['name'] == $args->testplan_name;
}
// interface changes to be able to do not loose CF values if some problem arise on User Interface
$gui->cfields = $tplan_mgr->html_table_of_custom_field_inputs($args->tplan_id, $args->tproject_id, 'design', '', $_REQUEST);
switch ($args->do_action) {
    case 'fileUpload':
        fileUploadManagement($db, $args->tplan_id, $args->fileTitle, $tplan_mgr->getAttachmentTableName());
        getItemData($tplan_mgr, $gui, $of, $args->tplan_id, true);
        break;
    case 'deleteFile':
        deleteAttachment($db, $args->file_id);
        getItemData($tplan_mgr, $gui, $of, $args->tplan_id, true);
        break;
    case 'edit':
        getItemData($tplan_mgr, $gui, $of, $args->tplan_id);
        break;
    case 'do_delete':
        $tplanInfo = $tplan_mgr->get_by_id($args->tplan_id);
        if ($tplanInfo) {
            $tplan_mgr->delete($args->tplan_id);
            logAuditEvent(TLS("audit_testplan_deleted", $args->tproject_name, $tplanInfo['name']), "DELETE", $args->tplan_id, "testplan");
        }
        //unset the session test plan if it is deleted
        if (isset($_SESSION['testplanID']) && ($_SESSION['testplanID'] = $args->tplan_id)) {
            $_SESSION['testplanID'] = 0;
            $_SESSION['testplanName'] = null;
        }
        break;
    case 'do_update':
        $of->Value = $args->notes;
コード例 #3
0
     getSStatusData();
     break;
 case "getFacilityTypeData":
     getFacilityTypeData();
     break;
 case "getFacilityLevelData":
     getFacilityLevelData();
     break;
 case "getAdjustReasonData":
     getAdjustReasonData();
     break;
 case "getAmcChangeReasonData":
     getAmcChangeReasonData();
     break;
 case "getItemData":
     getItemData();
     break;
 case "getServiceData":
     getServiceData();
     break;
 case "getRegimenData":
     getRegimenData();
     break;
 case "getAgencyShipment":
     getAgencyShipment();
     break;
 case "getStockStatusAtFacility":
     getStockStatusAtFacility();
     break;
 case "getServiceIndicators":
     getServiceIndicators();
コード例 #4
0
ファイル: table.php プロジェクト: J3Sta216/Barroc_IT
        header($path);
        die;
    } else {
        echo 'something went wrong!';
    }
}
if (isset($view)) {
    switch ($view) {
        case 'delete':
            if (deleteTable()) {
                $path = sprintf('location: ' . HTTP_PATH . 'public/views/%s.php', $_POST['page']);
                header($path);
            }
            break;
        case 'edit':
            $list = getItemData($page, $_POST['id']);
            break;
        case 'list':
        case 'add':
            $list = getTableData($page);
            break;
    }
}
//returns a list of all filled rows in the specific table
function getTableData($page)
{
    global $db;
    if (!($_SESSION['user']['user_id'] == 1)) {
        switch ($page) {
            case 'appointments':
                $sql = sprintf('SELECT tbl_%s.* FROM tbl_%s
コード例 #5
0
function show_item_from_char($id, $guid, $style = 'item', $posx = 0, $posy = 0, $empty_item)
{
    global $cDB;
    if ($id != 0) {
        $item_data = $cDB->selectCell("SELECT `guid` FROM `item_instance` WHERE `owner_guid`=?d AND (SUBSTRING_INDEX( SUBSTRING_INDEX(`data` , ' ' , 9) , ' ' , -1 )+0)=?d AND (SUBSTRING_INDEX( SUBSTRING_INDEX(`data` , ' ' , 4) , ' ' , -1 )+0)={$id}", $guid, $guid, $id);
        if ($item_data = getItemData($item_data)) {
            show_item_by_data($item_data, $style, $posx, $posy);
        }
    } else {
        empty_show_item_from_char($style, $posx, $posy, $empty_item);
    }
}
コード例 #6
0
<?php

include_once "include/functions.php";
$str = @$_REQUEST['tip'];
$tip = substr($str, 0, 1);
$entry = intval(substr($str, 1, 10));
switch ($tip) {
    // Показ вещи
    case "i":
        if (substr($str, 1, 1) == 'g') {
            $entry = intval(substr($str, 2, 10));
            if ($item_data = getItemData($entry)) {
                if ($item = getItem($item_data[ITEM_FIELD_ENTRY])) {
                    noBorderItemTable($item, $item_data);
                }
            } else {
                echo "Error item guid {$entry}";
            }
        } else {
            if ($item = getItem($entry)) {
                noBorderItemTable($item, 0, 0);
            } else {
                echo "Error item {$entry}";
            }
        }
        break;
        // Показ  Существа
    // Показ  Существа
    case "c":
        if ($creature = getCreature($entry)) {
            include_once "include/creature_table.php";
コード例 #7
0
   - Высылаемая по почте при завершении квеста
   - Даётся при взятии квеста
   - Лут с мобов
   - Украсть у мобов
   - Ошкурено с мобов
   - Лут с обьектов
   - Лут с очистки руды
   - Лут с вещей
   - Лут с дизэнчанта
   - Лут с рыбалки
*/
// Can be pointer ?item=g1000 - so need load and show item by guid
// Else load item by entry
$str = @$_REQUEST['item'];
if (substr($str, 0, 1) == 'g') {
    $item_data = getItemData(intval(substr($str, 1, 10)));
    $entry = $item_data[ITEM_FIELD_ENTRY];
} else {
    $item_data = 0;
    $entry = intval($str);
}
$page = intval(@$_REQUEST['page']);
$mark = @$_REQUEST['mark'];
// Получаем вещь
$item = getItem($entry);
if (!$item) {
    RenderError("{$lang['item_not_found']}");
} else {
    $baseLink = '?item=' . $str;
    if ($ajaxmode == 0) {
        if ($lang['www_item']) {
コード例 #8
0
ファイル: index.php プロジェクト: nferrara100/BearcatExchange
function updateItem()
{
    global $con;
    global $session;
    global $theUser;
    global $errors;
    global $startTime;
    if ($theUser['loggedIn']) {
        $itemId = intval($_POST['itemId']);
        $insert = "SELECT `user_id` FROM `textbooks` WHERE `id` = " . $itemId;
        if (intval(mysqli_fetch_array(mysqli_query($con, $insert))['user_id']) == $theUser['id']) {
            $item = getItemData();
            if ($_POST['status'] == "sold") {
                $item['status'] = "sold";
            }
            if ($_POST['status'] == "unsold") {
                $item['status'] = "unsold";
            }
            if ($_POST['renew']) {
                $item['renew'] = getNewExpirationDate()->format('Y-m-d H:i:s');
                $_POST['time'] = 'true';
                $item['time'] = $startTime->format('Y-m-d H:i:s');
            }
            $overviewQuery = "SELECT `id`, `user_id`, `title`, `author`, `price`, `time`, `renew`, `course`, `comments`, `status` FROM textbooks WHERE `id` = {$itemId}";
            $beginningState = mysqli_fetch_array(mysqli_query($con, $overviewQuery));
            $textbooksUpdate = "UPDATE `textbooks` SET";
            $updates = "INSERT INTO `updates` (`textbook_id`, `session`";
            $updatesValues = "VALUES ({$itemId}, '" . $session['hash'] . "'";
            $previousInTextbooks = false;
            foreach ($item as $key => $value) {
                if (isset($_POST[$key]) && $item[$key] != $beginningState[$key]) {
                    $textbooksUpdate .= ($previousInTextbooks ? "," : "") . " `{$key}` = '" . $item[$key] . "'";
                    $previousInTextbooks = true;
                    $updates .= ", `{$key}`, `previous_{$key}`";
                    $updatesValues .= ", '" . $item[$key] . "', '" . $beginningState[$key] . "'";
                }
            }
            $textbooksUpdate .= " WHERE `id` = " . $itemId;
            $updates .= ") " . $updatesValues . ");";
            mysqli_query($con, $textbooksUpdate);
            mysqli_query($con, $updates);
            $endingState = mysqli_fetch_array(mysqli_query($con, $overviewQuery));
            $result["misc"] = "success";
            $result['item'] = $endingState;
            $renewDate = new Datetime($result['item']['renew']);
            $result['item']['renewFormatted'] = $renewDate->format("F j, Y");
        } else {
            $result["misc"] = 'Wrong user';
        }
    } else {
        $result["misc"] = 'Not logged in';
    }
    mysqli_close($con);
    die(json_encode($result));
}