Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="pl">
- <head>
- <title>netto</title>
- <meta charset="utf-8">
- </head>
- <body><style></style>
- <h1>Cena netto</H1><hr></hr>
- <p>wpisz cenę brutto i wybierz wysokosc podatku VAT w procentach a nastepnie kliknij przycisk <i><b>policz</b></i> , aby wyswietlic cene netto</p>
- <form method="GET">
- Cena brutto:
- <input type="number" min="0.01" step="0.01" name="brutto" > PLN</br></br>
- <fieldset >
- <legend>Wysokość VAT:</legend>
- <input type="radio" name="vat" value="0" > 0%
- <input type="radio" name="vat" value="5" > 5%
- <input type="radio" name="vat" value="8" > 8%
- <input type="radio" name="vat" value="23" checked > 23%</br>
- </fieldset></br>
- <input type="submit" value="policz">
- </form>
- <hr></hr>
- <?php
- if(isset($_GET['brutto']))
- {
- $brutto=$_GET['brutto'];
- $vat=$_GET['vat'];
- $cv=($vat*$brutto)/("100"+$vat);
- if(isset($_GET['vat'])&&!empty($brutto))
- {
- $netto=round(($brutto-$cv),2);
- echo 'Dla ceny brutto '.$brutto.' i podatku vat '.$vat.'% cena netto wynosi '.$netto;
- }
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement