{include file="header.dwt"}
      <div id="AList" class="f_l">
		<script language="javascript" type="text/javascript">  
				$(function () {
					$("#selectAll").click(function () {  
						$("#AList :checkbox").attr("checked", true);  
					});  
		   
					$("#unSelect").click(function () {  
						$("#AList :checkbox").attr("checked", false);  
					});  
		   
					$("#reverse").click(function () {  
						$("#AList :checkbox").each(function () {  
							$(this).attr("checked", !$(this).attr("checked"));  
						});  
					});  
				});  
		</script>
		<script type="text/javascript">  
			function getCheckAdIds() {  
				var chk_value =[];    
				 $('input[name="cka"]:checked').each(function(){    
					chk_value.push($(this).val());    
		  });    
					document.getElementById("tbSN").value=chk_value;
					//alert(chk_value.length==0 ?'你还没有选择任何内容！':chk_value); 
			}  
		</script>
		  <TABLE width="100%" border="0" align="center"  cellSpacing="1">
		    <TR>
			<form name="Search" method="post" action="finance.php">
			<TD colspan="14" class="font_big">
			<div class="tit">Finace</div>
			<div class="select_date">
			  Search by:&nbsp;&nbsp;
						<select name="tbFactoryID" id="tbFactoryID">
                            <option value=''>Select Factory</option>
                           <!--{foreach from=$factory_list item=factory }-->
                            <option value='{$factory.tbCompanyID}'>{$factory.tbNickName}</option>
                           <!--{/foreach}-->
                          </select>
			  <select name="start_year" id="start_year">
				  <!--{if $start_year eq ''}-->
				  <option value="{date('Y')}">{date('Y')}</option>
				  <!--{else}-->
				  <option value="{$start_year}">{$start_year}</option>
				  <!--{/if}-->
				  {section name=loop loop="2031" start="2010"}
				  <option value="{$smarty.section.loop.index}">{$smarty.section.loop.index}</option>
				  {/section}
			  </select>
              -
              <select name="start_month" id="start_month">
                  <!--{if $start_month eq ''}-->
				  <option value="{date('n')}">{date('n')}</option>
				  <!--{else}-->
				  <option value="{$start_month}">{$start_month}</option>
				  <!--{/if}-->
                  {section name=loop loop="13" start="1"}
				  <option value="{$smarty.section.loop.index}">{$smarty.section.loop.index}</option>
				  {/section}
              </select>
              -
              <select name="start_day" id="start_day">
                  <!--{if $start_day eq ''}-->
				  <option value="1">1</option>
				  <!--{else}-->
				  <option value="{$start_day}">{$start_day}</option>
				  <!--{/if}-->
                  {section name=loop loop="32" start="1"}
				  <option value="{$smarty.section.loop.index}">{$smarty.section.loop.index}</option>
				  {/section}
              </select>
              ~
              <select name="end_year" id="end_year">
                  <!--{if $end_year eq ''}-->
				  <option value="{date('Y')}">{date('Y')}</option>
				  <!--{else}-->
				  <option value="{$end_year}">{$end_year}</option>
				  <!--{/if}-->
				  {section name=loop loop="2030" start="2010"}
				  <option value="{$smarty.section.loop.index}">{$smarty.section.loop.index}</option>
				  {/section}
              </select>
              -
              <select name="end_month" id="end_emonth">
				  <!--{if $end_month eq ''}-->
				  <option value="{date('n')}">{date('n')}</option>
				  <!--{else}-->
				  <option value="{$end_month}">{$end_month}</option>
				  <!--{/if}-->
                  {section name=loop loop="13" start="1"}
				  <option value="{$smarty.section.loop.index}">{$smarty.section.loop.index}</option>
				  {/section}
              </select>
              -
              <select name="end_day" id="end_day">
				  <!--{if $end_day eq ''}-->
				  <option value="31">31</option>
				  <!--{else}-->
				  <option value="{$end_day}">{$end_day}</option>
				  <!--{/if}-->
                  {section name=loop loop="32" start="1"}
				  <option value="{$smarty.section.loop.index}">{$smarty.section.loop.index}</option>
				  {/section}
              </select>　
              <input type="submit" name="Submit" value="GO"> 
			  </div>			</TD>
			</form>
			</TR>
			<TR align="middle" class="tb_title">
	     		  <TD align="center" width="2%">SN</TD>
				  <TD align="center" width="4%">Check</TD>
				  <TD align="center" width="14%">Inspection Date</TD>
				  <TD align="center" width="8%">Client</TD>
				  <TD align="center" width="10%">Factory</TD>
				  <TD align="center" width="10%">CY PO NO. </TD>
				  <TD align="center" width="20%">Inspectors</TD>
				  <TD align="center" width="5%">Labor</TD>
				  <TD align="center" width="5%">Day Count</TD>
				  <TD align="center" width="5%">Day Charge </TD>
				  <TD align="center" width="5%">Charge From</TD>
				  <TD align="center" width="5%">&nbsp;&nbsp;Amount &nbsp;&nbsp;</TD>
				  <TD align="center" width="7%">Status</TD>
				  <TD align="center" width="5%">Detail</TD>
			</TR>
		  <!--{foreach name=loop from=$finance_list item=con}-->
			<TR align="middle" bgcolor="#ffffff" onMouseOver="this.style.backgroundColor='#FBF7CF'" onMouseOut="this.style.backgroundColor='#ffffff'">
					<TD class="line">{$smarty.foreach.loop.iteration}</TD>
					<TD class="line"><input name="cka" type="checkbox" value="{$con.tbSN}" /></TD>
					<TD class="line">{$con.tbInspectionDate}</TD>
					<TD class="line">{$con.client}</TD>
					<TD class="line">{$con.tbNickName}</TD>
					<TD class="line">{$con.tbPONumber}</TD>
					<TD class="line" align="left">
			<!--{if $con.tbTeam eq ''}-->
            {$con.tbPM}
			<!--{else}-->
			{$con.tbPM},{$con.tbTeam}			
			<!--{/if}-->
					</TD>            
					<TD class="line">
					{$con.tbLabor}
					</TD>
					<TD class="line">{$con.tbDayCount}</TD>
					<TD class="line">
					{$con.tbDayCharge} 
					</TD>
					<TD class="line">
					
					
	<!--{if $con.tbMemo eq ''}-->
			<!--{if $con.tbCheckone eq 'Final Pre-Shipment Inspection' || $con.tbCheckone eq 'B Stock Inspection' || $con.tbCheckone eq 'In-Process Inspection'}-->
				<font class="font_green">P</font>
			<!--{else}-->
					<!--{if $con.tbOverTime gt 0}-->
					    <font class="font_red">F+O</font>
					<!--{else}-->
						<font class="font_red">F</font>
					<!--{/if}-->
					<!--{if $con.tbMemo eq 'Concessible Charge'}-->
					    <font class="font_green">C</font>
					<!--{/if}-->
			<!--{/if}-->
	<!--{/if}-->			
					
					</TD>
					<TD class="line">{$con.tbTotalPrice}</TD>
					<TD class="line">{$con.tbStatus}
					</TD>
					<TD class="line"><a href="finance.php?act=detail&id={$con.tbSN}"><img src="pics/go.jpg" width="20" height="20" /></a></TD>
				  </TR>
			<!-- {/foreach} -->
			<TR align="middle">
				  <TD colspan="6" height="40" align="left"><a href="#" id="selectAll"  class="font_blue">Select All</a> | <a href="#" id="reverse" class="font_blue">Reverse Select</a> | <a href="#" id="unSelect" class="font_blue">No Select</a> | <a href="javascript:" onClick="getCheckAdIds(); bgDiv.style.display=''; chkBox.style.display='';" class="font_blue">Check Out</a></TD>
				  <TD></TD>
				  <TD></TD>
				  <TD></TD>
				  <TD></TD>
				  <TD></TD>
				  <TD align="left">
