📄 temp_admin.zhtml
字号:
<!-- This page shows how to create a simple configuration interface using the
ZHTML features. Note that each variable has its current value displayed
and also allows the values to be updated. When the user submits the form,
if there are errors in that submission, then this form is redisplyed.
However, when it is redisplayed, it will inform the user that there were
errors, and the variables that are in error will be marked in red. -->
<HTML>
<HEAD><TITLE>Configure Temperature</TITLE></HEAD>
<BODY>
<H1>Configure minimum and maximum temperature</H1>
<!-- The following conditional is only true if this page is being displayed in
error mode. This happens when a user submission has errors and this form
is redisplayed in order to note those errors. -->
<?z if (error()) { ?>
ERROR! Your submission contained errors. Please correct the entries marked in
red below.
<?z } ?>
<FORM ACTION="/admin/index.zhtml" METHOD="POST">
<P>
<!-- The following conditional is only true if there has been an error for the
$hum_alarm variable. This (and the next conditional) are used to display
the variable name in a red font if the user has attempted to give that
variable an erroneous value. -->
<?z if (error($mintemp_alarm)) { ?>
<FONT COLOR="#ff0000">
<?z } ?>
Minimum temperature:
<!-- This conditional simply closes the FONT tag from the above conditional. -->
<?z if (error($mintemp_alarm)) { ?>
</FONT>
<?z } ?>
<!-- The following INPUT field includes a ZHTML tag to print the current value
of the $hum_alarm variable. Note that if we are in error mode, then the
committed (non-erroneous) value of hum_alarm can be displayed instead by
printing "@hum_alarm". In our case, however, we want to display the
erroneous value so that the user can see the problem and fix it. -->
<INPUT TYPE="text" NAME="mintemp_alarm" SIZE=3
VALUE="<?z printf("%6.2f", $mintemp_alarm) ?>"> Celcius
<P>
<?z if (error($maxtemp_alarm)) { ?>
<FONT COLOR="#ff0000">
<?z } ?>
Maximum temperature:
<!-- This conditional simply closes the FONT tag from the above conditional. -->
<?z if (error($maxtemp_alarm)) { ?>
</FONT>
<?z } ?>
<!-- The following INPUT field includes a ZHTML tag to print the current value
of the $hum_alarm variable. Note that if we are in error mode, then the
committed (non-erroneous) value of hum_alarm can be displayed instead by
printing "@hum_alarm". In our case, however, we want to display the
erroneous value so that the user can see the problem and fix it. -->
<INPUT TYPE="text" NAME="maxtemp_alarm" SIZE=3
VALUE="<?z printf("%6.2f", $maxtemp_alarm) ?>"> Celcius
<P>
<!-- Each of the following lines are similar to those just above, except that
they display different variables. -->
<?z if (error($alarm_email)) { ?>
<FONT COLOR="#ff0000">
<?z } ?>
Send email alarm to:
<?z if (error($alarm_email)) { ?>
</FONT>
<?z } ?>
<INPUT TYPE="text" NAME="alarm_email" SIZE=50
VALUE="<?z print($alarm_email) ?>">
<P>
<!-- Each of the following lines are similar to those just above, except that
they display different variables. -->
<?z if (error($alarm_interval)) { ?>
<FONT COLOR="#ff0000">
<?z } ?>
Notify interval (in seconds):
<?z if (error($alarm_interval)) { ?>
</FONT>
<?z } ?>
<INPUT TYPE="text" NAME="alarm_interval" SIZE=10
VALUE="<?z print($alarm_interval) ?>">
<P>
<INPUT TYPE="submit" VALUE="Submit">
</FORM>
<P>
<A HREF="/index.zhtml">Return to the current temperature page</A>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -