<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Koha -- 系統管理: <!-- TMPL_IF name="else" -->預算管理<!-- /TMPL_IF -->
<!-- TMPL_IF name="add_form" --><!-- TMPL_VAR NAME="header" --><!-- /TMPL_IF -->
<!-- TMPL_IF name="add_validate" -->預算資料被記錄<!-- /TMPL_IF -->
<!-- TMPL_IF name="delete_confirm" -->刪除書籍經費 '<!-- TMPL_VAR NAME="bookfundid" -->'<!-- /TMPL_IF -->
<!-- TMPL_IF name="delete_confirmed" -->書籍經費被刪除<!-- /TMPL_IF -->
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
<!-- TMPL_INCLUDE NAME="masthead.inc" -->
<!-- TMPL_INCLUDE NAME="admin-topmenu.inc" -->
<!-- TMPL_INCLUDE NAME="intranet-nav.inc" -->

<div id="main">
<!-- TMPL_IF name="else" -->
<h1>預算管理</h1><form action="/cgi-bin/koha/admin/aqbudget.pl" method="post">
	<input type="text" name="searchfield" value="" /> <input type="submit" name="search" value="查詢" class="submit" /></form>
	<!-- TMPL_IF name="search" -->
	<div id="results">你查詢為了 <span class="ex"><!-- TMPL_VAR NAME="searchfield" --></span></div>
	<!-- /TMPL_IF -->
<table>
	<tr><th>書籍經費</th><th>開始日期</th><th>結束日期</th><th>預算總計</th><th colspan="2">&nbsp;</th></tr>
	<!-- TMPL_LOOP name="budget" -->
		<tr>
			<td><!-- TMPL_VAR NAME="bookfundid" --> (<!-- TMPL_VAR NAME="bookfundname" -->)</td>
			<td><!-- TMPL_VAR NAME="startdate" --></td>
			<td><!-- TMPL_VAR NAME="enddate" --></td>
			<td><!-- TMPL_VAR NAME="budgetamount" --></td>
			<td><a class="edit" href="/cgi-bin/koha/admin/aqbudget.pl?op=add_form&amp;bookfundid=<!-- TMPL_VAR NAME="bookfundid" -->">編輯</a></td>
			<td><a class="delete" href="/cgi-bin/koha/admin/aqbudget.pl?op=delete_confirm&amp;bookfundid=<!-- TMPL_VAR NAME="bookfundid" -->">刪除</a></td>
		</tr>
	<!-- /TMPL_LOOP -->
	</table>
	<form action="/cgi-bin/koha/admin/aqbudget.pl" method="post">
	<p><input type="hidden" name="op" value="add_form" /><input type="submit" class="submit" value="新增預算" /></p></form>
<!-- /TMPL_IF -->

<!-- TMPL_IF name="add_form" -->
<script language="JavaScript" type="text/javascript">
	//
	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.bookfundid.value.length==0) {
			_alertString += "- 書籍經費遺失\n";
		}
		if (!(isNotNull(window.document.Aform.budgetamount,1))) {
			_alertString += "- 預算遺失\n";
		}
		if (_alertString.length==0) {
			document.Aform.submit();
		} else {
			alertString2 = "表格無法寄送因為接下來問題\n";
			alertString2 += "------------------------------------------------------------------------------------\n\n";
			alertString2 += _alertString;
			alert(alertString2);
		}
	}
	</script>

<form action="/cgi-bin/koha/admin/aqbudget.pl" name="Aform" method="post">
<input type="hidden" name="op" value="add_validate" />
<input type="hidden" name="checked" value="0" />
<h1><!-- TMPL_VAR NAME="header" --></h1>
<div class="data">
<table>
<!-- TMPL_IF name="modify" -->
<tr><th>書籍經費</th><td><input type="hidden" name="bookfundid" value="<!-- TMPL_VAR NAME="bookfundid" -->" /><!-- TMPL_VAR NAME="bookfundid" --></td></tr>
<tr><th>書籍經費名稱</th><td><!-- TMPL_VAR NAME="bookfundname" --></td></tr>
<!-- /TMPL_IF -->

<!-- TMPL_IF name="adding" -->
<tr><th><label for="bookfundid">書籍經費</label></th><td><input type="hidden" name="bookfundid" id="bookfundid" size="5" maxlength="5" value="<!-- TMPL_VAR NAME="bookfundid" -->" /><!-- TMPL_VAR NAME="bookfundid" --></td></tr>
<!-- /TMPL_IF -->

<tr><th><label for="startdate">開始日期 (<!-- TMPL_VAR NAME="dateformat" -->)</label></th><td><input type="text" id="startdate" name="startdate" value="<!-- TMPL_VAR NAME="startdate" -->" />&nbsp;</td></tr>
<tr><th><label for="enddate">結束日期 (<!-- TMPL_VAR NAME="dateformat" -->)</label></th><td><input type="text" id="enddate" name="enddate" value="<!-- TMPL_VAR NAME="enddate" -->" /></td></tr>
<tr><th><label for="budgetamount">預算總計</label></th><td><input type="text" name="budgetamount" id="budgetamount" value="<!-- TMPL_VAR NAME="budgetamount" -->" /></td></tr>
<tr><th><label for="branch">分館</label></th><td>	
			<!--TMPL_VAR Name="CGIbranch" -->
			<p>假如預算特別被許可給分館，選擇這裡，否則留下空白。</p></td></tr>
<tr><th><label>Branch</label></th><td>	<!--TMPL_VAR Name="CGIbranch" --> 假如預算完整給特別的分館，選擇這裡，否則留下空白。</td></tr>
</table></div>
<input type="hidden" name="aqbudgetid" value="<!-- TMPL_VAR NAME="aqbudgetid" -->" /><input type="button" value="<!-- TMPL_VAR NAME="header" -->" class="submit" onclick="Check(this.form)" /> <input type="button" class="cancel" value="刪除" onclick="location.href='/cgi-bin/koha/admin/aqbudget.pl'; return false;" /></form>
<!-- /TMPL_IF -->

<!-- TMPL_IF name="add_validate" -->
<h3>預算資料被記錄</h3><table><tr><td>
<form action="<!-- TMPL_VAR NAME="action" -->" method="post">
<input type="submit" value="繼續" class="submit" />
</form></td></tr></table>
<!-- /TMPL_IF -->

<!-- TMPL_IF name="delete_confirm" -->
<h3>刪除書籍預算？</h3>
<div class="data"><table>
<tr><th>開始日期</th><td><!-- TMPL_VAR NAME="startdate" --></td></tr>
<tr><th>結束日期</th><td><!-- TMPL_VAR NAME="enddate" --></td></tr>
<tr><th>預算總計</th><td><!-- TMPL_VAR NAME="budgetamount" --></td></tr>
</table></div>

<div class="tabitem"><form action="<!-- TMPL_VAR NAME="action" -->" method="post"><input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="aqbudgetid" value="<!-- TMPL_VAR NAME="aqbudgetid" -->" /><input type="submit" value="刪除這本書經費" class="cancel" /></form> <form action="<!-- TMPL_VAR NAME="action" -->" method="post"><input type="submit" value="不要刪除" class="submit" /></form></div>
<!-- /TMPL_IF -->

<!-- TMPL_IF name="delete_confirmed" -->
<h3>預算被刪除</h3>
<div class="form"><form action="<!-- TMPL_VAR NAME="action" -->" method="post">
<input type="submit" value="繼續" class="submit" />
</form></div>
<!-- /TMPL_IF -->
</div>
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
