Exemple #1
0
				<div id="playzone">
					<div id="overflow">
						<div id="winner_banner">
							<div id="winner_text">
								<span id="winner_steam_name"></span> has just won <span id="winner_amount"></span> with a <span id="winner_chance"></span> chance!<br><span id="ticket">Winning Ticket: <span id="winner_ticket"></span></span>
							</div>
						</div>
					</div>
					<?php 
$current_pot_id = $global_info["current_pot_id"];
query_getAllPotItems($mysqli, $pot_items, $current_pot_id);
$users_in_pot = array();
if ($pot_items) {
    foreach ($pot_items as $pot_item) {
        $item_id = $pot_item["item_id"];
        query_getItemByItemID($mysqli, $inventory_item, $item_id);
        $user_id = $inventory_item["user_id"];
        if (!array_key_exists($user_id, $users_in_pot)) {
            $users_in_pot[$user_id] = array();
        }
        array_push($users_in_pot[$user_id], $inventory_item);
    }
}
foreach ($users_in_pot as $user_id => $user_items) {
    query_getUserByUserID($mysqli, $user_data, $user_id);
    $totalPricing = 0;
    foreach ($user_items as $item) {
        query_getItemInformationByInfoID($mysqli, $item_info, $item["item_information_id"]);
        $totalPricing += $item_info["price"];
    }
    ?>
Exemple #2
0
 $current_pot_id = $global_info["current_pot_id"];
 query_getPot($mysqli, $current_pot, $current_pot_id);
 class Items
 {
     public $item;
     public $item_information;
 }
 $itemsList = array();
 $result["pot_id"] = $current_pot_id;
 if ($current_pot["pot_winner_id"] == 0) {
     query_getAllPotItems($mysqli, $pot_items, $current_pot_id);
     if ($pot_items) {
         $incrementor = 0;
         foreach ($pot_items as $pot_item) {
             $newItem = new Items();
             query_getItemByItemID($mysqli, $item, $pot_item["item_id"]);
             query_getItemInformationByInfoID($mysqli, $item_info, $item["item_information_id"]);
             //item data & information
             $newItem->item = $item;
             $newItem->item_information = $item_info;
             array_push($itemsList, $newItem);
             if (!array_key_exists($item["user_id"], $user_chances)) {
                 $user_chances[$item["user_id"]] = new UserChanceData();
                 $user_chances[$item["user_id"]]->user_id = $item["user_id"];
                 $user_chances[$item["user_id"]]->add_order = $incrementor;
                 $incrementor++;
             }
             $total_value += $item_info["price"];
             $user_chances[$item["user_id"]]->user_value += $item_info["price"];
         }
         function cmp($a, $b)
Exemple #3
0
     class Items
     {
         public $item;
         public $item_information;
     }
     $itemsList = array();
     foreach ($asset_ids as $asset_id) {
         query_getItemInformationByClassID($mysqli, $item_info, $bot_inventory->{$asset_id}->classid);
         $db_item_id = query_depositItem($mysqli, $item_info["item_information_id"], $user_id, $asset_id, $bot["bot_id"]);
         //
         //
         //NEED TO SET NEW ITEM ID OF EACH TRADE ITEM
         //
         //
         $newItem = new Items();
         query_getItemByItemID($mysqli, $item, $db_item_id);
         $newItem->item = $item;
         $newItem->item_information = $item_info;
         array_push($itemsList, $newItem);
     }
     query_getUserByUserID_noToken($mysqli, $user_data, $user_id);
     if (count($itemsList) > 0) {
         $itemsList_messageData = array('subscribedTopic' => "newUserItems", 'toSpecificUser' => $user_id, 'itemsList' => $itemsList, 'user_data' => $user_data);
         $context = new ZMQContext();
         $socket = $context->getSocket(ZMQ::SOCKET_PUSH, 'my pusher');
         $socket->connect("tcp://localhost:5555");
         $socket->send(json_encode($itemsList_messageData));
     }
     echo "itemspushed";
 } else {
     if ($updated_trade["trade_type"] == "t") {