Login   Register  
PHP Classes
elePHPant
Icontem

File: example1.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Martin Sadera  >  Price Calculator  >  example1.php  >  Download  
File: example1.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Price Calculator
Calculate price variations
Author: By
Last change:
Date: 8 years ago
Size: 1,047 bytes
 

Contents

Class file image Download
<html>
 <head>
  <title>Price Calculator Class Example</title>
  <style>
    <!--
    label {width:10em;}
    input {display:block;text-align:right}
    -->
  </style>
 </head>
<body> 
<?php 
require_once('pricecalc.class.php');

/* set price without taxes */
$price_wihout_taxes="1000"
/* set taxes in percents */
$taxes=19;
/* set price reduction in percents */
$reduction=10;
/* set price signature */
$price_signature="EUR";

$price = new PriceCalc($price_wihout_taxes,$taxes,$reduction,$price_signature);
echo 
'
  <label>Old price with tax:</label> <input type="text" value="'
.$price->OldWithDph_f().'" />
  <label>New price with tax:</label> <input type="text" value="'
.$price->WithDph_f().'" />
  <label>Price without tax:</label> <input type="text" value="'
.$price->WithoutDph_f().'" />
  <label>Tax part of price:</label> <input type="text" value="'
.$price->DPH_f().'" />
  <label>Saved moneys with tax:</label> <input type="text" value="'
.$price->SavedMoneyWithDph_f().'" />
  '
;

?>
</body>
</html>