  | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 เอาโค๊ดตรงปุ่ม search มาดูครับ                        
               
               | 
             
            
              
			                                
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2009-11-13 10:32:18 | 
                        By :
                            plakrim | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 <title>search</title> 
<meta http-equiv="Content-Type" content="text/html; charset=windows-874"> 
</head> 
 
<body    bgcolor="#E4E4E4">   
<% 
	if  Request.QueryString("z0")= "z"  then  
		xAct =Request.QueryString("x0")'ตัวแปรเก็บค่าจากตัวเลือกในฟอร์ม 
		xDoctype = Request.QueryString("x1") 
		xSubtype = Request.QueryString("x2") 
		xSubsubtype = Request.QueryString("x3") 
		xProject = Request.QueryString("x4") 
		xCreator = Request.QueryString("x5") 
		xVendor = Request.QueryString("x6") 
		xDocnumber = Request.QueryString("x7") 
		xTitle = Request.QueryString("x8") 
			 
		xArea = Request.QueryString("x9") 
		xUnit = Request.QueryString("x10") 
		xTagType = Request.QueryString("x11") 
		xTag = Request.QueryString("x12") 
		xManuf = Request.QueryString("x13") 
		xModel = Request.QueryString("x14") 
	 
		xDate1 = Request.QueryString("x15") 
		xDate2 = Request.QueryString("x16") 
	else 
 
	xAct =Request.Form("Act")'ตัวแปรเก็บค่าจากตัวเลือกในฟอร์ม 
	xDoctype = Request.Form("Doc_type") 
	xSubtype = Request.Form("Subtype") 
	xSubsubtype = Request.Form("Subsubtype") 
	xProject = Request.Form("Project") 
	xCreator = Request.Form("Creator") 
	xVendor = Request.Form("Vendor") 
	xDocnumber = Request.Form("Doc_number") 
	xTitle = Request.Form("Title") 
 
	 
	xArea = Request.Form("Area") 
	xUnit = Request.Form("unit") 
	xTagType = Request.Form("Tagtype") 
	xTag = Request.Form("Tag") 
	xManuf = Request.Form("Manuf") 
	xModel = Request.Form("model") 
	 
	xDate1 = Request.Form("Date1") 
	xDate2 = Request.Form("Date2") 
 
	end if  
 
	Set adocon = Server.CreateObject("ADODB.Connection") 'ประกาศตัวแปร adocon เป็นตัวแปร object  connectio จะเรียก ,method open  ที่ใช้ติดต่อฐาน  DigitalLibrary.accdb 
'	strCon = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source="  & server.MapPath("srieng02/wwwroot/DIGITALLIBRARY/DigitalLibrary2007.accdb")  'This one is for Access 2000/2002	 
	strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("DigitalLibrary2003.mdb")  'This one is for Access 2000/2002			 
'	strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("srieng02\Engineer\DigitalLibrary\DigitalLibrary2003.mdb")  'This one is for Access 2000/2002	 
%>				 
  <form action="search.asp" method="post" name="search" target="_self" id="search"> 
  <table width="100%" border="0"> 
    <tr>  
      <td><strong><font size="5"color="#0033FF">Document Search</font></strong>  
        <hr align="left" color="#333333" size="4" width="50%" > </td> 
    </tr> 
  </table> 
  <table width="100%" border="0"> 
    <tr>  
      <td><strong> <strong><font color="#5CB900" size="4">Detail</font></strong>  
        </strong><strong></strong><strong></strong><strong></strong><strong></strong></td> 
      <td colspan="3"> </td> 
      <td colspan="2"><strong><font color="#5CB900" size="4">Link</font></strong><strong></strong></td> 
    </tr> 
    <tr>  
      <td width="14%"><strong><font size="2">Document Type</font></strong></td> 
      <td width="20%"> <strong><font color="#0000FF" size="4">  
        <select style='width=130px' id=Doc_type name=Doc_type > 
		<option><%=xDoctype%></option> 
          <% 
  				xsql = "select  distinct(doc_type)  "				 
				xsql = xsql & " from s_elib_docmast "  
				xsql = xsql & " order by doc_type " 
				Set rx = Server.CreateObject("ADODB.Recordset") 
				rx_SQL = xsql 
				rx.Open rx_SQL, strCon,1,3 
		     	If rx.RecordCount <> 0 Then 
				rx.MoveFirst 
					Do While Not rx.EOF 
  %> 
          <option><%=rx("doc_type")%></option> 
		  
          <% 
						rx.Movenext 
					Loop 
					rx.close 
				End if 
%> 
           
		</select> 
        </font></strong>> 
		</td> 
      <td width="17%"><select style='width=120px' id=select3 name=subtype > 
	  <option><%=xSubtype%></option> 
          <% 
  				xsql = "select  distinct(sub_type)  "				 
				xsql = xsql & " from s_elib_docmast "  
				xsql = xsql & " order by sub_type " 
				Set rx = Server.CreateObject("ADODB.Recordset") 
				rx_SQL = xsql 
				rx.Open rx_SQL, strCon,1,3 
		     	If rx.RecordCount <> 0 Then 
				rx.MoveFirst 
					Do While Not rx.EOF 
  %> 
          <option><%=rx("sub_type")%></option> 
          <% 
						rx.Movenext 
					Loop 
					rx.close 
				End if 
%> 
           
		</select> 
        >> </td> 
      <td width="15%"><select style='width=120px' id=select33  name=Subsubtype > 
	  <option><%=xSubsub_type%></option> 
          <% 
  				xsql = "select  distinct(Subsub_type)  "				 
				xsql = xsql & " from s_elib_docmast "  
				xsql = xsql & " order by Subsub_type " 
				Set rx = Server.CreateObject("ADODB.Recordset") 
				rx_SQL = xsql 
				rx.Open rx_SQL, strCon,1,3 
		     	If rx.RecordCount <> 0 Then 
				rx.MoveFirst 
					Do While Not rx.EOF 
  %> 
          <option><%=rx("Subsub_type")%></option> 
          <% 
						rx.Movenext 
					Loop 
					rx.close 
				End if 
%> 
          
	    </select> <font size="2"> </font><font size="2"> </font><font size="2"> </font><font size="2"> </font></td> 
      <td><font size="2"> <strong>Area</strong></font></td> 
      <td width="22%" colspan="2"><font size="2">  
        <select style='width=180px' id=select27 name=Area> 
		<option><%=xArea%></option> 
          <% 
  				xsql = "select  distinct(link_key)  "				 
				xsql = xsql & " from s_elib_doclink where inuse ='T' and (link_type = 'AREA' or  link_type is null) "  
				xsql = xsql & " order by link_key " 
				Set rx = Server.CreateObject("ADODB.Recordset") 
				rx_SQL = xsql 
				rx.Open rx_SQL, strCon,1,3 
		     	If rx.RecordCount <> 0 Then 
 
					Do While Not rx.EOF 
  %> 
          <option><%=rx("link_key")%></option> 
          <% 
						rx.Movenext 
					Loop 
					rx.close 
				End if 
%> 
           
		</select> 
        </font></td> 
    </tr> 
    <tr>  
      <td><strong><font size="2">Project Number</font></strong></td> 
      <td colspan="3"><select style='width=316px' id=select34 name=Project > 
	  <option><%=xProject%></option> 
          <% 
  				xsql = "select  distinct(project)  "				 
				xsql = xsql & " from s_elib_docmast "  
				xsql = xsql & " order by project " 
				Set rx = Server.CreateObject("ADODB.Recordset") 
				rx_SQL = xsql 
				rx.Open rx_SQL, strCon,1,3 
		     	If rx.RecordCount <> 0 Then 
				rx.MoveFirst 
					Do While Not rx.EOF 
  %> 
          <option><%=rx("project")%></option> 
          <% 
						rx.Movenext 
					Loop 
					rx.close 
				End if 
