1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
<?php
class FormHtml { var $fields; var $table; var $name; var $method; var $onSubmit; var $onReset; var $action;
function FormHtml($name, $method, $fields, $table, $action = "") { $this->fields = $fields; $this->table = $table; $this->name = $name; $this->method = $method; $this->action = $action; }
function Generate() { $out = "<form name = \"" . $this->name . "\" method = \"" . $this->method . "\""; if($this->onSubmit != "") $out.=" onSubmit = \"" . $this->onSubmit . "\""; if($this->onReset != "") $out.=" onReset = \"" . $this->onReset . "\""; if($this->action != "") $out.=" action = \"" . $this->action . "\"";
$out.="<table>"; foreach($this->fields as $field) { $out.="<td>" . $field . "</td>"; $row = $table->GetRowByName($field); $maxChar = $row->maxLen;
}
$out.="</table>";
$out.="</form>";
}
}
?>
|