<!-- 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" -->
	<!-- TMPL_LOOP NAME="mainloop" -->
		<h1>流通統計報表</h1>
		<!-- TMPL_IF NAME="loopfilter"-->
			<p>顯示流通 
			<!-- TMPL_LOOP NAME="loopfilter" -->
					<!-- TMPL_IF NAME="err" --> <span class="error"> <b><!--/TMPL_IF --> <strong><!-- TMPL_VAR NAME="crit"--></strong> = <span class="ex"><!-- TMPL_VAR NAME="filter"--></span>, <!-- TMPL_IF NAME="err" --> </span> </b><!--/TMPL_IF -->
			<!-- /TMPL_LOOP --></p>
		<!-- /TMPL_IF NAME="loopfilter"-->
	
		<table> 
			<tr>
				<th scope="col"><!-- TMPL_VAR name="line" --> / <!-- TMPL_VAR name="column" --></th>
				<!-- TMPL_LOOP NAME="loopcol" -->
					<th scope="col"><!-- TMPL_VAR NAME="coltitle" --></th>
				<!-- /TMPL_LOOP -->
				<th scope="col">總計</th>
			</tr>
				<!-- TMPL_LOOP NAME="looprow" -->
					<!-- TMPL_IF NAME="hilighted" --><tr class="highlight"><!-- TMPL_ELSE --><tr><!-- /TMPL_IF -->
						<td>
						<!-- TMPL_VAR NAME="rowtitle" --></td>
						<!-- TMPL_LOOP NAME="loopcell" -->
							<td class="sum">
								<!-- TMPL_IF NAME="value" --><!-- TMPL_VAR NAME="value" -->
								<!-- TMPL_ELSE --> &nbsp;
								<!-- /TMPL_IF -->
							</td>
						<!-- /TMPL_LOOP -->
						<td class="sum">
							<!-- TMPL_VAR NAME="totalrow" -->
						</td>
					</tr>
				<!-- /TMPL_LOOP NAME="looprow" -->
				<tr>
					<td>總計</td>
					<!-- TMPL_LOOP NAME="loopfooter" -->
						<td class="sum">
							<!-- TMPL_VAR NAME="totalcol" -->
						</td>
					<!-- /TMPL_LOOP -->
					<td class="sum"><!-- TMPL_VAR NAME="total" --></td>
				</tr>
		</table>
	<!-- /TMPL_LOOP -->
	
