<!-- 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>Koha : 統計採訪 </h1>
		<!-- TMPL_IF NAME="loopfilter"-->
			<p>過濾</p>
			<!-- TMPL_LOOP NAME="loopfilter" -->
					<p><!-- TMPL_IF NAME="err" --> <span class="error"> <b><!--/TMPL_IF --><!-- TMPL_VAR NAME="crit"--> =<!-- TMPL_VAR NAME="filter"--><!-- TMPL_IF NAME="err" --> </span> </b><!--/TMPL_IF --></p>
			<!-- /TMPL_LOOP -->
		<!-- /TMPL_IF NAME="loopfilter"-->
		<br />
		<table>
			<tr >
				<th><!-- TMPL_VAR name="line" --> / <!-- TMPL_VAR name="column" --></th>
				<!-- TMPL_LOOP NAME="loopcol" -->
					<th><!-- TMPL_VAR NAME="coltitle" --></th>
				<!-- /TMPL_LOOP -->
				<th>總計</th>
			</tr>
				<!-- TMPL_LOOP NAME="looprow" -->
					<tr>
						<!-- TMPL_IF NAME="highlight" --><td><!-- TMPL_ELSE --><td><!-- /TMPL_IF -->
						<!-- TMPL_VAR NAME="rowtitle" --></td>
						<!-- TMPL_LOOP NAME="loopcell" -->
							<!-- TMPL_IF NAME="highlight" --><td class="numberhighlight"><!-- TMPL_ELSE --><td class="number"><!-- /TMPL_IF -->
								<!-- TMPL_IF Name="value" --><!-- TMPL_VAR NAME="value" -->
								<!-- TMPL_ELSE--> &nbsp;
								<!-- /TMPL_IF -->
							</td>
						<!-- /TMPL_LOOP -->
						<!-- TMPL_IF NAME="highlight" --><td class="numberhighlight"><!-- TMPL_ELSE --><td class="number"><!-- /TMPL_IF -->
							<!-- TMPL_VAR NAME="totalrow" -->
						</td>
					</tr>
				<!-- /TMPL_LOOP NAME="looprow" -->
				<tr >
					<th>總計</th>
					<!-- TMPL_LOOP NAME="loopfooter" -->
						<th>
							<!-- TMPL_VAR NAME="totalcol" -->
						</th>
					<!-- /TMPL_LOOP -->
					<th><!-- TMPL_VAR NAME="total" --></th>
				</tr>
		</table>
	<!-- /TMPL_LOOP -->
