FSN#33170 KPI. zo werkt het ongeveer wel

svn path=/Website/trunk/; revision=27160
This commit is contained in:
Peter Feij
2015-11-27 16:22:58 +00:00
parent 70ce8e0634
commit 36836b525e
2 changed files with 40 additions and 100 deletions

View File

@@ -3,45 +3,36 @@
$Revision$
$Id$
File: mld/kpi_detail.asp
File: kpi/kpi_detail.asp
*/ %>
<!-- #include file="../../appl/Shared/common.inc" -->
<!-- #include file="../../appl/Shared/iface.inc" -->
<!-- #include file="../Shared/common.inc" -->
<!-- #include file="../Shared/iface.inc" -->
<%
FCLTHeader.Requires({ plugins:["jQuery"] });
/***** Get webform parameters *****/
var fclt_key = getQParamInt("fclt_key", -1);
var loc_key = getQParamInt("fclt_key", -1);
var periode = getQParam("periode", "");
var proces = getQParam("fclt_f_kpi_definitie_categorie1", "");
var onderdeel = getQParam("fclt_f_kpi_definitie_categorie2", "");
var barselect = getQParam("_titel_", "");
var locatie = "Alle";
if (fclt_key > 0)
{
var sql_l = "SELECT fac_usrdata_code"
+ " FROM fac_usrtab t"
+ " , fac_usrdata d"
+ " WHERE t.fac_usrtab_key = d.fac_usrtab_key"
+ " AND t.fac_usrtab_object = 'USR_KPI INSTELLINGEN'"
+ " AND d.fac_usrdata_volgnr = " + fclt_key;
var oRs_l = Oracle.Execute(sql_l);
if (!oRs_l.eof)
locatie = oRs_l("fac_usrdata_code").Value;
oRs_l.Close();
if (loc_key > -1) {
var sql_l = " SELECT " + S("alg_loc_string")
+ " FROM alg_locatie l"
+ " WHERE alg_locatie_key = " + loc_key;
var oRs = Oracle.Execute(sql_l);
var locatie = oRs(0).Value;
}
else
var locatie = L("lcl_all");
if (periode == "")
{
if (periode == "") {
// Neem de laatste periode als er geen periode is opgegeven.
var sql_p = "SELECT MAX(TO_DATE(d.fac_usrdata_code, 'yyyymm')) periode"
+ " FROM fac_usrtab t"
+ " , fac_usrdata d"
+ " WHERE t.fac_usrtab_key = d.fac_usrtab_key"
+ " AND t.fac_usrtab_object = 'USR_KPI PERIODE'";
var sql_p = "SELECT TO_CHAR(MAX(kpi_score_datum), 'yyyymm') periode"
+ " FROM kpi_score";
var oRs_p = Oracle.Execute(sql_p);
user.anything_todo_or_abort(oRs_p.eof);
periode = oRs_p("periode").Value;
@@ -53,14 +44,14 @@ if (proces != "")
v_head = proces;
v_col1 = "kpi_definitie_categorie1";
v_col2 = "kpi_definitie_categorie2";
lbl_header = "KPI: Onderdelen van proces " + proces;
lbl_header = L("lcl_kpi_cat2_van_cat1").format(safe.html(proces));
}
else
{
v_head = onderdeel;
v_col1 = "kpi_definitie_categorie2";
v_col2 = "kpi_definitie_categorie1";
lbl_header = "KPI: Processen van onderdeel " + onderdeel;
lbl_header = L("lcl_kpi_cat1_van_cat2").format(safe.html(onderdeel));
}
@@ -76,66 +67,20 @@ else
FcltMgr.closeDetail(window, { cancel: true } );
}
</script>
</head>
<body id="showbody">
<div id="show">
<form name="u2">
<style>
table {
border: none;
width: 100%;
margin: 0;
padding: 0;
}
td {
font-family: Verdana;
font-style: normal;
font-size: 8pt;
font-weight: normal;
color: #000000;
text-align: left;
vertical-align: top;
}
span.prim_header {
font-style: normal;
font-size: 18pt;
float:left;
}
td.sec_heading {
background-color: #eee;
color: #000;
font-size: 18pt;
text-align: left;
vertical-align: bottom;
padding: 5px;
}
td.avg {
color: #fff;
font-size: 2em;
text-align: center;
vertical-align: middle;
width: 100px;
height: 80px;
}
td.score {
width: 50px;
}
</style>
<div class="fcltframeheader">
<span class="prim_header"><nobr><%=safe.html(lbl_header)%>&nbsp;<span id="iframerextratitle"></span></nobr></span>
</div>
<table>
<div class="fcltframeheader kpiprim_header"><%=safe.html(lbl_header)%></div>
<table class="kpidetails">
<%
var sql_h = "SELECT DISTINCT " + v_col2 + " totaalnaam"
+ " , totaalscore"
+ " , totaalkleur"
+ " FROM akza_v_kpi_proc_ond_detail"
+ " WHERE locatie = " + safe.quoted_sql(locatie)
+ " AND TO_CHAR(periode, 'yyyymm') = " + safe.quoted_sql(periode)
+ " FROM kpi_v_cat1_cat2_detail"
+ " WHERE alg_locatie_key = " + loc_key // en -1 betekent all
+ " AND TO_CHAR(kpi_score_datum, 'yyyymm') = " + safe.quoted_sql(periode)
+ " AND " + v_col1 + " = " + safe.quoted_sql(v_head)
+ " ORDER BY totaalscore";
@@ -147,10 +92,10 @@ else
h_head_kleur = oRs_h("totaalkleur").Value;
%>
<tr>
<td colspan="2" class="sec_heading"><%=safe.html(h_head_naam)%></td>
<td colspan="2" class="kpisec_heading"><%=safe.html(h_head_naam)%></td>
</tr>
<tr>
<td class="avg" style="background-color: <%=h_head_kleur%>"><%=h_head_score%></td>
<td class="kpiavg" style="background-color: <%=h_head_kleur%>"><%=h_head_score%></td>
<td>
<table>
<%
@@ -159,11 +104,12 @@ else
+ " , score"
+ " , kleur"
+ " FROM kpi_v_cat1_cat2_detail"
+ " WHERE locatie = " + safe.quoted_sql(locatie)
+ " AND TO_CHAR(periode, 'yyyymm') = " + safe.quoted_sql(periode)
+ " WHERE alg_locatie_key = " + loc_key // en -1 betekent all
+ " AND TO_CHAR(kpi_score_datum, 'yyyymm') = " + safe.quoted_sql(periode)
+ " AND " + v_col1 + " = " + safe.quoted_sql(v_head)
+ " AND " + v_col2 + " = " + safe.quoted_sql(h_head_naam)
+ " ORDER BY score";
var oRs_s = Oracle.Execute(sql_s);
while (!oRs_s.eof)
{
@@ -173,8 +119,8 @@ else
s_kleur = oRs_s("kleur").Value;
%>
<tr>
<td title="<%=safe.html(s_uitlg)%>"><%=safe.html(s_omsch)%></td>
<td title="<%=safe.html(s_uitlg)%>" class="score"><%=safe.html(s_score)%></td>
<td title="<%=safe.htmlattr(s_uitlg)%>" class="kpioms"><%=safe.html(s_omsch)%></td>
<td title="<%=safe.htmlattr(s_uitlg)%>" class="kpiscore"><%=safe.html(s_score)%></td>
</tr>
<%
oRs_s.MoveNext();
@@ -190,12 +136,6 @@ else
oRs_h.Close();
%>
</table>
<%
var buttons = [{ title: L("lcl_cancel"), action: "doCancel();"}];
CreateButtons(buttons, { entersubmit: true });
%>
</form>
</div>
</body>
</html>

View File

@@ -4,6 +4,8 @@
$Id$
File: kpi/kpi_search_list.asp
Note: de trendlijn reageert niet op de periode.
*/ %>
<!-- #include file="../Shared/common.inc" -->
@@ -17,8 +19,8 @@ FCLTHeader.Requires({ plugins:["jQuery"],
});
/***** Constants *****/
var init_height = "450px"; // TODO setting, param of css
// Moet dit ergens uit de definities komen? Nee hoor deze zijn predefined.
var init_height = "450px"; // TODO setting, param of css? Weet zo niet wat het effect is trwns
// Deze view zijn predefined.
var graph_view_names = [ {name: "kpi_v_graph_tot_tot", hastext1: 1, hastext2: 0},
{name: "kpi_v_graph_tot_trend", hastext1: 0, hastext2: 0},
{name: "kpi_v_graph_proc_tot", hastext1: 1, hastext2: 1},
@@ -36,7 +38,7 @@ var periode = getQParam("periode", "");
var toon = getQParamInt("toon", 0);
if (loc_key > -1) {
var sql_l = " SELECT " + S("alg_loc_string")
var sql_l = " SELECT alg_locatie_code"
+ " FROM alg_locatie l"
+ " WHERE alg_locatie_key = " + loc_key;
var oRs = Oracle.Execute(sql_l);
@@ -58,7 +60,6 @@ if (periode == "") {
var params = { initHeight: init_height,
widget_height: widget_height,
view_names: graph_view_names,
fclt_key: loc_key,
fclt_text: [locatie, periode, "", ""] // locatie, periode, kpi_definitie_categorie1 of kpi_definitie_categorie2, ?
};
@@ -131,8 +132,8 @@ function loadGraph(nr, params)
</td>
</tr>
<tr>
<td colspan="1"><% loadGraph(0, params); %></td>
<td colspan="2"><% loadGraph(1, params); %></td>
<td colspan="1" class="kpitcol1"><% loadGraph(0, params); %></td>
<td colspan="2" class="kpitcol2"><% loadGraph(1, params); %></td>
</tr>
<%
@@ -152,9 +153,9 @@ function loadGraph(nr, params)
</td>
</tr>
<tr>
<td><% loadGraph( (toon==0?2:5), params); %></td>
<td><% loadGraph( (toon==0?3:6), params); %></td>
<td><% loadGraph( (toon==0?4:7), params); %></td>
<td class="kpicol1"><% loadGraph( (toon==0?2:5), params); %></td>
<td class="kpicol2"><% loadGraph( (toon==0?3:6), params); %></td>
<td class="kpicol3"><% loadGraph( (toon==0?4:7), params); %></td>
</tr>
<%
oRs.MoveNext();
@@ -162,7 +163,6 @@ function loadGraph(nr, params)
oRs.Close();
%>
</table>
</div>
</body>
</html>