<!-- TMPL_ELSE -->
	<h1>建立流通統計報表</h1>
	<div class="help">至少選擇一部份資訊，顯示在報表列的內容，以及欄的內容。</div>
	<form method="post">
	<div class="data">
	<table>
		<caption>時間範圍</caption>
		<thead>
			<tr>
			<th scope="col">顯示列</th>
			<th scope="col">顯示欄</th>
			<th scope="col">從...</th>
			<th scope="col">...到</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td><input type="radio" name="Line" value="時間" /></td>
				<td><input type="radio" name="Column" value="時間" /></td>
				<td><input type="text" size="10" id="from" name="Filter" />
							<img src="<!-- TMPL_VAR Name="themelang" -->/includes/calendar/cal.gif" border="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></td><td>
					<input 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" />
							<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>
			</table>
			<table>
			<caption>處理型式</caption>
			<thead><tr><th scope="col">型式</th><th scope="col">依照群組</th><th scope="col">限制日</th><th scope="col">限制月</th></tr></thead>
			<tr> 
				<td><select id="PeriodTypeSel" name="PeriodTypeSel">
					<option value ="issue">流通</option>
					<option value ="return">返回</option>
					</select></td>
				<td><select id="DisplayBy" name="DisplayBy">
					<option value="">沒有選擇</option>
					<option value ="1">日</option>
					<option value ="2">月</option>
					<option value ="3">年</option>
					</select>
					
				</td>
				<td><select id="PeriodDaySel" name="PeriodDaySel">
					<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>
					
					<td><select id="PeriodMonthSel" name="PeriodMonthSel">
					<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>
			</table>
			<table>
			<caption>讀者類別</caption>
			<thead><tr>
			<th scope="col">顯示列</th><th scope="col">顯示欄</th><th scope="col">限制類別</th></tr></thead>
				<td><input type="radio" name="Line" value="borrowers.categorycode" /></td>
				<td><input type="radio" name="Column" value="borrowers.categorycode" /></td>
				<td><!-- TMPL_VAR NAME="CGIBorCat" --></td>
			</tr>
			</table>
			<table>
			<caption>館藏型式</caption>
			<thead><tr><th scope="col">顯示列</th><th scope="col">顯示欄</th><th scope="col">限制館藏類別</th></tr></thead>
			<tr>
				<td><input type="radio" name="Line" value="itemtype" /></td>
				<td><input type="radio" name="Column" value="itemtype" /></td>
				<td><!-- TMPL_VAR NAME="CGIItemType" --></td>
			</tr>
			</table>
			
			<table>
			<caption>分館</caption>
			<thead><tr><th scope="col">顯示列</th><th scope="col">顯示欄</th><th scope="col">限制分館</th></tr></thead>
			<tr>
				<td><input type="radio" name="Line" value="branch" /></td>
				<td><input type="radio" name="Column" value="branch" /></td>
				<td><!-- TMPL_VAR NAME="CGIBranch" --></td>
			</tr>
			</table>
			
			<!-- TMPL_IF Name="hassort1" -->
			<table>
				<caption>排序欄位 1</caption>
				<thead><tr><th scope="col">顯示列</th><th scope="col">顯示欄</th><th scope="col">限制排序欄位 1</th></tr></thead>
				<tr> 
					<td><input type="radio" name="Line" value="borrowers.sort1" /></td>
					<td><input type="radio" name="Column" value="borrowers.sort1" /></td>
					<td><!-- TMPL_VAR NAME="CGISort1" --> </td>
				</tr>
				</table>
			<!-- /TMPL_IF -->
			
			<!-- TMPL_IF Name="hassort2" -->
			<table>
				<caption>排序欄位 2</caption>
				<thead><tr><th scope="col">顯示列</th><th scope="col">顯示欄</th><th scope="col">限制排序欄位 2</th></tr></thead>
				<tr> 
					<td><input type="radio" name="Line" value="borrowers.sort2" /></td>
					<td><input type="radio" name="Column" value="borrowers.sort2" /></td>
					<td><!-- TMPL_VAR NAME="CGISort2" --> </td>
				</tr>
				</table>
			<!-- /TMPL_IF -->
	
		<table>
		<caption> Cell value</caption>
		<tr><th><label for="count">計算流通次數</label></th><td><input type="radio" id="count" name="Cellvalue" value="1" checked="checked" /></td></tr>
			<tr><th><label for="count-borrowers">Count borrowers</label></th><td><input type="radio" name="Cellvalue" id="count-borrowers" value="2" />  </td></tr>
			<tr><th><label for="count-items">計算館藏</label></th><td><input type="radio" name="Cellvalue" id="count-items" value="3" />  </td></tr>
			<tr><th><label for="circ-rate">流通頻率</label></th><td><input type="radio" name="Cellvalue" id="circ-rate" value="4" />  </td></tr>
		</table>

<table>
	<caption>輸出選擇</caption>
	<tr><td colspan="2"><label for="screen">顯示</label> <input type="radio" checked name="output" value="screen" id="screen" /></td></tr>
	<tr><td colspan="2"><label for="file">檔案</label><input type="radio" name="output" value="file" id="file" /></td></tr>
<tr><td>&nbsp;</td><td><label for="basename">...named:</label>   <input type="text" id="basename" name="basename" value="匯出" /></td></td></tr>
<tr><td>&nbsp;</td><td><label for="MIME">檔案格式:</label> <!-- TMPL_VAR NAME="CGIextChoice" --></td></tr>
<tr><td>&nbsp;</td><td><label for="sep">刪除限制:</label> <!-- TMPL_VAR NAME="CGIsepChoice" --></td></tr>
</table>
		
	<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></p>
	</div>
<!-- /TMPL_IF -->
</div>

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