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

    File:               SuggestDienst.asp
    Description:        Suggereer dienst
    Parameters:         k De eerste paar letters van omschrijving of hint
    Globals:
    Context:
    Note:
*/ %>

<%
JSON_Result = true;
%>

<!-- #include file="../../Shared/common.inc" -->
<!-- #include file="./suggest.inc" -->
<!-- #include file="./Dienstfilter.inc" -->

<%
var chars = getQParam("k", "");
var bAll = getQParamInt("SuggestAll", 0) == 1;
var filtcode = getQParam("filtcode", "");
chars = chars.replace(/\*/g,"%");

var filtClause = getFiltClauseDienst(filtcode);

sql = "SELECT  prs_dienst_key"
    + ",  " + lcl.xsqla('prs_dienst_omschrijving', 'prs_dienst_key')
    + ",  " + lcl.xsqla('prs_dienst_hint', 'prs_dienst_key')
    + "     FROM prs_dienst pd"
    + "    WHERE (UPPER(" + lcl.xsql('prs_dienst_omschrijving', 'prs_dienst_key') + ") LIKE " + safe.quoted_sql_wild2(chars) 
    + "    OR UPPER(" + lcl.xsql('prs_dienst_hint', 'prs_dienst_key') + ") LIKE " + safe.quoted_sql_wild2(chars) + ")"
    + filtClause
    + " ORDER BY " + lcl.xsql('prs_dienst_omschrijving', 'prs_dienst_key');

WriteResult2(sql, { bAll: bAll,
                    fldName: "prs_dienst_omschrijving",
                    fldKey : "prs_dienst_key",
                    fldDesc: "prs_dienst_hint"} );
%>
<% ASPPAGE_END(); %> 
