{include file="header.dwt"}
	<script language="javascript" type="text/javascript">
	function check_item()
	{
	  if(project_create.tbClientID.value==""){
		 alert("Client must be selected!");
		 project_create.tbClientID.focus();
	  }else if(project_create.tbFactoryID.value==""){
		 alert("Factory must be selected!");
		 project_create.tbFactoryID.focus();
	  }else if(project_create.tbFactoryBookNO.value==""){
		 alert("Factory Booking Number must be filled!");
		 project_create.tbFactoryBookNO.focus();
	  }else if(project_create.Leader.value==""){
		 alert("Leader must be selected!");
		 project_create.Leader.focus();
	  }else if(project_create.tbPONumber.value==""){
		 alert("Please Save Products List Below Before Submit This Form!");
		 project_create.tbModelNO.focus();
	  }else if(project_create.tbProductName.disabled==false){
		 alert("Please Save Products Item First When Filled Products!");
	  }else{
		 return true;
	  }	 
	  return false;
	}
	</script>
	<script language="javascript" type="text/javascript" src="ajax/ajax_project.js"></script>
	  <form action="project_create.php?act=ready" method="post" name="project_create" onsubmit="return check_item();">
      <div id="list" class="f_l">
      
      <h2 style="text-align:center; margin-top:30px;">INSPECTION BOOKING CREATE FORM </h2>
     