%> 
           
		</select> <font size="2"> </font><font size="2"> </font><font size="2"> </font></td> 
      <td width="12%"><font size="2"> <strong>Unit</strong></font></td> 
      <td colspan="2"><font size="2">  
        <select style='width=180px' id=select26 name=unit> 
		<option><%=xUnit%></option> 
          <% 
  				xsql = "select  distinct(link_key)  "				 
				xsql = xsql & " from s_elib_doclink where inuse ='T' and (link_type = 'UNIT' or  link_type is null) "  
				xsql = xsql & " order by link_key " 
				Set rx = Server.CreateObject("ADODB.Recordset") 
				rx_SQL = xsql 
				rx.Open rx_SQL, strCon,1,3 
		     	If rx.RecordCount <> 0 Then 
				rx.MoveFirst 
					Do While Not rx.EOF 
  %> 
          <option><%=rx("link_key")%></option> 
          <% 
						rx.Movenext 
					Loop 
					rx.close 
				End if 
%> 
           
		</select> 
        </font></td> 
    </tr> 
    <tr>  
      <td height="29"><strong><font size="2">Creator</font></strong></td> 
      <td><select style='width=130px' id=Creator name=Creator > 
          <option><%=xCreator%></option> 
		  <% 
  				xsql = "select  distinct(creator)  "				 
				xsql = xsql & " from s_elib_docmast "  
				xsql = xsql & " order by creator " 
				Set rx = Server.CreateObject("ADODB.Recordset") 
				rx_SQL = xsql 
				rx.Open rx_SQL, strCon,1,3 
		     	If rx.RecordCount <> 0 Then 
				rx.MoveFirst 
					Do While Not rx.EOF 
  %> 
          <option><%=rx("creator")%></option> 
          <% 
						rx.Movenext 
					Loop 
					rx.close 
				End if 
%> 
           
		</select></td> 
      <td colspan="2"><select style='width=120px' id=select18 name=Vendor > 
	  <option><%=xVendor%></option> 
          <% 
  				xsql = "select  distinct(vendor)  "				 
				xsql = xsql & " from s_elib_docmast "  
				xsql = xsql & " order by vendor " 
				Set rx = Server.CreateObject("ADODB.Recordset") 
				rx_SQL = xsql 
				rx.Open rx_SQL, strCon,1,3 
		     	If rx.RecordCount <> 0 Then 
				rx.MoveFirst 
					Do While Not rx.EOF 
  %> 
          <option><%=rx("vendor")%></option> 
          <% 
						rx.Movenext 
					Loop 
					rx.close 
				End if 
%> 
        </select> <font size="2"> </font><font size="2"> </font></td> 
      <td><font size="2"> <strong>Tag type</strong></font></td> 
      <td colspan="2"><font size="2">  
        <select style='width=180px' id=select36 name=Tagtype> 
		<option><%=xTagtype%></option> 
          <% 
  				xsql = "select  distinct(link_key)  "				 
				xsql = xsql & " from s_elib_doclink where inuse ='T' and (link_type = 'TAG_TYPE'  or  link_type is null)"  
				xsql = xsql & " order by link_key " 
				Set rx = Server.CreateObject("ADODB.Recordset") 
				rx_SQL = xsql 
				rx.Open rx_SQL, strCon,1,3 
 
		     	If rx.RecordCount <> 0 Then 
	 
					Do While Not rx.EOF 
  %> 
          <option><%=rx("link_key")%></option> 
          <% 
						rx.Movenext 
					Loop 
					rx.close 
				End if 
%> 
        </select> 
        </font></td> 
    </tr> 
    <tr>  
      <td><strong><font size="2">Document Number</font></strong></td> 
      <td colspan="3"><select name=doc_number id=select35 style='width=316px' > 
          <option><%=xDoc_number%></option> 
		  <% 
  				xsql = "select  distinct(doc_number)  "				 
				xsql = xsql & " from s_elib_docmast "  
				xsql = xsql & " order by doc_number " 
				Set rx = Server.CreateObject("ADODB.Recordset") 
				rx_SQL = xsql 
				rx.Open rx_SQL, strCon,1,3 
		     	If rx.RecordCount <> 0 Then 
				rx.MoveFirst 
					Do While Not rx.EOF 
  %> 
          <option><%=rx("doc_number")%></option> 
          <% 
						rx.Movenext 
					Loop 
					rx.close 
				End if 
