295 lines
13 KiB
Cheetah
295 lines
13 KiB
Cheetah
<!-- TMPL_INCLUDE NAME="parameters-top.inc" -->
|
|
|
|
<!-- TMPL_IF NAME="add_form" -->
|
|
<script language="javascript" type="text/javascript">
|
|
function _(s) { return s } // dummy function for gettext
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
function isNotNull(f,noalert) {
|
|
if (f.value.length ==0) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
function toUC(f) {
|
|
var x=f.value.toUpperCase();
|
|
f.value=x;
|
|
return true;
|
|
}
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
function isNum(v,maybenull) {
|
|
var n = new Number(v.value);
|
|
if (isNaN(n)) {
|
|
return false;
|
|
}
|
|
if (maybenull==0 && v.value=='') {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
function isDate(f) {
|
|
var t = Date.parse(f.value);
|
|
if (isNaN(t)) {
|
|
return false;
|
|
}
|
|
}
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
function Check(f) {
|
|
var ok=1;
|
|
var _alertString="";
|
|
var alertString2;
|
|
if (f.categorycode.value.length==0) {
|
|
_alertString += "\n- " + _("categorycode missing");
|
|
}
|
|
// alert(window.document.Aform.description.value);
|
|
if (!(isNotNull(window.document.Aform.description,1))) {
|
|
_alertString += "\n- " + _("description missing");
|
|
}
|
|
if (!isNum(f.upperagelimit,0)) {
|
|
_alertString += "\n- " + _("upperagelimit is not a number");
|
|
}
|
|
if (_alertString.length==0) {
|
|
document.Aform.submit();
|
|
} else {
|
|
alertString2 = _("Form not submitted because of the following problem(s)");
|
|
alertString2 += "\n------------------------------------------------------------------------------------\n";
|
|
alertString2 += _alertString;
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<!-- TMPL_IF NAME="categorycode" -->
|
|
<h1>Modify category</h1>
|
|
<!-- TMPL_ELSE -->
|
|
<h1>Add category</h1>
|
|
<!-- /TMPL_IF -->
|
|
|
|
<form action="<!-- TMPL_VAR NAME="script_name" -->" name="Aform" method="post">
|
|
<input type="hidden" name="op" value="add_validate">
|
|
<input type="hidden" name="checked" value="0">
|
|
|
|
<table>
|
|
<!-- TMPL_IF NAME="categorycode" -->
|
|
<tr>
|
|
<td>Category code</td>
|
|
<td>
|
|
<input type="hidden" name="categorycode" value="<!-- TMPL_VAR NAME="categorycode" -->">
|
|
</td>
|
|
</tr>
|
|
<!-- TMPL_ELSE -->
|
|
<tr>
|
|
<td>Category code</td>
|
|
<td>
|
|
<input type="text" name="categorycode" size="3" maxlength="2" onblur="toUC(this)">
|
|
</td>
|
|
</tr>
|
|
<!-- /TMPL_IF -->
|
|
<tr>
|
|
<td>Description</td>
|
|
<td>
|
|
<input type="text" name="description" size="40" maxlength="80" value="<!-- TMPL_VAR NAME="description" escape=HTML -->">
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Enrolment period</td>
|
|
<td>
|
|
<input type="text" name="enrolmentperiod" value="<!-- TMPL_VAR NAME="enrolmentperiod" -->">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Upperage limit</td>
|
|
<td>
|
|
<input type="text" name="upperagelimit" value="<!-- TMPL_VAR NAME="upperagelimit" -->">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Age Required</td>
|
|
<td>
|
|
<input type="text" name="dateofbirthrequired" value="<!-- TMPL_VAR NAME="dateofbirthrequired" -->">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Fine type</td>
|
|
<td>
|
|
<input type="text" name="finetype" size="30" maxlength="30" value="<!-- TMPL_VAR NAME="finetype" -->">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Bulk</td>
|
|
<td>
|
|
<input type="text" name="bulk" value="<!-- TMPL_VAR NAME="bulk" -->">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Enrolment fee</td>
|
|
<td>
|
|
<input type="text" name="enrolmentfee" value="<!-- TMPL_VAR NAME="enrolmentfee" -->">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Overdue notice required</td>
|
|
<td>
|
|
<input type="text" name="overduenoticerequired" value="<!-- TMPL_VAR NAME="overduenoticerequired" -->">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Reserve fee</td>
|
|
<td>
|
|
<input type="text" name="reservefee" value="<!-- TMPL_VAR NAME="reservefee" -->">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td> </td>
|
|
<td>
|
|
<input type="button" value="OK" onclick="Check(this.form)">
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<!-- /TMPL_IF -->
|
|
|
|
<!-- TMPL_IF NAME="add_validate" -->
|
|
Data recorded
|
|
<form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
|
|
<input type="submit" value="OK">
|
|
</form>
|
|
<!-- /TMPL_IF -->
|
|
|
|
TOTAL : <!-- TMPL_VAR NAME="categorycode" --> : <!-- TMPL_VAR NAME="total" --><br>
|
|
|
|
<table border="0" cellspacing="0" cellpadding="5">
|
|
<tr bgcolor="#99cc33">
|
|
<td background="/images/background-mem.gif">
|
|
<b>Category code</b>
|
|
</td>
|
|
<td background="/images/background-mem.gif">
|
|
<!-- TMPL_VAR NAME="categorycode" -->
|
|
</td>
|
|
</tr>
|
|
<form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
|
|
<input type="hidden" name="op" value="delete_confirmed">
|
|
<input type="hidden" name="categorycode" value=<!-- TMPL_VAR NAME="categorycode" -->>
|
|
<tr>
|
|
<td>Description</td>
|
|
<td><!-- TMPL_VAR NAME="description" --></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Enrolment period</td>
|
|
<td><!-- TMPL_VAR NAME="enrolmentperiod" --></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Upperage limit</td>
|
|
<td><!-- TMPL_VAR NAME="upperagelimit" --></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Age Required</td>
|
|
<td><!-- TMPL_VAR NAME="dateofbirthrequired" --></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Fine type</td>
|
|
<td><!-- TMPL_VAR NAME="finetype" --></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Bulk</td>
|
|
<td><!-- TMPL_VAR NAME="bulk" --></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Enrolment fee</td>
|
|
<td><!-- TMPL_VAR NAME="enrolmentfee" --></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Overdue notice required</td>
|
|
<td><!-- TMPL_VAR NAME="overduenoticerequired" --></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Reserve fee</td>
|
|
<td><!-- TMPL_VAR NAME="reservefee" --></td>
|
|
</tr>
|
|
<!-- TMPL_IF NAME="totalgtzero" -->
|
|
<tr>
|
|
<td colspan="2" align="center"><b>This record is used <!-- TMPL_VAR NAME="total" --> times. Deletion not possible</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2">
|
|
</form><form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
|
|
<input type="submit" value="OK">
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
<!-- TMPL_ELSE -->
|
|
<tr>
|
|
<td colspan="2" align="center">CONFIRM DELETION</td>
|
|
</tr>
|
|
<tr>
|
|
<td><input type="submit" value="YES"></form></td>
|
|
<td><form action="<!-- TMPL_VAR NAME="script_name" -->" method="post"><input type="submit" value="NO"></form></td>
|
|
</tr>
|
|
<!-- /TMPL_IF -->
|
|
|
|
<!-- /TMPL_IF -->
|
|
|
|
<!-- TMPL_IF NAME="delete_confirmed" -->
|
|
Data deleted
|
|
<form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
|
|
<input type="submit" value="OK">
|
|
</form>
|
|
|
|
<!-- /TMPL_IF -->
|
|
|
|
<!-- TMPL_IF NAME="else" -->
|
|
<h2>Category admin</h2>
|
|
<!-- TMPL_IF NAME="searchfield" -->
|
|
You Searched for <!-- TMPL_VAR NAME="searchfield" -->
|
|
<!-- /TMPL_IF -->
|
|
|
|
<form action="<!-- TMPL_VAR NAME="script_name">" method="post">
|
|
<input type="text" name="description" value="<!-- TMPL_VAR NAME="searchfield" -->">
|
|
<input type="reset" name="reset" value="clr">
|
|
</form>
|
|
|
|
<table border="0" cellspacing="0" cellpadding="5">
|
|
<tr bgcolor="#99cc33">
|
|
<td background="/images/background-mem.gif"><b>Category</b></td>
|
|
<td background="/images/background-mem.gif"><b>Description</b></td>
|
|
<td background="/images/background-mem.gif"><b>Enrolment</b></td>
|
|
<td background="/images/background-mem.gif"><b>Upper Age Limit</b></td>
|
|
<td background="/images/background-mem.gif"><b>Age Required</b></td>
|
|
<td background="/images/background-mem.gif"><b>Fine</b></td>
|
|
<td background="/images/background-mem.gif"><b>Bulk</b></td>
|
|
<td background="/images/background-mem.gif"><b>Fee</b></td>
|
|
<td background="/images/background-mem.gif"><b>Overdue</b></td>
|
|
<td background="/images/background-mem.gif"><b>Reserve</b></td>
|
|
<td background="/images/background-mem.gif"> </td>
|
|
<td background="/images/background-mem.gif"> </td>
|
|
</tr>
|
|
<!-- TMPL_LOOP NAME="loop" -->
|
|
<tr bgcolor="<!-- TMPL_VAR NAME="toggle" -->">
|
|
<td><!-- TMPL_VAR NAME="categorycode" --></td>
|
|
<td><!-- TMPL_VAR NAME="description" --></td>
|
|
<td><!-- TMPL_VAR NAME="enrolmentperiod" --></td>
|
|
<td><!-- TMPL_VAR NAME="upperagelimit" --></td>
|
|
<td><!-- TMPL_VAR NAME="dateofbirthrequired" --></td>
|
|
<td><!-- TMPL_VAR NAME="finetype" --></td>
|
|
<td><!-- TMPL_VAR NAME="bulk" --></td>
|
|
<td><!-- TMPL_VAR NAME="enrolmentfee" --></td>
|
|
<td><!-- TMPL_VAR NAME="overduenoticerequired" --></td>
|
|
<td><!-- TMPL_VAR NAME="reservefee" --></td>
|
|
<td><a href="<!-- TMPL_VAR NAME="script_name" -->?op=add_form&categorycode=<!-- TMPL_VAR NAME="categorycode" -->">Edit</a></td>
|
|
<td><a href="<!-- TMPL_VAR NAME="script_name" -->?op=delete_confirm&categorycode=<!-- TMPL_VAR NAME="categorycode" -->">Delete</a></td>
|
|
</tr>
|
|
<!-- /TMPL_LOOP -->
|
|
|
|
</table>
|
|
<p><form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
|
|
<input type="hidden" name="op" value="add_form">
|
|
<input type="submit" class="button" value="Add category" alt="Add category"><br>
|
|
</form></p>
|
|
<!-- /TMPL_IF -->
|
|
|
|
|
|
<!-- TMPL_INCLUDE NAME="parameters-bottom.inc" -->
|
|
|
|
|
|
|
|
|