<table width="100%" border="1" align="center" cellPadding="1" cellSpacing="1" bordercolor="#5272A9">
  <tr class="tb_title">
  <td>
        Please carefully follow these instructions in requesting all Chunyin inspection services
  </td>
  </tr>
  <tr>
  <td>       
	    <div class="marg" style="margin:10px 10px 14px 24px;">       
			   <p align="center"><b>( Please carefully the under instructions )</b></p>
               <p align="left"> ( 1 ) Must Fill booking form and email to related inspector of Chun Yin office before 5 workdays.<br>
	           </p>
			   <p align="left"> ( 2 ) The booking should include relevant contents such as Inspection Date,Products Name,Model NO,PO Number,Qty,Serial NO etc.		   </p>
               <p align="left"> ( 3 ) The inspection will be performed only when all products listed on this form have been 100% finished on the production line, and 80% fully packed into marked and sealed shipping cartons. A mis-inspection will occur if our company inspectors arrive at the inspection site and these requirements have not been fully arranged.
		       </p>
		</div>
	</td>
    </tr>
	<tr class="tb_title">
  <td>
        Client / Supplier Information
	</td>
    </tr>
	<tr>
	<td>  			  
			  <div class="marg">
                <table width="100%"  border="0" align="center">
                  <TR align="middle">
                    <TD width="27%" align="right"> Buyer ： </TD>
                    <TD width="21%" align="left"> 
					     <select name="tbClientID" id="tbClientID" onChange="chg_prefix()">
                            <option value=''>====Select Client====</option>
							<!--{if $pre eq 'pu_'}-->
							<option value='2' selected="selected" title="pu_">PURE</option>
							<!--{elseif $pre eq 'yo_'}-->
							<option value='30' selected="selected" title="yo_">Yotoplay</option>
							<!--{elseif $pre eq 'tt_'}-->
							<option value='37' selected="selected" title="tt_">TT micro</option>
							<!--{elseif $pre eq 'ft_'}-->
							<option value='45' selected="selected" title="ft_">Frontier</option>
							<!--{elseif $pre eq 'vc_'}-->
							<option value='46' selected="selected" title="vc_">Velocity</option>
							<!--{/if}-->
                           <!--{foreach from=$client_list item=client }-->
                            <option value='{$client.tbCompanyID}' title='{$client.tbPrefix}'>{$client.tbNickName}</option>
                           <!--{/foreach}-->
                          </select>
						  <input name="client" id="client" type="hidden" value="{$pre}">
					</TD>
                    <TD width="25%" align="right">Manufactory ：</TD>
                    <TD width="27%" align="left">
					      <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>
				    </TD>
                  </TR>
                  <TR align="middle">
                    <TD align="right">Products Finish Date ：</TD>
                    <TD align="left">
				<input name="tbFinishDate" type="text" id="tbFinishDate" value="{($smarty.now-60*60*24)|date_format:'%Y-%m-%d'}">			  
					</TD>
                    <TD align="right" class="f_red">Inspection Date ：</TD>
                    <TD align="left">
						  <select name="inspect_year" id="inspect_year">
							  <option value="{date('Y')}" selected="selected">{date('Y')}</option>
							  {section name=loop loop="2031" start="2010"}
							  <option value="{$smarty.section.loop.index}">{$smarty.section.loop.index}</option>
							  {/section}
						  </select>
						  -
						  <select name="inspect_month" id="inspect_month">
							  <option value="{date('m')}" selected="selected">{date('m')}</option>
							  {section name=loop loop="13" start="1"}
							  <option value='{$smarty.section.loop.index|string_format:"%02d"}'>{$smarty.section.loop.index|string_format:"%02d"}</option>
							  {/section}
						  </select>
						  -
						  <select name="inspect_day" id="inspect_day">
							  <option value="{date('d')}" selected="selected">{date('d')}</option>
							  {section name=loop loop="32" start="1"}
							  <option value='{$smarty.section.loop.index|string_format:"%02d"}'>{$smarty.section.loop.index|string_format:"%02d"}</option>
							  {/section}
						  </select>
					</TD>
                  </TR>
                  <TR align="middle">
                    <TD align="right">Shipping Date ：</TD>
                    <TD align="left">
					<input name="tbShippingDate" type="text" id="tbShippingDate" value="{($smarty.now+60*60*48)|date_format:'%Y-%m-%d'}">	
					</TD>
                    <TD align="right">Inspection Time ：</TD>
                    <TD align="left">
						  <select name="inspect_h" id="inspect_h">
							  <option value="9" selected="selected">9</option>
							  {section name=loop loop="25" start="1"}
							  <option value="{$smarty.section.loop.index}">{$smarty.section.loop.index}</option>
							  {/section}
						  </select>
						  :
						  <select name="inspect_m" id="inspect_m">
							  <option value="00" selected="selected">00</option>
							  {section name=loop loop="61" start="10" step="10"}
							  <option value="{$smarty.section.loop.index}">{$smarty.section.loop.index}</option>
							  {/section}
						  </select>
					</TD>
                  </TR>
                </table>
			  </div>	
     </td>
     </tr>
	 <tr class="tb_title">
  	 <td>
        Service Performed
	 </td>
     </tr>
     <td>
                      <div class="marg">			  
						<table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
						  <tr>
							<td width="11%" rowspan="4"align="center">Select One</td>
							<td width="33%"><div align="left">
								<!--{if $pro_summary['tbCheckone'] eq 'Final Pre-Shipment Inspection'}-->
								  <input name="checkone" type="radio" value="Final Pre-Shipment Inspection" checked>
								<font color="#FF0000">Final Pre-Shipment Inspection</font>
								<!--{else}-->
								  <input name="checkone" type="radio" value="Final Pre-Shipment Inspection" checked>
								Final Pre-Shipment Inspection 
								<!--{/if}-->
				            </div></td>
							<td width="29%"><div align="left">
								<!--{if $pro_summary['tbCheckone'] eq 'In-Process Inspection'}-->
								  <input name="checkone" type="radio" value="In-Process Inspection" checked>
								<font color="#FF0000">In-Process Inspection</font>
								<!--{else}-->
								  <input name="checkone" type="radio" value="In-Process Inspection">
								In-Process Inspection 
								<!--{/if}-->
				            </div></td>
							<td width="27%"><div align="left">
								<!--{if $pro_summary['tbCheckone'] eq '1st Re-Inspection'}-->
								  <input name="checkone" type="radio" value="1st Re-Inspection" checked>
								  <font color="#FF0000">1st Re-Inspection</font>
								<!--{else}-->
								  <input name="checkone" type="radio" value="1st Re-Inspection">
								  1st Re-Inspection
								<!--{/if}-->
				            </div></td>
						  </tr>
						  <tr>
							<td><div align="left">
								<!--{if $pro_summary['tbCheckone'] eq '2nd Re-Inspection'}-->
								  <input name="checkone" type="radio" value="2nd Re-Inspection" checked>
								  <font color="#FF0000">2nd Re-Inspection</font>
								<!--{else}-->
								  <input name="checkone" type="radio" value="2nd Re-Inspection">
								 2nd Re-Inspection
								<!--{/if}-->
				            </div></td>
							<td><div align="left">
								<!--{if $pro_summary['tbCheckone'] eq '3rd Re-Inspection'}-->
								  <input name="checkone" type="radio" value="3rd Re-Inspection" checked>
								  <font color="#FF0000">3rd Re-Inspection</font>
								<!--{else}-->
								  <input name="checkone" type="radio" value="3rd Re-Inspection">
								  3rd Re-Inspection
								<!--{/if}-->
                            </div></td>
							<td><div align="left">
								<!--{if $pro_summary['tbCheckone'] eq '4th Re-Inspection'}-->
								  <input name="checkone" type="radio" value="4th Re-Inspection" checked>
								  <font color="#FF0000">4th Re-Inspection</font>
								<!--{else}-->
								  <input name="checkone" type="radio" value="4th Re-Inspection">
								  4th Re-Inspection
								<!--{/if}-->
				            </div></td>
						  </tr>
						  <tr>
						  <td align="left">
								<!--{if $pro_summary['tbCheckone'] eq 'B Stock Inspection'}-->
								<input name="checkone" type="radio" value="B Stock Inspection" checked>
								<font color="#FF0000">B Stock Inspection </font>
								<!--{else}-->
								<input name="checkone" type="radio" value="B Stock Inspection">
								B Stock Inspection
								<!--{/if}-->
		                  </td>
						  <td><div align="left">
								<!--{if $pro_summary['tbCheckone'] eq 'B Stock 1st Re-Inspection'}-->
								<input name="checkone" type="radio" value="B Stock 1st Re-Inspection" checked>
								<font color="#FF0000">B Stock 1st Re-Inspection</font>
								<!--{else}-->
								<input name="checkone" type="radio" value="B Stock 1st Re-Inspection">
								B Stock 1st Re-Inspection
								<!--{/if}-->
		                  </div></td>
						  <td><div align="left">
								<!--{if $pro_summary['tbCheckone'] eq 'B Stock 2nd Re-Inspection'}-->
								<input name="checkone" type="radio" value="B Stock 2nd Re-Inspection" checked>
								<font color="#FF0000">B Stock 2nd Re-Inspection</font>
								<!--{else}-->
								<input name="checkone" type="radio" value="B Stock 2nd Re-Inspection">
								B Stock 2nd Re-Inspection
								<!--{/if}-->
		                  </div></td>
						</tr>
						<tr>
						  <td align="left">
								<!--{if $pro_summary['tbCheckone'] eq 'B Stock 3rd Re-Inspection'}-->
								<input name="checkone" type="radio" value="B Stock 3rd Re-Inspection" checked>
								<font color="#FF0000">B Stock 3rd Re-Inspection</font>
								<!--{else}-->
								<input name="checkone" type="radio" value="B Stock 3rd Re-Inspection">
								B Stock 3rd Re-Inspection
								<!--{/if}-->
		                  </td>
						  <td>
						  		<!--{if $pro_summary['tbCheckone'] eq 'Full-Check Inspection'}-->
								<input name="checkone" type="radio" value="Full-Check Inspection" checked>
								<font color="#FF0000">Full-Check Inspection</font>
								<!--{else}-->
								<input name="checkone" type="radio" value="Full-Check Inspection">
								Full-Check Inspection
								<!--{/if}-->
