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

		  <TABLE width="100%" align="center"  cellSpacing="0">
		    <TR>
			<form name="Search" method="post" action="schedule.php?client={$pre}&active=7">
			<TD colspan="14" class="font_big">
			<div class="tit">Schedule</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>
		  </TABLE>
		  <TABLE width="100%" align="center"  cellSpacing="0" style="border-left: solid 1px #3E558E; border-top: solid 1px #3E558E;">

			<TR align="middle" class="tb_title">
	     		  <TD width="2%">SN</TD>
				  <TD width="8%">Inspection Date</TD>
				  <TD width="6%">Factory</TD>
				  <TD width="25%">Part NO. </TD>
				  <TD width="13%">Product Name</TD>
				  <TD width="7%">PO number</TD>
				  <TD width="4%">Qty</TD>
				  <TD width="5%">Sample</TD>
				  <TD width="22%">Inspectors</TD>
				  <TD width="8%">Remark</TD>
			</TR>
		  <!--{foreach name=loop from=$list item=con}-->
			<TR align="middle" bgcolor="#ffffff" onMouseOver="this.style.backgroundColor='#FBF7CF'" onMouseOut="this.style.backgroundColor='#ffffff'" class="tr">
					<TD>{$smarty.foreach.loop.iteration}</TD>
					<TD>{$con.tbInspectionDate}</TD>
					<TD>{$con.tbNickName}</TD>
			  <TD colspan="5">
			  <table style="width:100%;height:100%" border="0" cellpadding="0" cellspacing="0">
                <!--{foreach name=loo from=$con[0] item=rep}-->
                <!--{if substr_count($rep.tbModelNO,'&')}-->
                <!--{section name=loop loop=substr_count($rep.tbModelNO,'&')+1 start='0'}-->
                  <!--{if $smarty.foreach.loo.index+1 eq  $smarty.foreach.loo.total && $smarty.section.loop.index+1 eq $smarty.section.loop.total}-->
                <tr align="middle" onmouseover="this.style.backgroundColor='#E1FFDF'" onmouseout="this.style.backgroundColor='#ffffff'" class="trr">
                  <!--{else}-->
                <tr align="middle" onmouseover="this.style.backgroundColor='#E1FFDF'" onmouseout="this.style.backgroundColor='#ffffff'" class="tr">
                  <!--{/if}-->
                  <td width="44%">
				    <!--{if $models=explode('&',$rep.tbModelNO)}-->
                      <!--{if $models[$smarty.section.loop.index] neq ''}-->
                    {$models[$smarty.section.loop.index]}
                      <!--{else}-->
                      <!--{/if}-->
                    <!--{else}-->
                    {$rep.tbModelNO|@trim}
                    <!--{/if}--></td>
                  <td width="23%">{$rep.tbProductName|@trim}</td>
                  <td width="15%"><!--{if $ClientPO = explode('&',$rep.tbClientPONo)}-->
                      <!--{if $ClientPO[$smarty.section.loop.index] neq ''}-->
                    {$ClientPO[$smarty.section.loop.index]}
                    <!--{else}-->
                    <!--{/if}-->
                    <!--{else}-->
                    {$rep.tbClientPONo|@trim}
                    <!--{/if}--></td>
                  <td width="7%">
				    <!--{if $ShipQty = explode('&',$rep.tbShippingQty)}-->
                      <!--{if $ShipQty[$smarty.section.loop.index] neq ''}-->
                    {$ShipQty[$smarty.section.loop.index]}
                      <!--{else}-->
                      <!--{/if}-->
                    <!--{else}-->
                    {$rep.tbShippingQty|@trim}
                    <!--{/if}--></td>
				  <!--{if $smarty.section.loop.index eq 0}-->					
                  <td width="11%" rowspan="{$smarty.section.loop.total}" valign="middle" style="border-right:none; border-bottom:none;">&nbsp; {$rep.tbSampleSize|@trim} &nbsp; </td>
				  <!--{else}-->
                  <!--{/if}-->
                </tr>
                <!--{/section}-->
                <!--{else}-->
                  <!--{if $smarty.foreach.loo.index+1 eq  $smarty.foreach.loo.total}-->
                <tr align="middle" onmouseover="this.style.backgroundColor='#E1FFDF'" onmouseout="this.style.backgroundColor='#ffffff'" class="trr">
                  <!--{else}-->
                <tr align="middle" onmouseover="this.style.backgroundColor='#E1FFDF'" onmouseout="this.style.backgroundColor='#ffffff'" class="tr">
                  <!--{/if}-->
                  <td width="44%" height="100%">{$rep.tbModelNO|@trim}</td>
                  <td width="23%">{$rep.tbProductName|@trim}</td>
                  <td width="15%">{$rep.tbClientPONo|@trim}</td>
                  <td width="7%" >{$rep.tbShippingQty|@trim}</td>
                  <td width="11%" style="border-right:none;">{$rep.tbSampleSize|@trim}</td>
                </tr>
                <!--{/if}-->
                <!-- {/foreach} -->
              </table></TD>
					<TD align="left">
			<!--{if $con.tbTeam eq ''}-->
            {$con.tbPM}
			<!--{else}-->
			{$con.tbPM},{$con.tbTeam}			
			<!--{/if}-->					</TD>
					<TD>
					<!--{if $con.tbCheckone eq 'Final Pre-Shipment Inspection' || $con.tbCheckone eq 'B Stock Inspection' || $con.tbCheckone eq 'In-Process Inspection'}-->
				
					<!--{else}-->
					<font class="f_red">{$con.tbCheckone}</font>
					<!--{/if}-->					</TD>
		    </TR>
			<!-- {/foreach} -->
          </TABLE>
		  
		  <table width="100%" border="0" cellspacing="0" cellpadding="0">
		  <tr height="80">
		    <td width="12">&nbsp;  </td>
			<td width="700" class="font_big"><font class="font_green">F:</font> Final Pre-Shipment Inspection &nbsp;<font class="font_green">I:</font> In-Process Inspection &nbsp; <font class="font_red">R1:</font> 1st Re-Inspection &nbsp; <font class="font_red">R2:</font> 2nd Re-Inspection &nbsp;<font class="font_red">R3:</font> 3rd Re-Inspection &nbsp;<font class="font_red">R4:</font> 4th Re-Inspection &nbsp;<font class="font_green">B:</font> B Stock Inspection &nbsp;<font class="font_red">B1:</font> B Stock 1st Re-Inspection &nbsp;<font class="font_red">B2:</font> B Stock 2nd Re-Inspection &nbsp;<font class="font_red">B3:</font> B Stock 3rd Re-Inspection &nbsp;
　          </td>
			<td width="200">&nbsp;</td>
			<td width="64" align="right">&nbsp;</td>
		  </tr>
		  </table>
      </div>
      {include file="footer.dwt"}
</div>
</body>
</html>