Advertisement
TreuW

Netto

Sep 18th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="pl">
  3. <head>
  4. <title>netto</title>
  5. <meta charset="utf-8">
  6. </head>
  7. <body><style></style>
  8. <h1>Cena netto</H1><hr></hr>
  9. <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>
  10. <form method="GET">
  11. Cena brutto:
  12. <input type="number" min="0.01" step="0.01" name="brutto" > PLN</br></br>
  13.  
  14. <fieldset >
  15. <legend>Wysokość VAT:</legend>
  16. <input type="radio" name="vat" value="0" > 0%
  17. <input type="radio" name="vat" value="5" > 5%
  18. <input type="radio" name="vat" value="8" > 8%
  19. <input type="radio" name="vat" value="23" checked > 23%</br>
  20. </fieldset></br>
  21. <input type="submit" value="policz">
  22. </form>
  23. <hr></hr>
  24. <?php
  25. if(isset($_GET['brutto']))
  26. {
  27. $brutto=$_GET['brutto'];
  28. $vat=$_GET['vat'];
  29. $cv=($vat*$brutto)/("100"+$vat);
  30. if(isset($_GET['vat'])&&!empty($brutto))
  31. {
  32.  
  33. $netto=round(($brutto-$cv),2);
  34. echo 'Dla ceny brutto '.$brutto.' i podatku vat '.$vat.'% cena netto wynosi '.$netto;
  35. }
  36.  
  37. }
  38. ?>
  39. </body>
  40. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement