File size: 8.25Kb
<?
include 'config.php';
print "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
<html>
<head>
<title>[калькулятор]</title></head>
<body bgcolor=\"$fcolor\">
";
if($page=="index"){
print"<center>
<a href=\"hpk.php?page=sl\"><font color=\"$scolor\">[сложение]</font></a>
<br/>
<a href=\"hpk.php?page=razn\"><font color=\"$scolor\">[вычетание]</font></a>
<br/>
<a href=\"hpk.php?page=umn\"><font color=\"$scolor\">[умножение]</font></a>
<br/>
<a href=\"hpk.php?page=del\"><font color=\"$scolor\">[деление]</font></a>
<br/>
---
<br/>
<a href=\"hpk.php?page=st\"><font color=\"$scolor\">[возвести в]</font></a>
<br/>
<a href=\"hpk.php?page=izvv\"><font color=\"$scolor\">[извлечь корень]</font></a>
<br/>
---
<br/>
<a href=\"hpk.php?page=dop\"><font color=\"$scolor\">[дополнительно]</font></a>
<br/>
---
<br/>
<a href=\"$gl\">[на главную]</a>
";}
if($page=="sl"){
print"<center>
<form method=\"post\" action=\"hpk.php?page=slr\" name=\"b1\">
<input name=\"b1\" maxlength=\"100\" size=\"2\" format=\"*N\"/>+<input name=\"b2\" size=\"2\" maxlength=\"100\" format=\"*N\"/><br/>";
print"<input class=\"button\" type=\"submit\" value=\"[посчитать]\"/></form>
";}
if($page=="slr"){
$sum=$b1+$b2;
print"<center>
$b1+$b2=$sum
<br/>
<a href=\"hpk.php?page=sl\">[ещё пример]</a>
<br/>
<a href=\"hpk.php?page=index\">[калькулятор]</a>
";}
if($page=="razn"){
print"<center>
<form method=\"post\" action=\"hpk.php?page=raznr\" name=\"c1\">
<input name=\"c1\" maxlength=\"100\" size=\"2\" format=\"*N\"/>-<input name=\"c2\" size=\"2\" maxlength=\"100\" format=\"*N\"/><br/>";
print"<input class=\"button\" type=\"submit\" value=\"[посчитать]\"/></form>
";}
if($page=="raznr"){
$razn=$c1-$c2;
print"<center>
$c1-$c2=$razn
<br/>
<a href=\"hpk.php?page=razn\">[ещё пример]</a>
<br/>
<a href=\"hpk.php?page=index\">[калькулятор]</a>
";}
if($page=="umn"){
print"<center>
<form method=\"post\" action=\"hpk.php?page=umnr\" name=\"d1\">
<input name=\"d1\" maxlength=\"100\" size=\"2\" format=\"*N\"/>*<input name=\"d2\" size=\"2\" maxlength=\"100\" format=\"*N\"/><br/>";
print"<input class=\"button\" type=\"submit\" value=\"[посчитать]\"/></form>
";}
if($page=="umnr"){
$umn=$d1*$d2;
print"<center>
$d1*$d2=$umn
<br/>
<a href=\"hpk.php?page=umn\">[ещё пример]</a>
<br/>
<a href=\"hpk.php?page=index\">[калькулятор]</a>
";}
if($page=="del"){
print"<center>
<form method=\"post\" action=\"hpk.php?page=delr\" name=\"e1\">
<input name=\"e1\" maxlength=\"100\" size=\"2\" format=\"*N\"/>:<input name=\"e2\" size=\"2\" maxlength=\"100\" format=\"N\"/><br/>";
print"<input class=\"button\" type=\"submit\" value=\"[посчитать]\"/></form>
";}
if($page=="delr"){
$del=$e1/$e2;
if($e2==0){print"<center><b>на ноль делить нельзя,лопух!!!</b>
<br/>
<a href=\"hpk.php?page=index\">[калькулятор]</a>";}
else{
print"<center>
$e1:$e2=$del
<br/>
<a href=\"hpk.php?page=del\">[ещё пример]</a>
<br/>
<a href=\"hpk.php?page=index\">[калькулятор]</a>
";}}
if($page=="izvv"){
print"<center>
<form method=\"post\" action=\"hpk.php?page=izvvr\" name=\"h1\">
<input name=\"h1\" maxlength=\"100\" size=\"2\" format=\"*N\"/><br/>";
print"<input class=\"button\" type=\"submit\" value=\"[посчитать]\"/></form>
";}
if($page=="izvvr"){
$kor=pow($h1,0.5);
print"<center>
$h1=$kor
<br/>
<a href=\"hpk.php?page=izvv\">[ещё пример]</a>
<br/>
<a href=\"hpk.php?page=index\">[калькулятор]</a>
";}
if($page=="st"){
print"<center>
<form method=\"post\" action=\"hpk.php?page=str\" name=\"j1\">
число: <input name=\"j1\" maxlength=\"100\" size=\"2\" format=\"*N\"/><br/>
степень:<input name=\"j2\" size=\"2\" maxlength=\"100\" format=\"*N\"/><br/>";
print"<input class=\"button\" type=\"submit\" value=\"[посчитать]\"/></form>
";}
if($page=="str"){
$st=pow($j1,$j2);
print"<center>
$j1<sup><small>$j2</small></sup>=$st
<br/>
<a href=\"hpk.php?page=st\">[ещё пример]</a>
<br/>
<a href=\"hpk.php?page=index\">[калькулятор]</a>
";}
if($page=="dop"){
print"<center>
<a href=\"hpk.php?page=prn\"><font color=\"$scolor\">[процент от числа]</font></a>
<br/>
<a href=\"hpk.php?page=diskr\"><font color=\"$scolor\">[дискрименант]</font></a>
<br/>
---
<br/>
<a href=\"hpk.php?page=index\">[калькулятор]</a>
";}
if($page=="prn"){
print"<center>
<form method=\"post\" action=\"hpk.php?page=prnr\" name=\"k1\">
число: <input name=\"k1\" maxlength=\"100\" size=\"2\" format=\"*N\"/><br/>
процент:<input name=\"k2\" size=\"2\" maxlength=\"100\" format=\"*N\"/><br/>";
print"<input class=\"button\" type=\"submit\" value=\"[посчитать]\"/></form>
";}
if($page=="prnr"){
$pro= $k1*($k2/100);
print"<center>
$pro
<br/>
<a href=\"hpk.php?page=prn\">[ещё пример]</a>
<br/>
<a href=\"hpk.php?page=index\">[калькулятор]</a>
";}
if($page=="diskr"){
print"<center>
<form method=\"post\" action=\"hpk.php?page=diskrr\" name=\"d\">
a:<input name=\"a\" maxlength=\"100\" size=\"2\" format=\"*N\"/><br/>
b:<input name=\"b\" size=\"2\" maxlength=\"100\" format=\"*N\"/><br/>
c:<input name=\"c\" size=\"2\" maxlength=\"100\" format=\"*N\"/><br/>";
print"<input class=\"button\" type=\"submit\" value=\"[посчитать]\"/></form>
";}
if($page=="diskrr"){
$diskr= $b*$b-4*$a*$c;
print"<center>
D=$diskr
<br/>
<a href=\"hpk.php?page=diskr\">[ещё пример]</a>
<br/>
<a href=\"hpk.php?page=index\">[калькулятор]</a>
";}
print"";
print"
</body>
</html>";
?>