HTML5
Этот атрибут определяет порядок перехода клавишей "Tab".
<?
php
class Electro {
private $show0;
private $show1;
private $price;
function __construct($arg0, $arg1, $arg2) {
$this->show0 = $arg0;
$this->show1 = $arg1;
$this->price = $arg2;
}
function Res() {
return $this->show1 - $this->show0;
function Sum() {
return round( $this->price * $this->Res(), 2);
?>
<!DOCTYPE html>
<
html
>
head
meta
charset
=
"utf-8"
/>
title
>Name Page</
</
body
if($_SERVER['REQUEST_METHOD'] == 'POST') {
$
show0
abs
((int)$_POST['show0']);
show1
((int)$_POST['show1']);
$price = (float)$_POST['price'];
E
new
Electro($show0, $show1, $price);
if($_REQUEST['clear']) {
null
;
price
form
id
"form1"
action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
fieldset
legend
>To calculate electricity</
br
input
tabindex
"1"
autofocus
"autofocus"
type
"text"
name
"show0"
value="<?php echo $show0; ?>" />
label
>The start data</
"2"
"show1"
value="<?php echo $show1; ?>" />
>The end data</
"3"
"price"
value="<?php echo $price; ?>" />
>The price 1 kW/hour of electricity</
"4"
"submit"
"res"
value
"Calculate"
"clear"
" Clear "
>The sum of electricity</
if($_SERVER['REQUEST_METHOD']=='POST' && $_REQUEST['res'] && !$_REQUEST['clear']) {
echo '
Sum
', '
<b>', $E->Sum(), '</
b
>';
else {
echo null;