<%@ LANGUAGE="JavaScript" %>
<% /*
     $Revision$
     $Id$

     File:               mrk_search.asp
     Description:        Filterscherm voor overzicht marktplaats
     Parameters:         urole                Rol van de gebruiker (frontend, frontoffice, backoffice, management info)
                         disc                 Categorie
     Globals:
     Context:
     Note:
*/ %>

<!-- #include file="../Shared/common.inc" -->
<!-- #include file="../Shared/iface.inc" -->
<!-- #include file="../Shared/selector.inc" -->
<!-- #include file="mrk.inc" -->

<%
FCLTHeader.Requires({ plugins: ["jQuery"] });

/***** Get webform parameters *****/
var urole = getQParamSafe("urole");
var fronto = (urole == "fo");
var backo = (urole == "bo");
var minfo = (urole == "mi");
var frontend = (urole == "fe" || (!fronto & !backo & !minfo));

var disc = getQParamInt("disc", -1); // Categorie
/***** End get webform parameters *****/

var autfunction = "";
switch(urole)
{
  case "fe": autfunction = "WEB_MRKUSE";
             break;
  case "bo": autfunction = "WEB_MRKBOF";
             break;
}

var authparams = user.checkAutorisation(autfunction);
%>

<html>
  <head>
<%  FCLTHeader.Generate(); %>

    <script type="text/javascript">
      function doSubmit()
      {
        document.forms.u2.submit();
      }
    </script>
  </head>

  <body id="searchbody">
    <div id="search">
      <form name="u2" target="workFrame" action="mrk_search_list.asp" method="get">
<%    BLOCK_START("searchtable", L("lcl_filterblok"));%>
        <input type="hidden" name="urole" value="<%=urole%>">
        <tr>
          <td class="searchkolom1"><!-- start column 1 -->
            <table><!-- x rijen, 2 kolommen: label + veld -->
<%          // <!-- Catalogus -->
            sql = "SELECT ins_discipline_key"
                + ", ins_discipline_omschrijving"
                + " FROM ins_tab_discipline"
                + " WHERE ins_discipline_module = 'MRK'"
                + " AND ins_discipline_verwijder IS NULL"
                + " ORDER BY upper(ins_discipline_omschrijving)";
            FCLTselector("disc",
                         sql,
                         { initKey: disc,
                           label: L("lcl_mrk_categorie"),
                           //onChange: 'updateSrtGroup("' + autfunction + '");', // discChanged
                           trclass:"primsearch",
                           emptyOption: ""
                         });
%>
                  <!-- Zoektekst -->
                  <tr class="primsearch">
                    <td class="label"><label for="searchtekst"><%=L("lcl_search_diff_fields")%>:</label></td>
                    <td>
                      <input type="text" class="fldsrch wildcard" name="searchtekst" value="">
                    </td>
                  </tr>

            </table>
          </td><!-- end column 1 -->

          <!-- Second column -->
          <td valign=top>
          </td><!-- end column 2-->
        </tr>
        </table>
<%    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>
