<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Koha -- 目錄: 進階 MARC 查詢
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
<!-- TMPL_INCLUDE NAME="masthead.inc" -->
<!-- TMPL_INCLUDE NAME="search-topmenu.inc" -->
<!-- TMPL_INCLUDE NAME="intranet-nav.inc" -->

<div id="main">
<h1>目錄查詢</h1>
<form name="f" method="post" action="search.pl">
<input type="hidden" name="op" value="do_search" />
<input type="hidden" name="type" value="intranet" />
<input type="hidden" name="nbstatements" value="<!-- TMPL_VAR NAME="nbstatements" -->" />

<div class="form">
<table>
<caption>快速查詢</caption>
					<tr>
			<th><label for="keyword_main">任何 <span class="accesskey" title="Access Key w">關鍵詞</span></label></th>
			<td><input type="hidden" name="marclist" value="" />
			<input type="hidden" name="and_or" value="and" />
			<input type="hidden" name="excluding" value="" />
			<input type="hidden" name="operator" value="contains" />
			<input type="text" id="keyword_main" name="value" onchange="sql_update()" size="35" accesskey="w" /></td>
		</tr>
		<tr>
			<th><label for="title"><span class="accesskey" title="Access Key t">題名</span></label></th>
			<td><input type="hidden" name="marclist" value="biblio.title" />
			<input type="hidden" name="and_or" value="and" />
			<input type="hidden" name="excluding" value="" />
			<input type="hidden" name="operator" value="contains" />
			<input type="text" id="title" name="value" onchange="sql_update()" size="35" accesskey="t" />			<!-- TMPL_UNLESS NAME="Disable_Dictionary" --><a href="javascript:Dopop('dictionary.pl?marclist=biblio.title&amp;type=intranet&amp;index=1',1)">
				<strong>字典查詢</strong>
			</a><!-- /TMPL_UNLESS --></td>
		</tr>
		<tr>
			<th><label for="author"><span class="accesskey" title="Access Key a">作者</span></label></th>
			<td><input type="hidden" name="marclist" value="biblio.author" />
			<input type="hidden" name="and_or" value="and" />
			<input type="hidden" name="excluding" value="" />
			<input type="hidden" name="operator" value="contains" />
			<input type="text" id="author" name="value" onchange="sql_update()" size="35" accesskey="a" />			<!-- TMPL_UNLESS NAME="Disable_Dictionary" --><a href="javascript:Dopop('dictionary.pl?marclist=biblio.author&amp;type=intranet&amp;index=2',2)">
				<strong>字典查詢</strong>
			</a><!-- /TMPL_UNLESS --></td>
		</tr>
		<tr>
			<th><label for="subject"><span class="accesskey" title="Access Key s">主題</span></label></th>
			<td><input type="hidden" name="marclist" value="bibliosubject.subject" />
			<input type="hidden" name="and_or" value="and" />
			<input type="hidden" name="excluding" value="" />
			<input type="hidden" name="operator" value="contains" />  
			<input type="text" id="subject" name="value" onchange="sql_update()" size="35" accesskey="s" />			<!-- TMPL_UNLESS NAME="Disable_Dictionary" --><a href="javascript:Dopop('dictionary.pl?marclist=bibliosubject.subject&amp;type=intranet&amp;index=3',3)">
				<strong>字典查詢</strong>
			</a><!-- /TMPL_UNLESS --></td>
		</tr>
<tr><th><label for="seriestitle">期刊題名</label></th><td>			
			<input type="hidden" name="marclist" value="biblio.seriestitle" />
			<input type="hidden" name="and_or" value="and" />
			<input type="hidden" name="excluding" value="" />
			<input type="hidden" name="operator" value="contains" />
			<input type="text" id="seriestitle" name="value" size="35"/></td></tr>
	</table><input type="submit" value="開始查詢" class="submit" /><table>
		<tr>
			<th><label for="itemtype">館藏型式</label></th>
			<td><input type="hidden" name="marclist" value="biblioitems.itemtype" />
			<input type="hidden" name="and_or" value="and" />
			<input type="hidden" name="excluding" value="" />
			<input type="hidden" name="operator" value="=" />
			<!-- TMPL_VAR name="CGIitemtype" --></td>
		</tr>
		<tr>
				<th><label for="branch">分館</label></th>
				<td><input type="hidden" name="marclist" value="items.homebranch" />
				<input type="hidden" name="and_or" value="and" />
				<input type="hidden" name="excluding" value="" />
				<input type="hidden" name="operator" value="=" />  
				<!-- TMPL_VAR name="CGIbranch" --></td>
		</tr>
		<tr>
				<th><label for="barcode">館藏 <span class="accesskey" title="Access Key b">條碼</span>（Barcode）</label></th>
				<td><input type="hidden" name="marclist" value="items.barcode" />
				<input type="hidden" name="and_or" value="and" />
				<input type="hidden" name="excluding" value="" />
				<input type="hidden" name="operator" value="start" />
				<input type="text" id="barcode" name="value" onchange="sql_update()" size="14" maxlength="14" accesskey="b" /></td> 
		</tr>
		<tr>
			<th><label for="callno"><span class="accesskey" title="Access Key c">索書號</span>（Call Number）</label></th>
			<td><input type="hidden" name="marclist" value="items.itemcallnumber" />
			<input type="hidden" name="and_or" value="and" />
			<input type="hidden" name="excluding" value="" />
			<input type="hidden" name="operator" value="start" />
			<input type="text" id="callno" name="value" onchange="sql_update()" size="35"  accesskey="c" /></td>
		</tr>
		<tr>
			<th><label for="isbn">國際標準書號<span class="accesskey" title="Access Key n"></span>（ISBN）</label></th>
			<td><input type="hidden" name="marclist" value="biblioitems.isbn" />
			<input type="hidden" name="and_or" value="and" />
			<input type="hidden" name="excluding" value="" />
			<input type="hidden" name="operator" value="=" />
			<input type="text" id="isbn" name="value" onchange="sql_update()" size="35"  accesskey="n" /></td>
		</tr>
		<tr>
			<th><label for="publisher"><span class="accesskey" title="Access Key p">出版者</span></label></th>
			<td><input type="hidden" name="marclist" value="biblioitems.publishercode" />
			<input type="hidden" name="and_or" value="and" />
			<input type="hidden" name="excluding" value="" />
			<input type="hidden" name="operator" value="contains" />
			<input type="text" id="publisher" name="value" onchange="sql_update()" size="35"  accesskey="p" /></td>
		</tr>
		</table>
		<input type="submit" value="開始查詢" class="submit" />
