$item = $db->Execute("SELECT * FROM {$dbtables['fair']} " . "WHERE proper_name = '{$_REQUEST['product']}'"); $iteminfo = $item->fields; $check = $db->Execute("SELECT * FROM {$dbtables['fair_tribe']} " . "WHERE clan_id = '{$_SESSION['clanid']}' " . "AND product = '{$_REQUEST['product']}'"); if ($_REQUEST[quantity] < 0) { echo "<CENTER>Invalid quantity. Try again.</CENTER>"; page_footer(); } if ($_REQUEST[quantity] > $iteminfo[limit]) { $_REQUEST[quantity] = $iteminfo[limit]; } if ($check->EOF && $_REQUEST[product]) { $db->Execute("INSERT INTO {$dbtables['fair_tribe']} " . "VALUES(" . "'{$tribeinfo['clanid']}'," . "'{$tribeinfo['tribeid']}'," . "''," . "'{$skillinfo['level']}'," . "'{$_REQUEST['transactions']}'," . "'{$_REQUEST['product']}'," . "'{$_REQUEST['quantity']}'," . "'{$_REQUEST['cost']}'" . ")"); $total = $_REQUEST[cost] * $_REQUEST[quantity]; } else { echo "<CENTER>You have already transacted this item. Please cancel your first order before doing this again.</CENTER>"; page_footer(); } if ($_REQUEST[transactions] == 'B') { echo "<CENTER><FONT SIZE=+1>You have made an order to purchase "; } else { echo "<CENTER><FONT SIZE=+1>You have made an order to sell "; } echo "{$_REQUEST['quantity']}"; echo " "; echo "{$_REQUEST['product']}"; echo " for a total of "; echo "{$total}"; echo ".</FONT>"; display_transactions(); } page_footer();
$trade_count = count_transactions($orderid); $give_precision = $type == 'BTC' ? BTC_PRECISION : FIAT_PRECISION; $want_precision = $type == 'BTC' ? FIAT_PRECISION : BTC_PRECISION; echo " ", active_table_row("active", "?page=view_order&orderid={$orderid}"), "\n"; echo " <td class='right'>" . internal_to_numstr($initial_amount, $give_precision) . " {$type}</td>\n"; echo " <td class='right'>" . internal_to_numstr($initial_want_amount, $want_precision) . " {$want_type}</td>\n"; echo " <td class='right'>{$price}</td>\n"; echo " <td>{$timest}</td>\n"; echo " <td>{$status} ({$percent_complete}%)</td>\n"; echo " <td>{$trade_count}</td>\n"; echo " </tr>\n"; } while ($row = mysql_fetch_assoc($result)); echo "</table></div>"; } // also used when you view an order display_transactions($uid, 0); $query = "\n SELECT\n reqid,\n req_type,\n amount,\n curr_type,\n " . sql_format_date("timest") . " AS timest,\n status\n FROM requests\n WHERE\n uid='{$uid}' \n AND (req_type='WITHDR' OR req_type='DEPOS') \n AND status!='IGNORE'\n ORDER BY requests.timest DESC;\n"; $result = do_query($query); $row = mysql_fetch_assoc($result); if ($row) { ?> <div class='content_box'> <h3><?php echo _("Your requests"); ?> </h3> <table class='display_data'> <tr> <th><?php echo _("Amount"); ?>
<?php printf(_("Made %s"), $timest); if ($is_logged_in != $uid) { echo " " . sprintf(_("by user %s"), $uid); } ?> </p> <p> <?php echo translate_order_code($status); ?> </p> <?php if ($status == 'OPEN') { ?> <p> <form action='' class='indent_form' method='post'> <input type='hidden' name='csrf_token' value="<?php echo $_SESSION['csrf_token']; ?> " /> <input type='hidden' name='cancel_order' value='true' /> <input type='submit' value='Cancel order' /> </form> </p> <?php } ?> </div> <?php display_transactions($uid, $orderid); }