<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Koha -- 報表<!-- TMPL_INCLUDE NAME="doc-head-close-calendar.inc" -->
<!-- TMPL_INCLUDE NAME="masthead.inc" -->
<!-- TMPL_INCLUDE NAME="intranet-nav.inc" -->
<div id="main" >

<!-- TMPL_IF NAME="do_it" -->
<script language="JavaScript" type="text/javascript">
function Dopop(link) {
	newin=window.open(link,'width=500,height=400,toolbar=false,scrollbars=yes');
}
</script>
	<!-- TMPL_LOOP NAME="mainloop" -->
		<h1>Koha : 最熱門 <!-- TMPL_VAR NAME="limit"--> 借閱讀者 </h1>
		<!-- TMPL_IF NAME="loopfilter"-->
			<p>過濾</p>
			<!-- TMPL_LOOP NAME="loopfilter" -->
					<p><!-- TMPL_IF NAME="err" --> <font color="red"> <b><!--/TMPL_IF --><label class="label100"> <!-- TMPL_VAR NAME="crit"--> =</label><!-- TMPL_VAR NAME="filter"--><!-- TMPL_IF NAME="err" --> </font> </b><!--/TMPL_IF --></p>
			<!-- /TMPL_LOOP -->
		<!-- /TMPL_IF NAME="loopfilter"-->
		<br>
		<table>
			<tr >
				<th>排序/讀者</th>
				<!-- TMPL_LOOP NAME="loopcol" -->
					<th colspan="2"><!-- TMPL_VAR NAME="coltitle" --></th>
				<!-- /TMPL_LOOP -->
			</tr>
			<tr >
				<th>&nbsp;</th>
				<!-- TMPL_LOOP NAME="loopcol" -->
					<th>讀者</th>
					<th>計算流通</th>
				<!-- /TMPL_LOOP -->
			</tr>
				<!-- TMPL_LOOP NAME="looprow" -->
					<tr>
						<!-- TMPL_IF NAME="highlight" --><td class="highlight"><!-- TMPL_ELSE --><td><!-- /TMPL_IF -->
						<!-- TMPL_VAR NAME="rowtitle" --></td>
						<!-- TMPL_LOOP NAME="loopcell" -->
							<!-- TMPL_IF NAME="highlight" --><td class="highlight"><!-- TMPL_ELSE --><td ><!-- /TMPL_IF -->
								<!-- TMPL_IF NAME="reference" --><a href="javascript:Dopop('../members/moremember.pl?bornum=<!-- TMPL_VAR NAME="reference" -->')" ><!-- /TMPL_IF -->
								<!-- TMPL_IF NAME="value" --><!-- TMPL_VAR NAME="value" --><!-- /TMPL_IF -->
								<!-- TMPL_IF NAME="reference" --></a><!-- /TMPL_IF -->
							</td>
							<!-- TMPL_IF NAME="highlight" --><td class="highlight"><!-- TMPL_ELSE --><td ><!-- /TMPL_IF -->
								<!-- TMPL_IF NAME="count" --><!-- TMPL_VAR NAME="count" --><!-- /TMPL_IF -->
							</td>
						<!-- /TMPL_LOOP -->
					</tr>
				<!-- /TMPL_LOOP NAME="looprow" -->
		</table>
	<!-- /TMPL_LOOP -->
	
