예제 #1
0
파일: SQL.php 프로젝트: aerozik/Caranille
function showMonsterDrops($bdd, $monsterID)
{
    global $atown19, $atown20, $amonsterDrop3;
    $showMonsterDrop = $bdd->prepare('SELECT * FROM Caranille_Monsters_Drops
	WHERE Monster_Drop_Monster_ID = ?
	');
    $showMonsterDrop->execute([$monsterID]);
    ?>
	<br>
	<table class="table">
		<tr>
			<th></th>
            <th></th>
            <th></th>
        </tr>
    <?php 
    while ($item = $showMonsterDrop->fetch()) {
        $monsterDropID = stripslashes($item['Monster_Drop_ID']);
        ?>
        <tr>
            <td>
            	<?php 
        echo newItem($bdd, $item['Monster_Drop_Item_ID'])->getName();
        ?>
            </td>
            <td>
            	<?php 
        echo $item['Monster_Drop_Luck'] . "/1000";
        ?>
            </td>
        	<td>
        		<form method="POST" action="Delete.php">
            		<input type="hidden" name="monsterDropID" value="<?php 
        echo $monsterDropID;
        ?>
">
            		<input type="hidden" name="monsterID" value="<?php 
        echo $monsterID;
        ?>
">
            		<input class="btn btn-warning" type="submit" value="<?php 
        echo $amonsterDrop3;
        ?>
">
            	</form>
            </td>
        </tr>
        <?php 
    }
    ?>
    </table>
    <?php 
    $showMonsterDrop->closeCursor();
}
예제 #2
0
function showItemTown($bdd, $townID)
{
    global $atown27, $atown28;
    $showItemTown = $bdd->prepare('SELECT * FROM Caranille_Towns_Items 
	WHERE Town_Item_Town_ID = ? 
	ORDER BY Town_Item_ID desc');
    $showItemTown->execute([$townID]);
    ?>
	<br><table class="table">
		<tr>
			<th><?php 
    echo $atown28;
    ?>
</th>
            <th></th>
        </tr>
    <?php 
    while ($item = $showItemTown->fetch()) {
        $itemID = $item['Town_Item_Item_ID'];
        $townItemID = $item['Town_Item_ID'];
        ?>
        <tr>
            <td>
            	<?php 
        echo newItem($bdd, $itemID)->getName();
        ?>
            </td>
        	<td>
        		<form method="POST" action="Delete.php">
            		<input type="hidden" name="townID" value="<?php 
        echo $townID;
        ?>
">
            		<input type="hidden" name="townItemID" value="<?php 
        echo $townItemID;
        ?>
">
            		<input class="btn btn-warning" type="submit" value="<?php 
        echo $atown27;
        ?>
">
            	</form>
            </td>
        </tr>
        <?php 
    }
    ?>
    </table>
    <?php 
    $showItemTown->closeCursor();
}
예제 #3
0
<?php

$timeStart = microtime(true);
session_start();
ob_start();
if (empty($_SESSION)) {
    exit(header("Location: ../../index.php"));
}
require_once $_SESSION['File_Root'] . '/Kernel/Include.php';
require_once $_SESSION['File_Root'] . '/HTML/Header.php';
require_once 'Functions/SQL.php';
redirectToLogin($accountID, $linkRoot);
redirectToBattle($verifyBattle, $linkRoot);
$inventoryID = htmlspecialchars(addslashes($_POST['inventoryID']));
$itemID = htmlspecialchars(addslashes($_POST['itemID']));
$parchment = newItem($bdd, $itemID);
$parchmentHP = $parchment->getHP();
$parchmentMP = $parchment->getMP();
$parchmentStrength = $parchment->getStrength();
$parchmentMagic = $parchment->getMagic();
$parchmentAgility = $parchment->getAgility();
$parchmentDefense = $parchment->getDefense();
$parchmentWisdom = $parchment->getSagesse();
addStats($bdd, $parchmentHP, $parchmentMP, $parchmentStrength, $parchmentMagic, $parchmentAgility, $parchmentDefense, $parchmentWisdom, $characterID);
deleteItem($bdd, $itemID, $characterID);
updateStats($bdd, $characterID);
updateAllStats($bdd, $characterID);
exit(header("Location: {$linkRoot}/Modules/Inventory/index.php"));
require_once $_SESSION['File_Root'] . '/HTML/Footer.php';
예제 #4
0
<?php

$timeStart = microtime(true);
session_start();
if (empty($_SESSION)) {
    exit(header("Location: ../../index.php"));
}
require_once $_SESSION['File_Root'] . '/Kernel/Include.php';
require_once $_SESSION['File_Root'] . '/HTML/Header.php';
require_once 'Functions/SQL.php';
redirectToLogin($accountID, $linkRoot);
redirectToBattle($verifyBattle, $linkRoot);
hasAdmin($accountAccess);
$itemID = htmlspecialchars(addslashes($_POST['itemID']));
$item = newItem($bdd, $itemID);
$itemImage = $item->getPicture();
$itemType = $item->getType();
$itemLevel = $item->getLevel();
$itemName = $item->getName();
$itemDescription = $item->getDescription();
$itemHP = $item->getHP();
$itemMP = $item->getMP();
$itemPurchase = $item->getPurchase();
$itemSale = $item->getSale();
?>
	
<br>
<div class="panel panel-warning">
	<div class="panel-heading"></div>
	<div class="panel-body">
		<form method="POST" action="EndEdit.php">
예제 #5
0
            print_time_row('Expire Date<dfn>Only work if select NO in "Item NEVER expires"</dfn>', 'exp', $item['expire_time'], false);
        }
        print_radio_row('Add Another Item', 'addmore', array(2 => 'Yes, with the same options (ItemType/Auction)', 1 => 'Yes', 0 => 'No'), 2);
        print_submit_row($vbphrase['add'], 0);
    }
    print_cp_footer();
}
if ($_GET['do'] == "do_item_update") {
    $vbulletin->input->clean_array_gpc('p', array('auction' => TYPE_UINT, 'auction_exp' => TYPE_ARRAY, 'itemid' => TYPE_UINT, 'item' => TYPE_ARRAY, 'quantity' => TYPE_UINT, 'forever' => TYPE_UINT, 'exp' => TYPE_ARRAY, 'duration' => TYPE_INT, 'delete' => TYPE_UINT, 'addmore' => TYPE_UINT));
    $item = $vbulletin->GPC['item'];
    $item['options'] = array();
    $itemtype_obj = newItemType($item['type']);
    $itemtype = $itemtype_obj->data;
    if ($vbulletin->GPC['itemid']) {
        $edit = true;
        $item_obj =& newItem($vbulletin->GPC['itemid']);
        if (!$item_obj) {
            print_stop_message('kbank_no_permission');
        }
        $item_tmp = $item_obj->data;
        $item['options'] = $item_tmp['options'];
        if ($vbulletin->GPC['delete']) {
            if ($item_obj) {
                $vbulletin->db->query_write("\n\t\t\t\t\tUPDATE `" . TABLE_PREFIX . "kbank_items`\n\t\t\t\t\tSET status = " . KBANK_ITEM_DELETED . "\n\t\t\t\t\tWHERE itemid = {$vbulletin->GPC[itemid]}");
                logkBankAction('admin_item_delete', $vbulletin->GPC['itemid']);
                //Fix auction notices issue 30-12-2008
                updateWarningItem();
                define('CP_REDIRECT', 'kbankadmin.php?do=item_man');
                print_stop_message('kbank_item_deleted', $item['name'], $vbulletin->GPC['itemid']);
            } else {
                print_stop_message('kbank_item_delete_failed');
예제 #6
0
파일: functions.php 프로젝트: 0hyeah/yurivn
function findAnnounce()
{
    global $vbulletin, $vbphrase, $admincpdir, $kbank_system_announces;
    if ($vbulletin->kbank_announces) {
        foreach ($vbulletin->kbank_announces as $itemdata) {
            $item_obj =& newItem($itemdata['itemid'], $itemdata);
            if ($item_obj =& newItem($itemdata['itemid'], $itemdata) and $item_obj->data['status'] == KBANK_ITEM_ENABLED and ($item_obj->data['expire_time'] > TIMENOW or $item_obj->data['expire_time'] < 0)) {
                $item_obj->doAction('work_real');
            }
        }
    }
    if ($vbulletin->kbank_warningitems) {
        $need2warn = array();
        foreach ($vbulletin->kbank_warningitems as $itemdata) {
            if (!is_array($itemdata['options'])) {
                $itemdata['options'] = unserialize($itemdata['options']);
            }
            switch ($itemdata['status']) {
                case KBANK_ITEM_PENDING:
                    if (($itemdata['expire_time'] > TIMENOW or $itemdata['expire_time'] < 0) and havePerm($vbulletin->userinfo, KBANK_PERM_ADMIN)) {
                        //check pending item if user is kBank Admin
                        $found = false;
                        if (is_array($itemdata['options']['approved'])) {
                            foreach ($itemdata['options']['approved'] as $userid => $username) {
                                if ($userid == $vbulletin->userinfo['userid']) {
                                    $found = true;
                                }
                            }
                        }
                        if (!$found) {
                            $need2warn['pending']++;
                        }
                    }
                    break;
                case KBANK_ITEM_BIDDING:
                    if (havePerm($vbulletin->userinfo, KBANK_PERM_COMPANY)) {
                        //check bidding item if user has kBank Company permission
                        $bid = $highestBid = array();
                        if (is_array($itemdata['options']['bids'])) {
                            foreach ($itemdata['options']['bids'] as $record) {
                                if ($record['userid'] == $vbulletin->userinfo['userid'] or is_array($vbulletin->userinfo['kbank_granted']) and in_array($record['userid'], array_keys($vbulletin->userinfo['kbank_granted']))) {
                                    $bid = $record;
                                }
                                if (bid_cmp($record, $highestBid) > 0) {
                                    $highestBid = $record;
                                }
                            }
                        }
                        if ($itemdata['expire_time'] > TIMENOW) {
                            if (!count($bid)) {
                                $need2warn['bidding']++;
                            } else {
                                if (bid_cmp($bid, $highestBid) < 0) {
                                    $need2warn['bidding_higher']++;
                                }
                            }
                        } else {
                            if (count($bid) and bid_cmp($bid, $highestBid) == 0) {
                                $need2warn['bidding_win']++;
                            }
                        }
                    }
                    break;
            }
        }
        if ($need2warn['pending']) {
            $kbank_system_announces[] = array('url' => "{$admincpdir}/index.php?loc=kbankadmin.php%3Fdo%3Ditem_man", 'text' => construct_phrase($vbphrase['kbank_announce_item_pending'], $need2warn['pending']), 'css' => 'color: red; font-weight: bold');
        }
        if ($need2warn['bidding']) {
            $kbank_system_announces[] = array('url' => $vbulletin->kbank['phpfile'] . '?do=shop', 'text' => construct_phrase($vbphrase['kbank_announce_item_bidding'], $need2warn['bidding']), 'css' => 'color: green; font-weight: bold');
        }
        if ($need2warn['bidding_higher']) {
            $kbank_system_announces[] = array('url' => $vbulletin->kbank['phpfile'] . '?do=shop', 'text' => construct_phrase($vbphrase['kbank_announce_item_bidding_higher'], $need2warn['bidding_higher']), 'css' => 'color: red; font-weight: bold');
        }
        if ($need2warn['bidding_win']) {
            $kbank_system_announces[] = array('url' => $vbulletin->kbank['phpfile'] . '?do=shop', 'text' => construct_phrase($vbphrase['kbank_announce_item_bidding_win'], $need2warn['bidding_win']), 'css' => 'color: green; font-weight: bold');
        }
    }
}
예제 #7
0
$vbulletin->db->hide_errors();
//Get statistics
$money = getStatistics(true);
$log = array('type' => KBANK_LOGTYPE_STAT, 'userid' => 0, 'timeline' => TIMENOW, 'text1' => '', 'int1' => $money['member'], 'detail' => serialize($money));
$vbulletin->db->query_write(fetch_query_sql($log, 'kbank_logs'));
// log the cron action
kbank_log_cron_action('Cached kBank Information');
//Any KBANK_ITEM_USED_WAITING items?
$items = $vbulletin->db->query_read("\n\tSELECT *\n\tFROM `" . TABLE_PREFIX . "kbank_items` AS items\n\tWHERE items.status = " . KBANK_ITEM_USED_WAITING . "\n\t\tAND items.expire_time <= " . TIMENOW . "\n\t\t\tAND items.expire_time > 0\n");
if (!$vbulletin->kbank_itemtypes) {
    $vbulletin->kbank_itemtypes = updateItemTypeCache();
}
if ($vbulletin->db->num_rows($items)) {
    $itemids = array();
    while ($itemdata = $vbulletin->db->fetch_array($items)) {
        if ($item =& newItem($itemdata['itemid'], $itemdata)) {
            if ($status = $item->doAction('work_expired')) {
                $itemids[] = "#{$itemdata['itemid']} ({$status})";
            }
            $item->destroy();
        }
    }
    unset($itemdata);
    $vbulletin->db->free_result($items);
    // log the cron action
    kbank_log_cron_action('Processed KBANK_ITEM_USED_WAITING item(s): ' . implode(', ', $itemids));
}
//Clear shout box
$vbulletin->db->query_write("\n\tDELETE FROM `" . TABLE_PREFIX . "shout`\n\tWHERE s_time < " . TIMENOW . " - 24*60*60\n");
// log the cron action
if ($vbulletin->db->affected_rows() > 0) {
예제 #8
0
파일: kbank.php 프로젝트: 0hyeah/yurivn
     }
 } else {
     $message = array();
     foreach ($processed as $itemid) {
         $item = null;
         $actiontype = '';
         $error_message = array();
         foreach (array_keys($ours) as $type) {
             eval('$check = in_array($itemid,$' . $type . '_ids) AND isset($' . $type . '_done[$itemid]);');
             if ($check) {
                 $actiontype = $type;
                 eval('$item =& $' . $type . '_done[$itemid];');
             }
         }
         if ($item or $item == null and isset($errors[$itemid])) {
             $item_obj =& newItem($itemid);
             $item = $item_obj->data;
             if (isset($errors[$itemid])) {
                 $errors_tmp =& $errors[$itemid];
                 foreach ($errors_tmp as $error) {
                     if ($error == KBANK_ERROR_NO_PERM) {
                         $error_message[] = $vbphrase['kbank_multitask_error_no_perm'];
                     } else {
                         $error_message[] = $error;
                     }
                 }
             }
             $message_tmp = '<strong>' . $vbphrase['kbank_' . $actiontype] . '</strong> "<em>' . $item['name'] . '</em>"';
             if (count($error_message)) {
                 $message_tmp .= ' (' . $vbphrase['kbank_multitask_error'] . ')' . '<ul><li>' . implode('</li><li>', $error_message) . '</li></ul>';
             } else {
예제 #9
0
<?php

$timeStart = microtime(true);
session_start();
if (empty($_SESSION)) {
    exit(header("Location: ../../index.php"));
}
require_once $_SESSION['File_Root'] . '/Kernel/Include.php';
require_once $_SESSION['File_Root'] . '/HTML/Header.php';
require_once 'Functions/SQL.php';
redirectToLogin($accountID, $linkRoot);
redirectToBattle($verifyBattle, $linkRoot);
hasAdmin($accountAccess);
$parchmentID = htmlspecialchars(addslashes($_POST['parchmentID']));
$parchment = newItem($bdd, $parchmentID);
$parchmentPicture = $parchment->getPicture();
$parchmentLevel = $parchment->getLevel();
$parchmentName = $parchment->getName();
$parchmentDescription = $parchment->getDescription();
$parchmentHP = $parchment->getHP();
$parchmentMP = $parchment->getMP();
$parchmentStrength = $parchment->getStrength();
$parchmentMagic = $parchment->getMagic();
$parchmentAgility = $parchment->getAgility();
$parchmentDefense = $parchment->getDefense();
$parchmentWisdom = $parchment->getSagesse();
$parchmentPurchase = $parchment->getPurchase();
$parchmentPurchase = $parchment->getPurchase();
$parchmentSale = $parchment->getSale();
?>