tpl.html

 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
48
49
50
51
52
53
54
55
56
57
58
59
60
<html>
<head>
<title>{$title}</title>
<script src="../script.js"></script>
<script>
{literal}
function check(obj){
for (i = 0; i < obj.elements.length; i++)
if ('~'+obj.elements[i].name in regular_expression){
var reg = regular_expression['~'+obj.elements[i].name];
if (!reg.test(obj.elements[i].value)){
alert('ERROR!');
return false;
}
}
}
{/literal}
regular_expression = new Array();
{section name=ch loop=$mark}
{if $mark[ch].reg}
regular_expression["~{$mark[ch].name}"] = /{$mark[ch].reg}/;
{/if}
{/section}
</script>
</head>
<body>
{if $view}
{section name=i loop=$view_arr}
{$view_arr[i]}<br />
{/section}
{else}
<form name="form1" id="form1" "check(this)" method="POST">
<table>
{section name=i loop=$mark}
<tr>
{if $mark[i].type == "text"}
<td>{$mark[i].title}: </td><td><input type="text" {if $mark[i].name}name="{$mark[i].name}"{/if} {if $mark[i].id}id="{$mark[i].id}"{/if} {if $mark[i].def_val}value="{$mark[i].def_val}"{/if}></td>
{elseif $mark[i].type == "select"}
{$mark[i].title}: <select {if $mark[i].name}name="{$mark[i].name}"{/if} {if $mark[i].id}id="{$mark[i].id}"{/if} {if $mark[i].script}{$mark[i].script}{/if}>
<option value="">
{section name=k loop=$mark[i].def_val}
<option value="{$mark[i].def_val[k].val}">{$mark[i].def_val[k].name}
{/section}
</select>
{/if}
</tr>
{/section}
</table>
<input type="hidden" name="col_id" value="{$id}">
<input type="submit" value="OK">
</form>
{/if}
Количество выводов - {$n}
</body>
</html>