</td>
						  <td>
						  		<!--{if $pro_summary['tbCheckone'] eq 'During Production Inspection'}-->
								<input name="checkone" type="radio" value="During Production Inspection" checked>
								<font color="#FF0000">During Production Inspection</font>
								<!--{else}-->
								<input name="checkone" type="radio" value="During Production Inspection">
								During Production Inspection
								<!--{/if}-->
						  <input name="tbPN" type="hidden" id="tbPN" value="" size="12">
						  <input name="tbPONumber" type="hidden" id="tbPONumber" value="" size="12"></td>
						</tr>
						</table>
					</div>	
    </td>
    </tr>
	<tr class="tb_title">
  <td>
        Inspection Company Information
	</td>
    </tr>
    <tr>
    <td><div class="marg">
                <table width="100%"  border="0" align="center">
                  <TR align="middle">
                    <TD align="right">Factory No.：</TD>
                    <TD align="left"><input name="tbFactoryBookNO" type="text" id="tbFactoryBookNO"></TD>
                    <TD width="25%" align="right">Inspection Leader：</TD>
                    <TD width="25%" align="left">
					  <select name="Leader" id="Leader">
					    <option value=''>== Please select ==</option>
                        <!--{foreach from=$staff_list item=staff }-->
                        <option value='{$staff.tbName}'>{$staff.tbName}</option>
                        <!--{/foreach}-->
                      </select></TD>
                  </TR>
                  <TR align="middle">
                    <TD align="right">Inspectors：</TD>
                    <TD colspan="3" align="left"><!--{foreach from=$staff_list key=i item=staff }--><input name='tbTeam_{$i}' type='checkbox' value='{$staff.tbName}'>{$staff.tbName} &nbsp; <!--{/foreach}--><input name='team_i' type='hidden' value='{$i}'></TD>
                  </TR>
				  <TR align="middle">
                    <TD align="right">Actual Inspectors：</TD>
					<TD colspan="3" align="left"><!--{foreach from=$staff_list key=k item=staff }--><input name='tbCnTeam_{$k}' type='checkbox' value='{$staff.tbCnName}'>{$staff.tbCnName} &nbsp; <!--{/foreach}--><input name='team_k' type='hidden' value='{$k}'></TD>
					
                  </TR>
				  <TR align="middle">
                    <TD align="right">Over Time Work：</TD>
					<TD align="left"><input name="tbOverWork" type="text" id="tbOverWork"></TD>
					<TD align="right">Extra Fee：</TD>
					<TD align="left"><input name="tbTaxi" type="text" id="tbTaxi"></TD>
                  </TR>
                </table></div>
     </td>
     </tr>
     <tr class="tb_title">
  <td>
        List All Products To Be Inspected Below
	 </td>
     </tr>
     <tr>
     <td>
	      <div id="list_model" class="marg">
			  <div class="t_line">
               
                    <li style="width:150px;">Products Name</li>
					<li style="width:330px;">Model Number</li>
                    <li style="width:75px;">PO Number </li>
                    <li>Qty</li>
					<li>Sample</li>
                    <li style="width:240px;">Serial Number</li>
					<li>Spec</li>
					<li>Pcs</li>
                    <li style="width:75px;">Remark</li>
					<li style="width:80px;">Add/Remove</li>
              </div>
			  <div id="show_item"></div>
			  <div class="b_line">
			     <li style="width:150px;">
                      <select name="tbProductName" id="tbProducName" onfocus="get_products()" onchange="fill_model()" style="width:150px;">
                          <option value=''>== select ==</option>                   
                      </select>
                 </li>
				 <li style="width:330px;">
                      <input name="tbModelNO" type="text" id="tbModelNO" size="50">
                 </li>
				 <li style="width:75px;">
                      <input name="tbClientPONo" type="text" id="tbClientPONo" size="8">
                 </li>
				 <li>
                      <input name="tbShippingQty" type="text" id="tbShippingQty" size="4">
                 </li>
				 <li>
                      <input name="tbSampleSize" type="text" id="tbSampleSize" size="4" onfocus="count_sample(document.getElementById('tbShippingQty').value);">
                 </li>
				 <li style="width:240px;">
                      <input name="tbSerialNO" type="text" id="tbSerialNO" size="36">
                 </li>
				 <li>
                      <input name="tbSpec" type="text" id="tbSpec" size="4">
				 </li>
				 <li>
                      <input name="tbPiece" type="text" id="tbPiece" size="4">
				 </li>
				 <li style="width:75px;">
                      <input name="tbRemark" type="text" id="tbRemark" size="8">
				 </li>
				 <li style="width:80px;">
                   <img src="pics/save.png" onclick="save_items();" title="Save(保存)" style="cursor:pointer;" />&nbsp;&nbsp;
				   <img src="pics/add.png" onclick="additem();" title="Add(增加)" style="cursor:pointer;" />
                 </li>
			  </div>
		  </div>
     </td>
     </tr>
	 <tr class="tb_title">
	 <td>
        Below information needs be filled by CY,and confirmed by Client
	 </td>
	 </tr>
	 <tr>
	 <td>
	    <div class="info">
        <li>Company Signature: {$tbNickName}</li>
		<li>Confirmed Date：{($smarty.now-60*60*24)|date_format:'%Y-%m-%d'}</li>
		<li>Raise By： {$tbName}</li>
		</div>
        <div style="text-align:left; margin:10px 0px 10px 10px;"></div>
	 </td>
	 </tr>
</table>
        <div style="width:100%; text-align:right; float:left; margin-top:8px;">Form Made By：{$tbName}&nbsp;</div>
		<div style="width:100%; text-align:center; float:left; margin-top:8px;"><input name="Create" type="submit" value="Create Booking" /> <input name="GoBack" type="button" value="Go Back To Project Page" onclick="location.href='projects.php'" /> <input name="Close" type="button" value="Close Page" onclick="javascript:self.close();"/></div>
      </div>
</form>
      {include file="footer.dwt"}	 
</div>
</body>
</html>
