function testDisplayAmountFunction()
{
    assertEqual('0.123 BTC', displayAmount(0.123, 'BTC'));
    assertEqual('1.654 BTC', displayAmount(1.654, 'BTC'));
    assertEqual('3.121 BTC', displayAmount(3.1212, 'BTC'));
    assertEqual('0.019 BTC', displayAmount(0.019, 'BTC'));
    assertEqual('0.02 BTC', displayAmount(0.02, 'BTC'));
    assertEqual('13.25 USD', displayAmount(13.25, 'USD'));
    assertEqual('13.25 USD', displayAmount(13.253, 'USD'));
}
Exemple #2
0
   <td width="60"><a href="<?php 
        echo $_SERVER['PHP_SELF'];
        ?>
?view=detail&oid=<?php 
        echo $od_id;
        ?>
"><?php 
        echo $od_id;
        ?>
</a></td>
   <td><?php 
        echo $name;
        ?>
</td>
   <td width="60" align="right"><?php 
        echo displayAmount($od_amount);
        ?>
</td>
   <td width="150" align="center"><?php 
        echo $od_date;
        ?>
</td>
   <td width="70" align="center"><?php 
        echo $od_status;
        ?>
</td>
  </tr>
  <?php 
    }
    // end while
    ?>
Exemple #3
0
    ?>
  <tr><td align="right"><span id="aa">Sub-total</span></td>
  <td width="30%" align="right"><span id="aa"><?php 
    echo displayAmount($subTotal);
    ?>
</span></td>
 </tr>
  <tr><td align="right"><span id="aa">Shipping</span></td>
  <td width="30%" align="right"><span id="aa"><?php 
    echo displayAmount($shopConfig['shippingCost']);
    ?>
</span></td>
 </tr>
  <tr><td align="right"><span id="aa">Total</span></td>
  <td width="30%" align="right"><span id="aa"><?php 
    echo displayAmount($subTotal + $shopConfig['shippingCost']);
    ?>
</span></td>
 </tr>
  <tr><td colspan="2">&nbsp;</td></tr>
  <tr>
  <td colspan="2" align="center"><span id="aa"><a href="cart.php?action=view"><font color="#FFFFFF"> <strong>Go To Shopping 
   Cart</strong></font></a></span></td>
 </tr>  
<?php 
} else {
    ?>
  <tr><td colspan="2" align="center" valign="middle"><span id="aa">Shopping Cart Is Empty</span></td>
  </tr>
<?php 
}
" width="250" height="250" border="0" alt="<?php 
echo $pd_name;
?>
" /></td>
      <td width="40%" valign="middle"><strong><?php 
echo $pd_name;
?>
</strong><br/>
        <br />
        <?php 
echo $pd_description;
?>
<br />
        <br />
        Price : <?php 
echo displayAmount($pd_price);
?>
<br/>
        <br />
        <?php 
// if we still have this product in stock
// show the 'Add to cart' button
if ($pd_qty > 0) {
    ?>
        <input type="button" name="btnAddToCart" value="Add To Cart &gt;" onclick="window.location.href='<?php 
    echo $cart_url;
    ?>
';" class="addToCartButton" />
        <?php 
} else {
    echo 'Out Of Stock';
Exemple #5
0
<table width="100%" border="0" cellspacing="0" cellpadding="20">
<?php 
if ($numProduct > 0) {
    $i = 0;
    while ($row = dbFetchAssoc($result)) {
        extract($row);
        if ($pd_thumbnail) {
            $pd_thumbnail = WEB_ROOT . 'images/product/' . $pd_thumbnail;
        } else {
            $pd_thumbnail = WEB_ROOT . 'images/no-image-small.png';
        }
        if ($i % $productsPerRow == 0) {
            echo '<tr>';
        }
        // format how we display the price
        $pd_price = displayAmount($pd_price);
        echo "<td width=\"{$columnWidth}%\" align=\"center\"><a href=\"" . $_SERVER['PHP_SELF'] . "?c={$catId}&p={$pd_id}" . "\"><img src=\"{$pd_thumbnail}\" border=\"0\"><br>{$pd_name}</a><br>Price : {$pd_price}";
        // if the product is no longer in stock, tell the customer
        if ($pd_qty <= 0) {
            echo "<br>Out Of Stock";
        }
        echo "</td>\r\n";
        if ($i % $productsPerRow == $productsPerRow - 1) {
            echo '</tr>';
        }
        $i += 1;
    }
    if ($i % $productsPerRow > 0) {
        echo '<td colspan="' . ($productsPerRow - $i % $productsPerRow) . '">&nbsp;</td>';
    }
} else {
        <td align="right"><?php 
echo displayAmount($subTotal);
?>
</td>
    </tr>
    <tr class="content"> 
        <td colspan="2" align="right">Shipping</td>
        <td align="right"><?php 
echo displayAmount($od_shipping_cost);
?>
</td>
    </tr>
    <tr class="content"> 
        <td colspan="2" align="right">Total</td>
        <td align="right"><?php 
echo displayAmount($od_shipping_cost + $subTotal);
?>
</td>
    </tr>
</table>
<p>&nbsp;</p>
<table width="550" border="0"  align="center" cellpadding="5" cellspacing="1" class="detailTable">
    <tr id="infoTableHeader"> 
        <td colspan="2">Shipping Information</td>
    </tr>
    <tr> 
        <td width="150" class="label">First Name</td>
        <td class="content"><?php 
echo $od_shipping_first_name;
?>
 </td>