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

    File:        bes_srtprod_search.asp
    Description: Zoekscherm artikelen
    Parameters:  urole
    Context:
    Note:

*/ %>

<!-- #include file="../Shared/common.inc" -->
<!-- #include file="../Shared/iface.inc" -->
<!-- #include file="../Shared/plaatsselector.inc" -->
<!-- #include file="../Shared/bedrijfselector.inc" -->
<!-- #include file="../Shared/selector.inc" -->
<!-- #include file="../Shared/calendar.inc" -->
<!-- #include file="bes.inc" -->

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

var authparams = user.checkAutorisation("WEB_BESMSU");

var disc_key = getQParamInt("disc_key", -1); // Discipline
%>

<html>
  <head>
    <%  FCLTHeader.Generate(); %>
      <script type="text/javascript">
          function doSubmit()
            {
                document.forms.u2.submit();
            }
      </script>
  </head>
  <body id="searchbody">
    <div id="search">
<%    BLOCK_START("searchtable", L("lcl_filterblok"));%>
      <form name="u2" target="workFrame" action="bes_srtprod_search_list.asp" method="get">
          <tr>
            <td class="searchkolom1">
              <table><!-- x rijen, 2 kolommen: label + veld -->
              <tr class="primsearch">
                <td class="label"><label for="searchtext"><%=L("lcl_bes_srtprod")%>:</label></td>
                <td><input type="text" class="fldsrch" name="searchtext" id="searchtext"></td>
              </tr>
<%
                FCLTbedrijfselector("lev_key", // supplier
                                  "sg_lev",
                                  { companyKey: -1,
                                    label: L("lcl_bes_producer"),
                                    trclass: "primsearch",
                                    filtercode: "BL",
                                    whenEmpty: L("lcl_search_generic")
                                  });
%>
              </table>
            </td><!-- end column 1 -->

            <td class="searchkolom2">
              <table><!-- x rijen, 2 kolommen: label + veld -->
<%
              sql = "select b.ins_discipline_key, "
                  + "       b.ins_discipline_omschrijving"
                  + "  FROM ins_tab_discipline b"
                  + " WHERE ins_discipline_key IN (select ins_discipline_key"
                  + "  from bes_srtgroep bsg, bes_srtprod bsd"
                  + "   WHERE bes_srtgroep_verwijder IS NULL"
                  + "     AND bsg.bes_srtgroep_key = bsd.bes_srtgroep_key"
                  + "     AND bes_srtprod_verwijder IS NULL)"
                  + "     AND ins_discipline_verwijder IS NULL"
                  + "     AND ins_discipline_module ='PRD'"
                  + " ORDER BY ins_discipline_omschrijving";
              FCLTselector("disc",
                           sql,
                           { initKey: disc_key,
                             label: L("lcl_bes_discipline"),
                             trclass: "primsearch",
                             emptyOption: ""
                           });
              FCLTcalendar( "bes_enddat",
                            { label  : L("lcl_bes_peildatum")
                            });
%>
              </table>
            </td><!-- end column 1 -->
          </tr>
<%    BLOCK_END();

  var buttons =  [ {title: L("lcl_search"), action: "doSubmit()", id: "bSearch" } ];
  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>