<!--{foreach from=$finance_total item=total}-->
	<!--{if $total.tbCurrent eq 'USD'}-->
<font class="font_green">$:</font>{$total.money}
	<!--{elseif $total.tbCurrent eq 'RMB'}-->
<font class="font_green">¥:</font>{$total.money}
	<!--{/if}-->
<!-- {/foreach} -->
				  </TD>
				  <TD></TD>
			</TR>
          </TABLE>
		  <div id="bgDiv" style="display:none;"></div>
		  <div id="chkBox" style="position:absolute; left:367px; top:150px; z-index:1;display: none;" >
          <div class="title" id="Mdown">
			<span class="t1">Check This Batch</span>
			<span class="t2" title="Close" onClick="ck_dialog.style.display='none';bgDiv.style.display='none'">X</span>
		  </div>
          <div class="ck_dialog">
               	<form method="post" action="finance.php?act=check">
                    <table>
                        <tr>
                            <td align="left">Day Count:</td><td align="left"><input type="text" name="tbDayCount" size="12" value="1" maxlength="10"></td>
                        </tr>
                        <tr>
                            <td align="left">Day Charge:</td><td align="left"><input type="text" name="tbDayCharge" size="12" value="200" maxlength="10"> <input type="text" name="tbCurrent" size="8" value="USD" maxlength="8"></td>
                        </tr>
						<tr>
                            <td></td><td><input type="hidden" name="tbSN" id="tbSN" size="50" value=""></td>
                        </tr>
                        <tr>
                            <td></td><td><button class="submit" type="submit">Check</button></td>
                        </tr>
                    </table>
                </form>
            </div>
          </div>
<script type="text/javascript">
            //这一段的位置如果放置到head部会倒致点击弹出窗口的X按钮不起做用
			var IsMousedown, LEFT, TOP, ck_dialog;
			document.getElementById("Mdown").onmousedown=function(e) {
				ck_dialog = document.getElementById("chkBox");
				IsMousedown = true;
				e = e||event;
				LEFT = e.clientX - parseInt(ck_dialog.style.left);
				TOP = e.clientY - parseInt(ck_dialog.style.top);
				document.onmousemove = function(e) {
					e = e||event;
					if (IsMousedown) {
						ck_dialog.style.left = e.clientX - LEFT + "px";
						ck_dialog.style.top = e.clientY - TOP + "px";
					}
				}
				document.onmouseup=function(){
					IsMousedown=false;
				}
			}
</script>
		  <table width="100%" border="0" cellspacing="0" cellpadding="0">
		  <tr height="80">
		    <td width="12">&nbsp;  </td>
			<td width="700" class="font_big"><strong>&nbsp;<font class="font_green">P:</font>&nbsp;Charge From Pure Digital  &nbsp;&nbsp;<font color="red">F:</font>&nbsp;Charge From Factory &nbsp;&nbsp;<font color="red">F+O:</font>&nbsp;Charge From Factory(OverTimeWork)&nbsp;&nbsp;<font class="font_blue">P:</font>&nbsp;B Stock Charge &nbsp;&nbsp;<font color="#FF00FF">C:</font>&nbsp;Concessible Charge</strong></td>
			<td width="200">&nbsp;</td>
			<td width="64" align="right">&nbsp;</td>
		  </tr>
		  </table>
        
      </div>
      {include file="footer.dwt"}
</div>
</body>
</html>