<!-- TMPL_ELSE -->
	<h1>統計採訪</h1>
	<form method="post">
	<div class="data"><table>
		<tbody>
			<tr>
				<th>顯示訂購日期:</th>
				<td><label for="Line">列:</label> <input type="radio" name="Line" id="Line" value="aqbasket.closedate" /> <label for="Column">欄:</label> <input type="radio" name="Column" value="aqbasket.closedate" /></td>
			</tr>
			<tr>
			<th>限制日期L: </th>
			<td><label for="from1">從: </label><input type="text"  size="10" id="from1" 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>
					<label for="to1">到:</label> <input  size="10" id="to1" 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>
			<tr> 
				<th>群組依照: </th>
				<td><select name="PlacedOnDisplay">
					<option value="">沒有選擇</option>
					<option value ="1">日</option>
					<option value ="2">月</option>
					<option value ="3">年</option>
					</select>
				</td>
			</tr></table></div>
			
			<div class="data">
			<table>
			<tr>
				<th>顯示接收日期:</th>
				<td><label for="Line2">列: </label><input type="radio" name="Line" id="Line2" value="aqorderdelivery.deliverydate" /> <label for="Column2">欄: </label><input type="radio" name="Column" id="Column2" value="aqorderdelivery.deliverydate" /></td>
			</tr>
			<tr>
			<th>日期限制: </th>
				<td><label for="fromRO">從:</label> <input type="text"  size="10" id="fromRO" name="Filter" />
							<img src="<!-- TMPL_VAR Name="themelang" -->/includes/calendar/cal.gif" border="0" id="openCalendarFromRO" style="cursor: pointer;" />
								<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>
					<label for="toRO">到: </label><input type="text"  size="10" id="toRO" name="Filter" value="" />
						<img src="<!-- TMPL_VAR Name="themelang" -->/includes/calendar/cal.gif" id="openCalendarToRO" style="cursor: pointer;" border="0" />
							<script language="JavaScript" 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> 
				<th>群組依照: </th>
				<td><select name="ReceivedOnDisplay">
					<option value="">沒有選擇</option>
					<option value ="1">日</option>
					<option value ="2">月</option>
					<option value ="3">年</option>
					</select>
				</td>
			</tr></table>
			
			<table>
			<tr>
				<th>顯示書商:</th>
				<td><label for="Line3">列</label><input type="radio" name="Line" id="Line3" value="aqbooksellers.name" /> <label for="Column3">欄</label><input type="radio" name="Column" id="Column3" value="aqbooksellers.name" /></td>
			</tr>
			<tr><th><label for="Filter">書商限制:</label></th>
				<td><!-- TMPL_VAR NAME="CGIBookSeller" --></td>
			</tr>
			<tr>
				<th>顯示預算:</th>
				<td><label for="Line4">列</label><input type="radio" name="Line" id="Line4" value="aqorderbreakdown.bookfundid" /> <label for="Column4">欄</label><input type="radio" name="Column" id="Column4" value="aqorderbreakdown.bookfundid" /></td></tr>
			<tr>
				<th><label for="Filter">預算限制:</label> </th>
				<td><!-- TMPL_VAR NAME="CGIBudget" --></td>
			</tr>
			<!-- TMPL_IF Name="hassort1" -->
				<tr> 
					<th>排序 1:</th>
					<td><input type="radio" name="Line" value="aqorders.sort1" /></td>
					<td><input type="radio" name="Column" value="aqorders.sort1" /></td>
					<td><!-- TMPL_VAR NAME="CGISort1" --> </td>
				</tr>
			<!-- /TMPL_IF -->
			<!-- TMPL_IF Name="hassort2" -->
				<!-- TMPL_IF Name="HglghtSort2"--><tr> <!-- TMPL_ELSE --><tr><!--/TMPL_IF --> 
					<th>排序 2:</th>
					<td><input type="radio" name="Line" value="aqorders.sort2" /></td>
					<td><input type="radio" name="Column" value="aqorders.sort2" /></td>
					<td><!-- TMPL_VAR NAME="CGISort2" --> </td>
				</tr>
			<!-- /TMPL_IF -->
		</tbody>
	</table>
	<table>
		<tr>
			<th>Cell Value: </th><td><label for="Cellvalue1">Count items</label><input type="radio" name="Cellvalue" id="Cellvalue1" value="1" checked="checked" /> 
			<label for="Cellvalue2"> 總計</label><input type="radio" name="Cellvalue" id="Cellvalue2" value="2" /></td></tr>
	</table>
	<table>
	<caption>輸出選擇</caption>
	<tr><td colspan="2"><label for="screen">To the Screen</label> <input type="radio" checked name="output" value="screen" id="screen" /></td></tr>
	<tr><td colspan="2"><label for="file">To file a file</label><input type="radio" name="output" value="file" id="file"></td></tr>
<tr><td>&nbsp;</td><td>...名稱:   <input type="text" name="basename" value="Export"></td></td></tr>
<tr><td>&nbsp;</td><td>檔案格式: <!-- TMPL_VAR NAME="CGIextChoice" --></td></tr>
<tr><td>&nbsp;</td><td>刪除限制: <!-- TMPL_VAR NAME="CGIsepChoice" --></td></tr>
</table>
		</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" -->
