{include file="header.dwt"}
      <div id="list" class="f_l">

		  <TABLE width="100%" border="0" align="center"  cellSpacing="1">
		    <TR><TD colspan="11" class="font_big">
			{include file="in_statistics.dwt"}</TD>
			</TR>
			<TR align="middle" class="tb_title">
			  <TD>Factory Name</TD>
			  <TD>Reports Count</TD>
			  <TD>Shipping Q'ty</TD>
			  <TD>Accepted</TD>
			  <TD>Rejected</TD>
			  <TD>Concessed</TD>
			  <TD>Qualified Percentage</TD>
			  <TD>Detail</TD>
			</TR>
		 
		  <!-- {foreach from=$list_qp item=con} -->
            <TR align="middle" height="30" bgcolor="#ffffff" onMouseOver="this.style.backgroundColor='#E1FFDF'" onMouseOut="this.style.backgroundColor='#ffffff'">
              <TD><div align="center"><B><!-- {if $con.tbNickName} -->{$con.tbNickName}<!-- {else} -->N/A<!-- {/if} --></B></div></TD>
              <TD><div align="center"><!-- {if $con.all_reports} -->{$con.all_reports}<!-- {else} -->0<!-- {/if} --></div></TD>
              <TD><div align="center"><!-- {if $con.lot_qty} -->{$con.lot_qty}<!-- {else} -->0<!-- {/if} --></div></TD>
              <TD>
			  <div align="center" class="font_green">
			  <!-- {if $ac_re_sc[$con.tbFactoryID][0]['result'] eq 'ac'} -->
				  <!-- {if $ac_re_sc[$con.tbFactoryID][0]['a_count']} -->
				  {$ac_re_sc[$con.tbFactoryID][0]['a_count']}
				  <!--{/if}-->
			  <!--{else}-->
			  0
			  <!--{/if}-->
			  </div>
			  </TD>
              <TD>
			  <div align="center" class="font_red">
			  <!-- {if $ac_re_sc[$con.tbFactoryID][0]['result'] eq 're'} -->
				  <!-- {if $ac_re_sc[$con.tbFactoryID][0]['a_count']} -->
				  {$ac_re_sc[$con.tbFactoryID][0]['a_count']}
				  <!--{/if}-->
			  <!--{elseif $ac_re_sc[$con.tbFactoryID][1]['result'] eq 're'}-->
			      <!-- {if $ac_re_sc[$con.tbFactoryID][1]['a_count']} -->
				  {$ac_re_sc[$con.tbFactoryID][1]['a_count']}
				  <!--{/if}-->
			  <!--{else}-->
			  0
			  <!--{/if}-->
			  </div>
			  </TD>
              <TD>
			  <div align="center" class="font_red">
			   <!-- {if $ac_re_sc[$con.tbFactoryID][0]['result'] eq 'sc'} -->
				  <!-- {if $ac_re_sc[$con.tbFactoryID][0]['a_count']} -->
				  {$ac_re_sc[$con.tbFactoryID][0]['a_count']}
				  <!--{/if}-->
			  <!-- {elseif $ac_re_sc[$con.tbFactoryID][1]['result'] eq 'sc'} -->
			      <!-- {if $ac_re_sc[$con.tbFactoryID][1]['a_count']} -->
				  {$ac_re_sc[$con.tbFactoryID][1]['a_count']}
				  <!--{/if}-->
			  <!-- {elseif $ac_re_sc[$con.tbFactoryID][2]['result'] eq 'sc'} -->
			      <!-- {if $ac_re_sc[$con.tbFactoryID][2]['a_count']} -->
				  {$ac_re_sc[$con.tbFactoryID][2]['a_count']}
				  <!--{/if}-->
			  <!--{else}-->
			  0
			  <!--{/if}-->
			  </div>
			  </TD>
              <TD>
			  <div align="center">
			  
			  <div class="sta_back">
			   <!-- {if $ac_re_sc[$con.tbFactoryID][0]['result'] eq 'ac'} -->
				  <!--{if $ac_re_sc[$con.tbFactoryID][0]['a_count'] && $con.all_reports}--><img src="pics/bar.gif" align="left" width="{number_format($ac_re_sc[$con.tbFactoryID][0]['a_count']/$con.all_reports*100,0)}" height="11" />
				  <!--{/if}-->
			  <!--{else}--><img src="pics/bar.gif" align="left" width="0" height="11" /><!--{/if}--></div>
			  <div class="sta_txt">
			  <!-- {if $ac_re_sc[$con.tbFactoryID][0]['result'] eq 'ac'} -->
				  <!--{if $ac_re_sc[$con.tbFactoryID][0]['a_count'] && $con.all_reports}-->{number_format($ac_re_sc[$con.tbFactoryID][0]['a_count']/$con.all_reports*100,2)}%
				  <!--{/if}-->
			  <!--{else}-->0.00%<!--{/if}-->
			  </div>
			  
			  </div>
			  </TD>
			  <TD><div align="center"></div></TD>
			</TR>
			<TR align="middle" height="30" bgcolor="#ffffff" onMouseOver="this.style.backgroundColor='#E1FFDF'" onMouseOut="this.style.backgroundColor='#ffffff'">
			  <TD><div align="center"><font color="#0033CC">First-Inspection</font></div></TD>
			  <TD><div align="center"><!--{if $first_list[$con.tbFactoryID][0]['all_reports']}-->{$first_list[$con.tbFactoryID][0]['all_reports']}<!--{else}-->0<!--{/if}--></div></TD>
			  <TD><div align="center"><!--{if $first_list[$con.tbFactoryID][0]['lot_qty']}-->{$first_list[$con.tbFactoryID][0]['lot_qty']}<!--{else}-->0<!--{/if}--></div></TD>
			  <TD><div align="center" class="font_green">
			  <!-- {if $first_arc[$con.tbFactoryID][0]['result'] eq 'ac'} -->
				  <!-- {if $first_arc[$con.tbFactoryID][0]['a_count']} -->
				  {$first_arc[$con.tbFactoryID][0]['a_count']}
				  <!-- {/if}-->
			  <!-- {else} -->
			  0
			  <!-- {/if}-->
			  </div></TD>
			  <TD><div align="center" class="font_red">
			  <!-- {if $first_arc[$con.tbFactoryID][0]['result'] eq 're'} -->
				  <!-- {if $first_arc[$con.tbFactoryID][0]['a_count']} -->
				  {$first_arc[$con.tbFactoryID][0]['a_count']}
				  <!-- {/if}-->
			  <!-- {elseif $first_arc[$con.tbFactoryID][1]['result'] eq 're'} -->
			      <!-- {if $first_arc[$con.tbFactoryID][1]['a_count']} -->
				  {$first_arc[$con.tbFactoryID][1]['a_count']}
				  <!-- {/if}-->
			  <!-- {else} -->
			  0
			  <!-- {/if}-->
			  </div></TD>
			  <TD><div align="center" class="font_red">
			  <!-- {if $first_arc[$con.tbFactoryID][0]['result'] eq 'sc'} -->
				  <!-- {if $first_arc[$con.tbFactoryID][0]['a_count']} -->
				  {$first_arc[$con.tbFactoryID][0]['a_count']}
				  <!-- {/if}-->
			  <!-- {elseif $first_arc[$con.tbFactoryID][1]['result'] eq 'sc'} -->
			      <!-- {if $first_arc[$con.tbFactoryID][1]['a_count']} -->
				  {$first_arc[$con.tbFactoryID][1]['a_count']}
				  <!-- {/if}-->
			  <!-- {elseif $first_arc[$con.tbFactoryID][2]['result'] eq 'sc'} -->
			      <!-- {if $first_arc[$con.tbFactoryID][2]['a_count']} -->
				  {$first_arc[$con.tbFactoryID][2]['a_count']}
				  <!-- {/if}-->
			  <!-- {else} -->
			  0
			  <!-- {/if}-->
			  </div></TD>
			  <TD><div align="center">
			  
			   <div class="sta_back">
			   <!-- {if $ac_re_sc[$con.tbFactoryID][0]['result'] eq 'ac'} -->
			   		<!-- {if $first_arc[$con.tbFactoryID][0]['result'] eq 'ac'} -->
				   			<!--{if $first_arc[$con.tbFactoryID][0]['a_count'] && $first_list[$con.tbFactoryID][0]['all_reports']}--><img src="pics/bar.gif" align="left" width="{number_format($first_arc[$con.tbFactoryID][0]['a_count']/$first_list[$con.tbFactoryID][0]['all_reports']*100,0)}" height="11" />
				   			<!--{/if}-->
				   <!--{else}-->
				   <img src="pics/bar.gif" align="left" width="0" height="11" />
				   <!--{/if}-->
			   <!--{else}-->
			   <img src="pics/bar.gif" align="left" width="0" height="11" />		  
			   <!--{/if}-->
			   </div>
			  <div class="sta_txt">
			   <!-- {if $ac_re_sc[$con.tbFactoryID][0]['result'] eq 'ac'} -->
			   		<!-- {if $first_arc[$con.tbFactoryID][0]['result'] eq 'ac'} -->
				  			<!--{if $first_arc[$con.tbFactoryID][0]['a_count'] && $first_list[$con.tbFactoryID][0]['all_reports']}-->{number_format($first_arc[$con.tbFactoryID][0]['a_count']/$first_list[$con.tbFactoryID][0]['all_reports']*100,2)}%
				  			<!--{/if}-->
					<!--{else}-->
					0.00%
					<!--{/if}-->
			  <!--{else}-->
			  0.00%
			  <!--{/if}--></div>
			  
			  </div></TD>
			  <TD><div align="center"><a href="statistics.php?act=QD&client={$pre}&active=4&tbFactoryID={$con.tbFactoryID}&start={$start}&end={$end}&pro_select={$pro_select}"><img src="pics/go.jpg" width="20" height="20" /></a></div></TD>
			</TR>
			<TR align="middle" height="30" bgcolor="#ffffff" onMouseOver="this.style.backgroundColor='#E1FFDF'" onMouseOut="this.style.backgroundColor='#ffffff'">
			  <TD class="line"><div align="center"><font color="#FF0000">Re-Inspection</font></div></TD>
			  <TD class="line"><div align="center"><!--{if $re_list[$con.tbFactoryID][0]['all_reports']}-->{$re_list[$con.tbFactoryID][0]['all_reports']}<!--{else}-->0<!--{/if}--></div></TD>
			  <TD class="line"><div align="center"><!--{if $re_list[$con.tbFactoryID][0]['lot_qty']}-->{$re_list[$con.tbFactoryID][0]['lot_qty']}<!--{else}-->0<!--{/if}--></div></TD>
			  <TD class="line"><div align="center" class="font_green">
			  <!-- {if $re_arc[$con.tbFactoryID][0]['result'] eq 'ac'} -->
				  <!-- {if $re_arc[$con.tbFactoryID][0]['a_count']} -->
				  {$re_arc[$con.tbFactoryID][0]['a_count']}
				  <!-- {/if}-->
			  <!-- {else} -->
			  0
			  <!-- {/if}-->
			  </div></TD>
			  <TD class="line"><div align="center" class="font_red">
			  <!-- {if $re_arc[$con.tbFactoryID][0]['result'] eq 're'} -->
				  <!-- {if $re_arc[$con.tbFactoryID][0]['a_count']} -->
				  {$re_arc[$con.tbFactoryID][0]['a_count']}
				  <!-- {/if}-->
			  <!-- {elseif $re_arc[$con.tbFactoryID][1]['result'] eq 're'} -->
			      <!-- {if $re_arc[$con.tbFactoryID][1]['a_count']} -->
				  {$re_arc[$con.tbFactoryID][1]['a_count']}
				  <!-- {/if}-->
			  <!-- {else} -->
			  0
			  <!-- {/if}-->
			  </div></TD>
			  <TD class="line"><div align="center" class="font_red">
			  <!-- {if $re_arc[$con.tbFactoryID][0]['result'] eq 'sc'} -->
				  <!-- {if $re_arc[$con.tbFactoryID][0]['a_count']} -->
				  {$re_arc[$con.tbFactoryID][0]['a_count']}
				  <!-- {/if}-->
			  <!-- {elseif $re_arc[$con.tbFactoryID][1]['result'] eq 'sc'} -->
			      <!-- {if $re_arc[$con.tbFactoryID][1]['a_count']} -->
				  {$re_arc[$con.tbFactoryID][1]['a_count']}
				  <!-- {/if}-->
			  <!-- {elseif $re_arc[$con.tbFactoryID][2]['result'] eq 'sc'} -->
			      <!-- {if $re_arc[$con.tbFactoryID][2]['a_count']} -->
				  {$re_arc[$con.tbFactoryID][2]['a_count']}
				  <!-- {/if}-->
			  <!-- {else} -->
			  0
			  <!-- {/if}-->
			  </div></TD>
			  <TD class="line"><div align="center">
			  
			   <div class="sta_back"><!--{if $re_arc[$con.tbFactoryID][0]['a_count'] && $re_list[$con.tbFactoryID][0]['all_reports']}--><img src="pics/bar.gif" align="left" width="{number_format($re_arc[$con.tbFactoryID][0]['a_count']/$re_list[$con.tbFactoryID][0]['all_reports']*100,0)}" height="11" /><!--{else}--><img src="pics/bar.gif" align="left" width="0" height="11" /><!--{/if}--></div>
			  <div class="sta_txt"><!--{if $re_arc[$con.tbFactoryID][0]['a_count'] && $re_list[$con.tbFactoryID][0]['all_reports']}-->{number_format($re_arc[$con.tbFactoryID][0]['a_count']/$re_list[$con.tbFactoryID][0]['all_reports']*100,2)}%<!--{else}-->N/A<!--{/if}--></div>
			  
			  </div></TD>
			  <TD class="line"><div align="center"></div></TD>
			</TR>
          <!-- {/foreach} -->
		    <TR align="middle">
			  <TD><font color="#0033CC">First-Inspection Total Qty:</font></TD>
			  <TD> </TD>
			  <TD>  {$ship_qty} </TD>
			  <TD> </TD>
			  <TD> </TD>
			  <TD> </TD>
			  <TD> </TD>
			  <TD> </TD>
			</TR>
     	  </TABLE>
		  
		  <table width="100%" border="0" cellspacing="0" cellpadding="0">
		  <tr height="50">
		    <td width="12">&nbsp;  </td>
			<td width="700" class="font_big"><font class="font_green">Green:</font> Passed &nbsp; <font class="font_red">Red:</font> Rejected Or 0&nbsp; <font class="font_blue">N/A:</font> None</td>
			<td width="200">&nbsp;</td>
			<td width="64" align="right">&nbsp;</td>
		  </tr>
		  </table>
        
      </div>
      {include file="footer.dwt"}
</div>
</body>
</html>
