<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Koha -- 系統管理: <!-- TMPL_IF name="else" -->Book Funds<!-- /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="bookfundname" -->'<!-- /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>
<!-- TMPL_IF NAME="bookfund" --><form action="<!-- TMPL_VAR name=scriptname -->" 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>刪除</th>
	</tr>
<!-- TMPL_LOOP name="bookfund" -->
	<tr>
		<td><a href="<!-- TMPL_VAR name="action" -->?op=add_form&amp;bookfundid=<!-- TMPL_VAR name="bookfundid" --> "><!-- TMPL_VAR name="bookfundid" --></a></td>
		<td><!-- TMPL_VAR name="bookfundname" --></td>
		<td><!--TMPL_VAR Name="branchname"--></td>
		<td><form action="<!-- TMPL_VAR name="action" -->" method="get"><input type="hidden" name="op" value="add_form" /><input type="hidden" name="bookfundid" value="<!-- TMPL_VAR name="bookfundid" -->" /><input type="submit" class="submit" value="編輯" /></form></td>
		<td><form action="<!-- TMPL_VAR name="action" -->" method="get"><input type="hidden" name="op" value="delete_confirm" /><input type="hidden" name="bookfundid" value="<!-- TMPL_VAR name="bookfundid" -->" /><input type="submit" class="delete" value="刪除" /></form></td>
	</tr>
		<tr>
		<td>&nbsp;</td>
		<td><b>預算</b></td>
		<td>分館</td>
		<td><form action="aqbudget.pl" method="get"><input type="hidden" name="op" value="add_form" /><input type="hidden" name="bookfundid" value="<!-- TMPL_VAR name="bookfundid" -->" /><input type="submit" class="submit" value="新增預算" /></form></td>
		<td></td>
	</tr>
	<!-- TMPL_LOOP name="budget" -->
		<tr>
			<td>&nbsp;</td>
			<td>
				<!-- TMPL_VAR name="startdate" --> - <!-- TMPL_VAR name="enddate" --> : <b><!-- TMPL_VAR name="budgetamount" --></b>
			</td>
			<td>
				<!--TMPL_IF Name="branchcode"-->
				 	<!--TMPL_VAR Name="branchcode"-->
				<!--TMPL_ELSE -->
					&nbsp;
				<!--/TMPL_IF-->
				</td>
			<td><form action="/cgi-bin/koha/admin/aqbudget.pl" method="get"><input type="hidden" name="op" value="add_form" /><input type="hidden" name="aqbudgetid" value="<!-- TMPL_VAR name="aqbudgetid" -->" /><input type="submit" class="submit" value="編輯" /></form></td>
			<td><form action="/cgi-bin/koha/admin/aqbudget.pl" method="get"><input type="hidden" name="op" value="delete_confirm" /><input type="hidden" name="aqbudgetid" value="<!-- TMPL_VAR name="aqbudgetid" -->" /><input type="submit" class="delete" value="刪除" /></form></td>

		</tr>
	<!-- /TMPL_LOOP -->
<!-- /TMPL_LOOP -->
</table><!-- /TMPL_IF -->
<form action="<!-- TMPL_VAR name=scriptname -->" method="post">
	<p><input type="hidden" name="op" value="add_form" /></p>
<input type="submit"value="新增書籍經費" class="submit" /></form>
<!-- /TMPL_IF -->

<!-- TMPL_IF name="add_form" -->
<script>
	//
	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 (f.bookfundname.value.length==0) {
			_alertString += "- 書籍經費名稱遺失";
		}
		if (_alertString.length==0) {
			document.Aform.submit();
		} else {
			alertString2 = "表格無法寄送，因為接下來的問題\n";
			alertString2 += "------------------------------------------------------------------------------------\n\n";
			alertString2 += _alertString;
			alert(alertString2);
		}
	}
	</SCRIPT>
<form action="<!-- TMPL_VAR name="action" -->" name="Aform" method="post">
<input type="hidden" name="op" value="add_validate" />
<input type="hidden" name="checked" value="0" />
<div class="data">
<table>
<caption><!-- TMPL_VAR name="header" --></caption>
<!-- TMPL_IF name="add_or_modify" -->
<tr><th>書籍經費</th><td><input type="hidden" name="bookfundid" value="<!-- TMPL_VAR name="bookfundid" -->" /><!-- TMPL_VAR name="bookfundid" --></td></tr>
<!-- TMPL_ELSE -->
<tr><th>書籍經費</th><td><input type="text" name="bookfundid" size="5" maxlength="5" onblur="toUC(this)" /></td></tr>
<!-- /TMPL_IF -->
<tr><th>名稱</th><td><input type="text" name="bookfundname" size="40" maxlength="80" value="<!-- TMPL_VAR name="bookfundname" escape="HTML" -->" /></td></tr>
<tr><th><label>分館</label></th><td><!-- TMPL_VAR NAME="CGIbranch"-->	選擇一個假如是分館的特別預算，否則留下空白。</td></tr>
</table>
</div>
<p><input type="button" value="<!-- TMPL_VAR name="header" -->" onclick="Check(this.form); return false;" class="submit" /> <input type="submit" class="cancel" value="刪除" onclick="location.href='<!-- TMPL_VAR name="action" -->'; return false;" /></p>
</form>
<!-- /TMPL_IF -->

<!-- TMPL_IF name="add_validate" -->
<h3>資料被記錄</h3>
<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>確認刪除經費 <em><!-- TMPL_VAR name="bookfundid" --></em></h3>
<div class="data"><table>
<tr><th>書籍經費</th><td><!-- TMPL_VAR name="bookfundid" --></td></tr>
<tr><th>名稱</th><td><!-- TMPL_VAR name="bookfundname" --></td></tr><tr><th>群組</th><td><!-- TMPL_VAR name="bookfundgroup" --></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="bookfundid" value="<!-- TMPL_VAR name="bookfundid" -->" /><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" -->