</div>

<div class="table">
	<table>
	<caption>查詢新增 MARC 欄位</caption>
		<!-- TMPL_LOOP NAME="statements" -->
			<tr>
				<td><select name="and_or" size="1" onchange="sql_update()">
					<option value="and">和</option>
					<option <!-- TMPL_IF NAME="or" -->選擇 <!-- /TMPL_IF -->value="or">或是</option>
				</select>
				<!-- TMPL_VAR NAME="marclist" -->
				<select name="excluding" size="1" onchange="sql_update()">
					<option value="0"> </option>
					<option <!-- TMPL_IF NAME="not" -->selected <!-- /TMPL_IF -->value="1">不是</option>
				</select>
				<select name="operator" size="1" onchange="sql_update()">
					<option <!-- TMPL_IF NAME="contains" -->選擇<!-- /TMPL_IF --> value="contains">包含</option>
					<option <!-- TMPL_IF NAME="eq" -->選擇<!-- /TMPL_IF --> value="=">等於</option>
					<option <!-- TMPL_IF NAME="start" -->選擇<!-- /TMPL_IF --> value="start">開始查詢</option>
					<option <!-- TMPL_IF NAME="gt" -->選擇<!-- /TMPL_IF --> value=">">大於</option>
					<option <!-- TMPL_IF NAME="ge" -->選擇<!-- /TMPL_IF --> value=">=">大於或是等於</option>
					<option <!-- TMPL_IF NAME="lt" -->選擇<!-- /TMPL_IF --> value="<">小於</option>
					<option <!-- TMPL_IF NAME="le" -->selected<!-- /TMPL_IF --> value="<=">小於或是等於</option>
				</select>
				<input type="text" name="value" onchange="sql_update();" <!-- TMPL_IF NAME="value" -->value="<!-- TMPL_VAR NAME="value" -->"<!-- /TMPL_IF -->></td>
			</tr>
		<!-- /TMPL_LOOP -->
		<tr>
		<td><input type="button" value="新增規則" onclick="AddStatement(); return false;" class="submit">
		注意 :  假如你輸入 2 個或是較少的字母，"包含" 無法處理</td>
	</tr>
	<tr>
			<td><div name="sql">
				<textarea name="sql" rows="3" cols="55" disabled readonly></textarea>
			</div></td>
		</tr>
		<tr>
			<td>結果每頁 :<select align="right" name="resultsperpage" size="1">
				<option value="20">20</option>
				<option value="50">50</option>
				<option value="100">100</option>
			</select>
		排序依照
			<select name="orderby" size="1">
				<option value="biblio.title">題名</option>
				<option value="biblio.author">作者</option>
				<option value="biblioitems.dewey">分類號</option>
				<option value="biblioitems.publicationyear">出版年</option>
				<option value="biblioitems.publishercode">出版者</option>
			</select>
			<select name="desc_or_asc" size="1">
				<option value="ASC">遞增</option>
				<option value="DESC">遞減</option>
			</select>
			</td>
		</tr></table>
		<p>
			<input type="submit" value="開始查詢" class="submit" />
			<input type="button" value="建議查詢詞彙" class="submit" onclick="PopupSuggestion(); return false;" />
		</p>
		</div>
	</form>
</div>

<script language="javascript" type="text/javascript">
function sql_update() {
document.f.sql.value="";
	for (i=0 ; i<document.f.marclist.length ; i++) {
		if (document.f.value[i].value.length>0) {
			document.f.sql.value = document.f.sql.value+
										document.f.and_or[i].value + ' (' +
										document.f.excluding[i].value + ' ' +
										document.f.marclist[i].value + ' ' +
										document.f.operator[i].value + ' ' +
										'\''+document.f.value[i].value + '\') ';
		}
	}
}

function AddStatement() {

	document.forms['f'].op.value="AddStatement";
	document.f.submit();
}

function Dopop(link,i) {
	var searchstring=document.forms[4].value[i].value;
	newin=window.open(link+'&amp;search='+searchstring,"popup",'width=700,height=550,toolbar=false,scrollbars=yes');
}

function PopupSuggestion() {
    var strQuery="";
	for (i=0 ; i<document.f.marclist.length ; i++) {
		if (document.f.value[i].value.length>0) {
		    strQuery += " "+document.f.value[i].value;
		}
	}
	newin=window.open("suggest.pl?Q="+strQuery,"Suggestions",'width=500,height=400,toolbar=false,scrollbars=yes');
}

</script>

<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
