chiark / gitweb /
Merge branch 'stable-3.x'
[ypp-sc-tools.main.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 <& dumptable, sth => $sth &>
27
28 </BODY>
29 </HTML>
30
31 <%init>
32 use CommodsWeb;
33 my $dbh= dbw_connect('Midnight');
34 </%init>