<%@language = "javascript" %>
<% /*
    $Revision$
    $Id$

    File:        fac_settings_search.asp
    Status:      40%
    Description: Toont zoekvelden voor lijst van menuopties
    Parameters:  ??
    Context:     Via URL (alleen prssys)
    Note:        For internal use only

*/ %>
<!-- #include file="../Shared/common.inc" -->
<!-- #include file="../Shared/iface.inc" -->
<!-- #include file="../Shared/selector.inc" -->
<%
FCLTHeader.Requires({plugins:["jQuery"], js: []});

var autosearch = getQParamInt("autosearch", 0) == 1;
var autfunction = "WEB_PRSSYS";
var authparams = user.checkAutorisation(autfunction);
var module = getQParam("module", "");
%>
<html>
<head>
<% FCLTHeader.Generate() %>

    <script type="text/javascript">
<%
		if (autosearch)
    	{
%>
				$(document).ready(function() {doSubmit()})
<%
	  	}
%>
        var anysearch = false;
		function doSubmit()
		{
		    anysearch = true;
			document.forms.u2.submit();
		}

        // Wordt automagisch aangeroepen als tabje wordt geactiveerd
        function fcltontabshow()
        {
            if (anysearch)
                doSubmit();
        }
        </script>
</head>
<body id="searchbody">

  <div id="search">
    <form name="u2" method="get" action="fac_settings_list.asp" target="workFrame" onsubmit='anysearch = true;'>
<%
			BLOCK_START("searchtable", L("lcl_filterblok"));
%>
      <tr>
				<td class="searchkolom1">
					<table><!-- x rijen, 2 kolommen: label + veld -->
						<!-- module -->
<%
						sql = "SELECT DISTINCT "
								+ "       fac_setting_module fac_module,"
								+ "       fac_setting_module fac_module "
								+ "FROM fac_setting "
                + (module!="" ? " WHERE fac_setting_module = " + safe.quoted_sql(module) :"")
								+ "ORDER BY fac_setting_module";
            if (module == "")
            {
						  FCLTselector("sModule",
											  	 sql,
               	           { label: L("lcl_fac_module")
                   	       ,  trclass: "primsearch"
                           ,  emptyOption: L("lcl_all")
                       	   })
            }
            else
            { // Er is maar 1 optie, dus geen emptyOption.
						  FCLTselector("sModule",
											  	 sql,
               	           { label: L("lcl_fac_module")
                   	       ,  trclass: "primsearch"
                       	   })
            }
%>
					</table>
				</td>
				<td>
					<table><!-- x rijen, 2 kolommen: label + veld -->
						<!-- Zoektekst -->
						<tr class="primsearch">
							<td class="label">
								<label for="sString"><%=L("lcl_lcl_search_fields")%>:</label>
							</td>
							<td>
								<input type="text" class="fld wildcard" name="zoek" id="zoek">
							</td>
						</tr>
					</table>
				</td>
			</tr>
<%    BLOCK_END();
      var buttons =  [ {title: L("lcl_search"), action: "doSubmit()" } ];
      CreateButtons(buttons, { entersubmit: true});
%>
    </form>
  </div> <!-- search -->

<div id="result">
 <iframe width="100%" height="100%" src="../Shared/empty.asp"
         name="workFrame" id="workFrame"  onload='FcltMgr.iframeLoaded(this)'
         frameborder="0" scrolling="no"></iframe>
</div>

</body>
</html>