Ejemplo n.º 1
0
function displayScouts(&$db, &$messageBox, &$player, $read, $group)
{
    if ($group) {
        //here we group new messages
        $query = 'SELECT alignment, player_id, sender_id, player_name AS sender, count( message_id ) AS number, min( send_time ) as first, max( send_time) as last, msg_read
					FROM message
					JOIN player ON player.account_id = message.sender_id AND message.game_id = player.game_id
					WHERE message.account_id = ' . $db->escapeNumber($player->getAccountID()) . '
					AND player.game_id = ' . $db->escapeNumber($player->getGameID()) . '
					AND message_type_id = ' . $db->escapeNumber(MSG_SCOUT) . '
					AND receiver_delete = ' . $db->escapeBoolean(false) . '
					AND msg_read = ' . $db->escapeBoolean($read) . '
					GROUP BY sender_id, msg_read
					ORDER BY send_time DESC';
        $db->query($query);
        while ($db->nextRecord()) {
            //display grouped stuff (allow for deletion)
            $playerName = get_alignment_text($db->getField('alignment'), stripslashes($db->getField('sender')) . ' (' . $db->getField('player_id') . ')');
            $message = 'Your forces have spotted ' . $playerName . ' passing your forces ' . $db->getField('number') . ' times.';
            displayGrouped($messageBox, $playerName, $db->getField('player_id'), $db->getField('sender_id'), $message, $db->getField('first'), $db->getField('last'), $db->getField('msg_read') == 'FALSE');
        }
    } else {
        //not enough to group, display separately
        $query = 'SELECT message_id, account_id, sender_id, message_text, send_time, msg_read
					FROM message
					WHERE account_id = ' . $db->escapeNumber($player->getAccountID()) . '
					AND game_id = ' . $db->escapeNumber($player->getGameID()) . '
					AND message_type_id = ' . $db->escapeNumber(MSG_SCOUT) . '
					AND receiver_delete = ' . $db->escapeBoolean(false) . '
					AND msg_read = ' . $db->escapeBoolean($read) . '
					ORDER BY send_time DESC';
        $db->query($query);
        while ($db->nextRecord()) {
            displayMessage($messageBox, $db->getField('message_id'), $db->getField('account_id'), $db->getField('sender_id'), stripslashes($db->getField('message_text')), $db->getField('send_time'), $db->getField('msg_read'), MSG_SCOUT);
        }
    }
}
Ejemplo n.º 2
0
 $PHP_OUTPUT .= '<input type="number" class="center" name="minValue" size="3" value="' . $minValue . '">';
 $PHP_OUTPUT .= '</td><td>-</td><td>';
 $PHP_OUTPUT .= '<input type="number" class="center" name="maxValue" size="3" value="' . $maxValue . '">';
 $PHP_OUTPUT .= '</td><td>';
 $PHP_OUTPUT .= $form['submit'];
 $PHP_OUTPUT .= '</td></tr></table></form>';
 $PHP_OUTPUT .= '<table class="standard inset"><tr><th>#</th><th>Date</th><th>Trader</th><th>Withdrawal</th><th>&nbsp;&nbsp;Deposit&nbsp;&nbsp;</th></tr>';
 $container = create_container('skeleton.php', 'trader_search_result.php');
 while ($db->nextRecord()) {
     $PHP_OUTPUT .= '<tr><td class="shrink center">';
     $PHP_OUTPUT .= $db->getInt('transaction_id');
     $PHP_OUTPUT .= '</td><td class="shrink center noWrap">';
     $PHP_OUTPUT .= date(DATE_FULL_SHORT_SPLIT, $db->getInt('time'));
     $PHP_OUTPUT .= '</td><td>';
     $container['player_id'] = $db->getInt('player_id');
     $PHP_OUTPUT .= create_link($container, get_alignment_text($db->getInt('alignment'), $db->getField('player_name')));
     $PHP_OUTPUT .= '</td><td class="shrink right">';
     if ($db->getField('transaction') == 'Payment') {
         $PHP_OUTPUT .= number_format($db->getInt('amount'));
     } else {
         $PHP_OUTPUT .= '&nbsp;';
     }
     $PHP_OUTPUT .= '</td><td class="shrink right">';
     if ($db->getField('transaction') == 'Deposit') {
         $PHP_OUTPUT .= number_format($db->getInt('amount'));
     } else {
         $PHP_OUTPUT .= '&nbsp;';
     }
     $PHP_OUTPUT .= '</td></tr>';
 }
 $PHP_OUTPUT .= '<tr>';