%> 
           
		</select> <font size="2"> </font><font size="2"> </font></td> 
      <td><font size="2"> <strong>Tag</strong></font></td> 
      <td colspan="2"><font size="2">  
        <select style='width=180px' id=select36 name=Tag> 
		<option><%=xTag%></option> 
          <% 
  				xsql = "select  distinct(link_key)  "				 
				xsql = xsql & " from s_elib_doclink where inuse ='T' and (link_type = 'TAG' or  link_type is null) "  
				xsql = xsql & " order by link_key " 
				Set rx = Server.CreateObject("ADODB.Recordset") 
				rx_SQL = xsql 
				rx.Open rx_SQL, strCon,1,3 
		     	If rx.RecordCount <> 0 Then 
				rx.MoveFirst 
					Do While Not rx.EOF 
  %> 
          <option><%=rx("link_key")%></option> 
          <% 
						rx.Movenext 
					Loop 
					rx.close 
				End if 
%> 
        </select> 
        </font></td> 
    </tr> 
    <tr>  
      <td><strong><font size="2">Title</font></strong></td> 
      <td colspan="3"><select name=Title id=Title style='width=482px'> 
          <option><%=xTitle%></option> 
		  <% 
  				xsql = "select  distinct(title)  "				 
				xsql = xsql & " from s_elib_docmast "  
				xsql = xsql & " order by title " 
				Set rx = Server.CreateObject("ADODB.Recordset") 
				rx_SQL = xsql 
				rx.Open rx_SQL, strCon,1,3 
		     	If rx.RecordCount <> 0 Then 
				rx.MoveFirst 
					Do While Not rx.EOF 
  %> 
          <option><%=rx("title")%></option> 
          <% 
						rx.Movenext 
					Loop 
					rx.close 
				End if 
%> 
          
		</select> <font size="2"> </font><font size="2"> </font></td> 
      <td><font size="2"> <strong>Manufacturer</strong></font></td> 
      <td colspan="2"><font size="2">  
        <select style='width=180px' id=select30 name=Manuf> 
		<option><%=xManuf%></option> 
          <% 
  				xsql = "select  distinct(link_key)  "				 
				xsql = xsql & " from s_elib_doclink  where inuse ='T' and (link_type = 'MANUF' or  link_type is null)"   
				xsql = xsql & " order by link_key " 
				Set rx = Server.CreateObject("ADODB.Recordset") 
				rx_SQL = xsql 
				rx.Open rx_SQL, strCon,1,3 
		     	If rx.RecordCount <> 0 Then 
 
					Do While Not rx.EOF 
  %> 
          <option><%=rx("link_key")%></option> 
          <% 
						rx.Movenext 
					Loop 
					rx.close 
				End if 
%> 
        </select> 
        </font></td> 
    </tr> 
    <tr>  
      <td><strong><font size="2">Date : from : to</font></strong></td> 
      <td colspan="3"> <input name id="Date1"="Date1" type="text" size="10" maxlength="10"> 
        <a href="JavaScript:;" onClick="toggleCalendar('Date1')" >	<img border="0" src="formcal.gif" width="16" height="16"></a> 
        <input  id="Date2" name="Date2" type="text" size="10" maxlength="10"> 
        <a href="JavaScript:;" onClick="toggleCalendar('Date2')"><img border="0" src="formcal.gif" width="16" height="16"></a> 
		 <TABLE bgColor=#ffffff border=1 cellPadding=0 cellSpacing=3 id=calendar style="DISPLAY: none; POSITION: absolute; Z-INDEX: 4"> 
  <TBODY> 
  <TR> 
    <TD colSpan=7 vAlign=center> 
	<!-- Month combo box --> 
	<SELECT id=month onchange=newCalendar()>  
    	<SCRIPT language=JavaScript> 
		// Output months into the document. 
		// Select current month. 
		for (var intLoop = 0; intLoop < months.length; intLoop++) 
			document.write("<OPTION " +	(today.month == intLoop ? "Selected" : "") + ">" + months[intLoop]); 
		</SCRIPT> 
	</SELECT>  
	<!-- Year combo box --> 
	<SELECT id=year onchange=newCalendar()>  
        <SCRIPT language=JavaScript> 
		// Output years into the document. 
		// Select current year. 
		for (var intLoop = 1900; intLoop < 2028; intLoop++) 
			document.write("<OPTION " + (today.year == intLoop ? "Selected" : "") + ">" + intLoop); 
		</SCRIPT> 
	</SELECT>  
 
	</TD> 
  </TR> 
 
 
	 
  <TR class=days> 
	<!-- Generate column for each day. --> 
    <SCRIPT language=JavaScript> 
	// Output days. 
	for (var intLoop = 0; intLoop < days.length; intLoop++) 
		document.write("<TD>" + days[intLoop] + "</TD>"); 
	</SCRIPT> 
  </TR> 
 
 
  <TBODY class=dates id=dayList onclick="getDate('')" vAlign=center> 
  <!-- Generate grid for individual days. --> 
  <SCRIPT language=JavaScript> 
	for (var intWeeks = 0; intWeeks < 6; intWeeks++) 
	{ 
		document.write("<TR>"); 
		for (var intDays = 0; intDays < days.length; intDays++) 
			document.write("<TD></TD>"); 
		document.write("</TR>"); 
	} 
  </SCRIPT> 
 
  <!-- Generate today day. --></TBODY> 
  <TBODY> 
  <TR> 
    <TD class=today colSpan=5 id=todayday onclick=getTodayDay()></TD> 
    <TD align=right colSpan=2><A href="javascript:HideCalendar();"><SPAN style="COLOR: black; FONT-SIZE: 10px"><B>Hide</B></SPAN></A></TD> 
  </TR> 
  </TBODY> 
 
