-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuy.php
More file actions
44 lines (33 loc) · 1014 Bytes
/
buy.php
File metadata and controls
44 lines (33 loc) · 1014 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
require 'modules/frontend.php';
require 'modules/db_product.php';
if(!isset($_GET['want']))
die("Missing parameter");
$list = explode(' ', htmlentities($_GET['want']));
html_user_header("Buy Game - The Indie Game Shop");
if(!$g_loggedIn)
{
echo '<p>Warning: TigShop assigns your purchases to your email address. You are <b>not logged in</b>, so purchased games will be assigned to your <b>PayPal email address</b>. You can change this by logging in.</p>';
}
echo '<p>List:</p><ul>';
$sum = 0;
$cut = 0;
foreach($list as $item)
{
$prodInfo = db_getProduct($item);
if(!$prodInfo)
html_die("<br><b>ERROR:</b> Unknown item $item!");
$title = htmlentities($prodInfo['title']);
// TODO: This has moved
//$price = $prodInfo['price'];
$price = 999;
$prov = $prodInfo['provision'];
$cut += $prov*$price;
echo '<li>',$title,': $',$price,'</li>';
$sum += $price;
}
echo '</ul>';
echo 'SUM: $',$sum;
echo '<br>CUT: $',($cut/100.0);
html_footer();
?>