예제 #1
0
	</td>
	<td>
	<font face="arial" size="1"><?php 
    echo $row['origin'];
    ?>
</font>
	</td>
	<td>
	<font face="arial" size="1"><?php 
    echo $row['reason'];
    ?>
</font>
	</td>
	<td>
	<font face="arial" size="1"><?php 
    echo convert_to_default_currency($row['currency'], $row['amount']);
    ?>
</font>
	</td>
	<td>
	<font face="arial" size="1"><?php 
    if ($row['type'] == 'DEBIT') {
        echo '<font color="green">';
    } else {
        echo '<font color="red">';
    }
    echo $row['type'] . '</font>';
    ?>
</font>
	</td>
	<td>
예제 #2
0
	<?php 
    $cannot_get_package = false;
    if ($has_packages && $_REQUEST['pack'] != '') {
        // has packages, and a package was selected...
        // check to make sure this advertiser can order this package
        if (can_user_get_package($_SESSION['MDS_ID'], $_REQUEST['pack'])) {
            $sql = "SELECT quantity FROM temp_orders WHERE session_id='" . addslashes(session_id()) . "'";
            $result = mysql_query($sql) or die(mysql_error() . $sql);
            $row = mysql_fetch_array($result);
            $quantity = $row['quantity'];
            $block_count = $quantity / (BLK_WIDTH * BLK_HEIGHT);
            // Now update the order (overwite the total & days_expire with the package)
            $pack = get_package($_REQUEST['pack']);
            $total = $pack['price'] * $block_count;
            // convert & round off
            $total = convert_to_default_currency($pack['currency'], $total);
            $sql = "UPDATE temp_orders SET package_id='" . $_REQUEST['pack'] . "', price='" . $total . "',  days_expire='" . $pack['days_expire'] . "', currency='" . get_default_currency() . "' WHERE session_id='" . addslashes(session_id()) . "'";
            mysql_query($sql) or die(mysql_error() . $sql);
            $order_row['price'] = $total;
            $order_row['pack'] = $_REQUEST['pack'];
            $order_row['days_expire'] = $pack['days_expire'];
            $order_row['currency'] = get_default_currency();
        } else {
            $selected_pack = $_REQUEST['pack'];
            $_REQUEST['pack'] = '';
            $cannot_get_package = true;
        }
    }
    if ($has_packages && $_REQUEST['pack'] == '') {
        echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . "'>";
        ?>
예제 #3
0
function get_zone_price($banner_id, $row, $col)
{
    $row = $row + 1;
    $col = $col + 1;
    global $price_table;
    if ($price_table['loaded'] != 1) {
        load_price_zones($banner_id);
        //print_r ($price_table);
    }
    foreach ($price_table as $key => $val) {
        if ($price_table[$key]['row_from'] <= $row && $price_table[$key]['row_to'] >= $row && ($price_table[$key]['col_from'] <= $col && $price_table[$key]['col_to'] >= $col)) {
            $price = convert_to_default_currency($price_table[$key]['currency'], $price_table[$key]['price']);
            //echo "Zone: row $row col $col ($price)\n";
            return $price;
        }
    }
    // if not found..
    $sql = "select price_per_block as price, currency from banners where  banner_id='{$banner_id}' ";
    $result2 = mysql_query($sql) or die(mysql_error());
    $block_row = mysql_fetch_array($result2);
    //echo "curr".$row['currency']." price".$row['price']."<br>";
    $price = convert_to_default_currency($block_row['currency'], $block_row['price']);
    //echo "row $row col $col ($price)\n";
    return $price;
}
예제 #4
0
function add_package_to_order($order_id, $package_id)
{
    $pack = get_package($package_id);
    //user_id, order_id, blocks, status, order_date, price, quantity, banner_id, currency, days_expire, date_stam
    $sql = "SELECT * FROM orders WHERE order_id='{$order_id}'";
    $result = mysql_query($sql) or die(mysql_error());
    $row = mysql_fetch_array($result);
    $total = $row['quantity'] / 100 * $pack['price'];
    $total = convert_to_default_currency($pack['currency'], $total);
    $sql = "UPDATE orders set price='{$total}', currency='" . get_default_currency() . "' expire_days='" . $pack['expire_days'] . "' WHERE order_id={$order_id} ";
}