</TABLE> 
 
		<font size="2"> </font><font size="2">   
        <input type="hidden" name="Act" value="A"> 
        </font></td> 
      <td><font size="2"> <strong>Model</strong></font></td> 
      <td colspan="2"><font size="2">  
        <select style='width=180px' id=select31 name=model > 
		<option><%=xModel%></option> 
          <% 
  				xsql = "select  distinct(link_key)  "				 
				xsql = xsql & " from s_elib_doclink  where inuse ='T' and (link_type = 'MODEL' or  link_type is null) "   
				xsql = xsql & " order by link_key " 
				Set rx = Server.CreateObject("ADODB.Recordset") 
				rx_SQL = xsql 
				rx.Open rx_SQL, strCon,1,3 
		     	If rx.RecordCount <> 0 Then 
 
					Do While Not rx.EOF 
  %> 
          <option><%=rx("link_key")%></option> 
          <% 
						rx.Movenext 
					Loop 
	rx.close 
	End if				 
%> 
        </select> 
        </font></td> 
    </tr> 
  </table> 
</hr> 
  <table width="100%" border="0"> 
    <tr>  
      <td height="26"><div align="center"> </div> 
        <strong></strong></td> 
      <td width="66%"><font size="2">   
        <input name="search" type="submit" value="Search"align="right" style= 'width=70px'> 
		<input name="Clear" type="reset" value="Clear"align="right" style= 'width=70px' onsubmit="this.form.reset();"> 
        <input name="Exit" type="button" value="Exit"align="right" style= 'width=70px' onClick="JavaScript:window.close();"> 
        </font></td> 
 
    </tr> 
	 <br> 
    <tr>  
      <td colspan="2"><p> 
	  <br> 
	   
	  </td>    
	   </tr> 
  </table>  
   </form> 
          <iframe  name="Result" src="result.asp?x0=<%=xAct %>&x1=<%=xDoctype %>&x2=<%=xSubtype %>&x3=<%=xSubsubtype %>&x4=<%=xProject %>&x5=<%=xCreator %>&x6=<%=xVendor %>&x7=<%=xDocnumber %>&x8=<%=xTitle %>&x9=<%=xArea%>&x10=<%=xUnit%>&x11=<%=xTagType%>&x12=<%=xTag%>&x13=<%=xManuf%>&x14=<%=xModel%>&x15=<%=xDate1%>&x16=<%=xDate2%>"scrolling="yes" width="940" height="205" ></iframe> 
        </p> 
  </hr> 
</body> 
</html>                        
               
               | 
             
            
              
			                                
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2009-11-13 10:46:25 | 
                        By :
                            poyz-say-hi | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
      		  
	
     |