<!-- TMPL_ELSE -->

	<h1 class = "reports">Koha : 最熱門借閱讀者 </h1>
	<form method="post" action="/cgi-bin/koha/reports/bor_issues_top.pl">
	<div class="data">
	<table>
		<thead>
			<tr>
			<th scope="col">&nbsp;</th>
			<th scope="col">限制到 </th>
			<th scope="col">依照 </th>
			
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>&nbsp;</td>
				<td>
					<select name="Limit">
						<option value ="5" checked> 5</option>
						<option value ="10">10</option>
						<option value ="15">15</option>
						<option value ="20">20</option>
	<!--					<option value ="25">25</option>
						<option value ="40">40</option>
						<option value ="50">50</option>
						<option value ="100">100</option>-->
					</select>
				</td>
				<td>
					<select name="Criteria">
						<option value ="" checked>沒有選擇</option>
						<option value ="issuingbranch">分館</option>
						<option value ="categorycode">分類號</option>
						<option value ="itemtype">館藏型式</option>
						<option value ="Day">日</option>
						<option value ="Week">星期</option>
						<option value ="Month">月</option>
						<option value ="Year">年</option>
					</select>
				</td>
				
			</tr>
			<tr><th scope="col" colspan="3">過濾</th></tr>
			<tr class="highlight"><th scope="row">流通時間</th>
				<td colspan="2"> 從 <input type="text" readonly="readonly" size="10" id="from" name="Filter" >
							<img src="<!-- TMPL_VAR Name="themelang" -->/includes/calendar/cal.gif" border="0" hspace="0" vspace="0" id="openCalendarFrom" style="cursor: pointer;" valign="top">
								<script language="JavaScript" type="text/javascript">
									function validate1(date) {
										var day = date.getDate();
										var month = date.getMonth() + 1;
										var year = date.getFullYear();
										var weekDay = date.getDay();
										var dayMonth = month + '-' + day;
										var dateString = year + '-' + month + '-' + day;
										var dateTo = document.getElementById('to').value.split("-");
										var limitDate = new Date(dateTo[0], (dateTo[1] - 1), dateTo[2]);
										if (date > limitDate) {
											return true;
										} else {
											return false;
										}
									}
					
									Calendar.setup(
										{
											inputField : "從",
											ifFormat : "%Y-%m-%d",
											button : "openCalendarFrom",
											disableFunc : validate1,
											dateStatusFunc : validate1
										}
									);
								</script>
					To <input readonly="readonly" size="10" id="to" name="Filter" value="" type="text">
						<img src="<!-- TMPL_VAR Name="themelang" -->/includes/calendar/cal.gif" id="openCalendarTo" style="cursor: pointer;" valign="top" border="0" hspace="0" vspace="0">
							<script type="text/javascript">
								function validate2(date) {
									var day = date.getDate();
									var month = date.getMonth() + 1;
									var year = date.getFullYear();
									var weekDay = date.getDay();
									var dayMonth = month + '-' + day;
									var dateString = year + '-' + month + '-' + day;
									var dateFrom = document.getElementById('from').value.split("-");
									var limitDate = new Date(dateFrom[0], (dateFrom[1] - 1), dateFrom[2]);
									if (limitDate > date) {
										return true;
									} else {
										return false;
									}
								}
		
								Calendar.setup(
									{
										inputField : "到",
										ifFormat : "%Y-%m-%d",
										button : "openCalendarTo",
										disableFunc : validate2,
										dateStatusFunc : validate2
									}
								);
							</script>
				</td>
			</tr>
			<tr>
				<th scope="row">返回</th>
				<td colspan="2"> 從 <input type="text" readonly="readonly" size="10" id="fromRO" name="Filter" >
							<img src="<!-- TMPL_VAR Name="themelang" -->/includes/calendar/cal.gif" border="0" hspace="0" vspace="0" id="openCalendarFromRO" style="cursor: pointer;" valign="top">
								<script language="JavaScript" type="text/javascript">
									function validate1(date) {
										var day = date.getDate();
										var month = date.getMonth() + 1;
										var year = date.getFullYear();
										var weekDay = date.getDay();
										var dayMonth = month + '-' + day;
										var dateString = year + '-' + month + '-' + day;
										var dateTo = document.getElementById('toRO').value.split("-");
										var limitDate = new Date(dateTo[0], (dateTo[1] - 1), dateTo[2]);
										if (date > limitDate) {
											return true;
										} else {
											return false;
										}
									}
					
									Calendar.setup(
										{
											inputField : "fromRO",
											ifFormat : "%Y-%m-%d",
											button : "openCalendarFromRO",
											disableFunc : validate1,
											dateStatusFunc : validate1
										}
									);
								</script>
					To <input type="text" readonly="readonly" size="10" id="toRO" name="Filter" value="" >
						<img src="<!-- TMPL_VAR Name="themelang" -->/includes/calendar/cal.gif" id="openCalendarToRO" style="cursor: pointer;" valign="top" border="0" hspace="0" vspace="0">
							<script type="text/javascript">
								function validate2(date) {
									var day = date.getDate();
									var month = date.getMonth() + 1;
									var year = date.getFullYear();
									var weekDay = date.getDay();
									var dayMonth = month + '-' + day;
									var dateString = year + '-' + month + '-' + day;
									var dateFrom = document.getElementById('fromRO').value.split("-");
									var limitDate = new Date(dateFrom[0], (dateFrom[1] - 1), dateFrom[2]);
									if (limitDate > date) {
										return true;
									} else {
										return false;
									}
								}
		
								Calendar.setup(
									{
										inputField : "toRO",
										ifFormat : "%Y-%m-%d",
										button : "openCalendarToRO",
										disableFunc : validate2,
										dateStatusFunc : validate2
									}
								);
							</script>
				</td>
			</tr>
			<tr class="highlight"><th scope="row">分館</th>
				<td colspan="2">
					<select name="Filter">
						<option value="">所有分館</option>
						<!-- TMPL_LOOP name="branchloop" -->
							<option value="<!-- TMPL_VAR name="value" -->"<!-- TMPL_IF name="selected" --> selected="selected"<!-- /TMPL_IF -->><!-- TMPL_VAR name
	="branchname" --></option>
						<!-- /TMPL_LOOP -->
					</select>
				</td>
			</tr>
			<tr><th scope="row">文件型式</th>
				<td colspan="2">
					<select name="Filter">
						<option value="">所有館藏型式</option>
						<!-- TMPL_LOOP name="itemtypeloop" -->
							<option value="<!-- TMPL_VAR name="value" -->" <!-- TMPL_IF name="selected" --> selected="selected"<!-- /TMPL_IF -->><!-- TMPL_VAR name
	="description" --></option>
						<!-- /TMPL_LOOP -->
					</select>
				</td>
			</tr>
			<tr class="highlight"><th scope="row">讀者類別</th>
				<td colspan="2">
					<select name="Filter">
						<option value="">所有讀者類別</option>
						<!-- TMPL_LOOP name="borcatloop" -->
							<option value="<!-- TMPL_VAR name="value" -->" <!-- TMPL_IF name="selected" --> selected="selected"<!-- /TMPL_IF -->><!-- TMPL_VAR name
	="description" --></option>
						<!-- /TMPL_LOOP -->
					</select>
				</td>
			</tr>
			<tr><th scope="row">日</th>
				<td colspan="2">
					<select name="Filter">
						<option value="">任何一天</option>
						<option value="Monday">星期一</option>
						<option value="Tuesday">星期二</option>
						<option value="Wednesday">星期三</option>
						<option value="Thursday">星期四</option>
						<option value="Friday">星期五</option>
						<option value="Saturday">星期六</option>
						<option value="Sunday">星期日</option>
					</select>
				</td>
			</tr>
			<tr class="highlight"><th scope="row">月</th>
				<td colspan="2">
					<select name="Filter">
						<option value="">任何一個月份</option>
						<option value="January">一月</option>
						<option value="February">二月</option>
						<option value="March">三月</option>
						<option value="April">四月</option>
						<option value="May">五月</option>
						<option value="June">六月</option>
						<option value="July">七月</option>
						<option value="August">八月</option>
						<option value="September">九月</option>
						<option value="October">十月</option>
						<option value="November">十一月</option>
						<option value="December">十二月</option>
					</select>
				</td>
			</tr>
			<tr><th scope="row">年</th>
				<td colspan="2"><input type="text" name="Filter" value=""></td>
			</tr>
		</tbody>
	</table>
	</div>
	
	<div class="details">
		<h3> 輸出 </h3>
		<input type="radio" checked name="output" value="screen" > 顯示
		<br>
		<input type="radio" name="output" value="file"> 檔案 <input type="text" name="basename" value="匯出"> 匯出到程式  
		<!-- TMPL_VAR NAME="CGIextChoice" -->
		<!-- TMPL_VAR NAME="CGIsepChoice" -->
	</p>
	</div>
	<p>
	<input TYPE="submit" value="產生報表" class="submit">
	<input type="hidden" name="report_name" value="<!--TMPL_VAR NAME="report_name" -->">
	<input type="hidden" name="do_it" value="1">
	</form>
<!-- /TMPL_IF -->
</div>

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