chiark / gitweb /
Remove obsolete WIP script
[ypp-sc-tools.db-live.git] / yarrg / web / profitable_trades
1 <HTML>
2 <HEAD>
3 <TITLE>test pirate page</TITLE>
4 </HEAD>
5 <BODY>
6
7 <html><head><title>Profitable trades</title></head><body>
8 <%perl>
9 my $sth=$dbh->prepare(
10     "SELECT commods.commodname,
11             sell_islands.islandname,sell_stalls.stallname,sell.price,sell.qty,
12             buy_islands.islandname,buy_stalls.stallname,buy.price,buy.qty
13      FROM commods
14      JOIN buy on commods.commodid=buy.commodid
15      JOIN sell on commods.commodid=sell.commodid
16      JOIN islands as buy_islands  on buy.islandid  = buy_islands.islandid
17      JOIN stalls  as buy_stalls   on buy.stallid   = buy_stalls.stallid
18      JOIN islands as sell_islands on sell.islandid = sell_islands.islandid
19      JOIN stalls  as sell_stalls  on sell.stallid  = sell_stalls.stallid
20      WHERE buy.islandid like '36' and sell.islandid like '5'
21      and buy.price > sell.price
22      ");
23
24 $sth->execute();
25 </%perl>
26 <table frame=box rules=all>
27 <tr><td>commod</td><td>buy island</td><td>buy stall</td><td>buy price</td><td>buy quantity</td><td>sell island</td><td>sell stall</td><td>sell price</td><td>sell qty</td></tr>
28 % my @row;
29 % while (@row=$sth->fetchrow_array) {
30 <tr>
31 % foreach my $cell (@row) {
32 <td>
33 <% $cell %>
34 </td>
35 % }
36 </tr>
37 % }
38 </table>
39
40 </BODY>
41 </HTML>
42
43 <%init>
44 use CommodsWeb;
45 my $dbh= dbw_connect('Midnight');
46 </%init>