DBA Data[Home] [Help]

PACKAGE BODY: APPS.POA_CM_EVALUATION_ICX

Source


1 PACKAGE BODY poa_cm_evaluation_icx AS
2 /* $Header: POACMHDB.pls 115.9 2003/04/29 21:46:29 rvickrey ship $ */
3 
4 TYPE t_attribute_record IS RECORD (
5   attribute_name  VARCHAR2(30),
6   attribute_value VARCHAR2(1000)
7 );
8 
9 TYPE t_attribute_table IS TABLE OF t_attribute_record INDEX BY BINARY_INTEGER;
10 
11 g_attribute_table t_attribute_table;
12 
13 PROCEDURE PrintCSS;
14 PROCEDURE SetAttributeTable(poa_cm_custom_measure_code IN VARCHAR2,
15                             poa_cm_custom_measure      IN VARCHAR2,
16                             poa_cm_period_type         IN VARCHAR2,
17                             poa_cm_user_period_type    IN VARCHAR2,
18                             poa_cm_period_name         IN VARCHAR2,
19                             poa_cm_supplier_id         IN VARCHAR2,
20                             poa_cm_supplier            IN VARCHAR2,
21                             poa_cm_supplier_site_id    IN VARCHAR2,
22                             poa_cm_supplier_site       IN VARCHAR2,
23                             poa_cm_category_id         IN VARCHAR2,
24                             poa_cm_commodity           IN VARCHAR2,
25                             poa_cm_item_id             IN VARCHAR2,
26                             poa_cm_item                IN VARCHAR2,
27                             poa_cm_comments            IN VARCHAR2,
28                             poa_cm_evaluated_by_id     IN VARCHAR2,
29                             poa_cm_evaluated_by        IN VARCHAR2,
30                             poa_cm_org_id              IN VARCHAR2,
31                             poa_cm_oper_unit_id        IN VARCHAR2,
32                             poa_cm_operating_unit      IN VARCHAR2,
33 			    poa_cm_submit_type 	       IN VARCHAR2,
34 			    poa_cm_evaluation_id       IN VARCHAR2);
35 
36 FUNCTION GetAttributeValue(p_attribute_name  IN VARCHAR2,
37                            p_start_index     IN NUMBER) RETURN VARCHAR2;
38 
39 PROCEDURE PrintHeaderPageFields(p_language IN VARCHAR2);
40 
41 PROCEDURE PrintBottomButtons(p_language IN VARCHAR2);
42 
43 PROCEDURE header_page(poa_cm_custom_measure_code IN VARCHAR2 DEFAULT NULL,
44                       poa_cm_custom_measure      IN VARCHAR2 DEFAULT NULL,
45                       poa_cm_period_type         IN VARCHAR2 DEFAULT NULL,
46                       poa_cm_user_period_type    IN VARCHAR2 DEFAULT NULL,
47                       poa_cm_period_name         IN VARCHAR2 DEFAULT NULL,
48                       poa_cm_supplier_id         IN VARCHAR2 DEFAULT NULL,
49                       poa_cm_supplier            IN VARCHAR2 DEFAULT NULL,
50                       poa_cm_supplier_site_id    IN VARCHAR2 DEFAULT NULL,
51                       poa_cm_supplier_site       IN VARCHAR2 DEFAULT NULL,
52                       poa_cm_category_id         IN VARCHAR2 DEFAULT NULL,
53                       poa_cm_commodity           IN VARCHAR2 DEFAULT NULL,
54                       poa_cm_item_id             IN VARCHAR2 DEFAULT NULL,
55                       poa_cm_item                IN VARCHAR2 DEFAULT NULL,
56                       poa_cm_comments            IN VARCHAR2 DEFAULT NULL,
57                       poa_cm_evaluated_by_id     IN VARCHAR2 DEFAULT NULL,
58                       poa_cm_evaluated_by        IN VARCHAR2 DEFAULT NULL,
59                       poa_cm_org_id              IN VARCHAR2 DEFAULT NULL,
60                       poa_cm_oper_unit_id        IN VARCHAR2 DEFAULT NULL,
61                       poa_cm_operating_unit      IN VARCHAR2 DEFAULT NULL,
62 		      poa_cm_submit_type	 IN VARCHAR2 DEFAULT NULL,
63 		      poa_cm_evaluation_id	 IN VARCHAR2 DEFAULT NULL,
64                       error_msg                  IN VARCHAR2 DEFAULT NULL
65 ) IS
66   l_language    VARCHAR2(5);
67   l_script_name VARCHAR2(240);
68   l_org_id      NUMBER;
69   l_user_id     NUMBER;
70   l_oper_unit_id NUMBER;
71 
72   l_employee_id NUMBER := null;
73   l_emp_name    VARCHAR2(240) := null;
74 
75   l_cm_code        VARCHAR2(25) := null;
76   l_custom_measure VARCHAR2(25) := null;
77 
78   l_period_type      VARCHAR2(15) := null;
79   l_user_period_type VARCHAR2(15) := null;
80   l_period_name      VARCHAR2(15) := null;
81 
82   l_operating_unit VARCHAR2(60) := null;
83 
84 BEGIN
85 
86   IF NOT icx_sec.validatesession THEN
87     RETURN;
88   END IF;
89 
90   l_org_id := icx_sec.getID(icx_sec.PV_ORG_ID);
91   l_language := icx_sec.getID(icx_sec.PV_LANGUAGE_CODE);
92   l_script_name := owa_util.get_cgi_env('SCRIPT_NAME');
93   l_user_id := icx_sec.getID(icx_sec.PV_WEB_USER_ID);
94 
95   BEGIN
96 
97     select
98       nvl(poa_cm_evaluated_by_id, user_id),
99       nvl(poa_cm_evaluated_by, user_name)
100     into
101       l_employee_id,
102       l_emp_name
103     from
104       fnd_user
105     where
106       user_id = l_user_id;
107 
108     select
109       nvl(poa_cm_custom_measure_code, lookup_code),
110       nvl(poa_cm_custom_measure, displayed_field)
111     into
112      l_cm_code,
113      l_custom_measure
114     from
115       po_lookup_codes
116     where
117       lookup_type = 'CUSTOM MEASURE' and
118       lookup_code = 'CUSTOMER SATISFACTION';
119 
120     select nvl(poa_cm_period_type, t.period_type),
121            nvl(poa_cm_user_period_type, t.user_period_type),
122            nvl(poa_cm_period_name, p.period_name)
123       into l_period_type,
124            l_user_period_type,
125            l_period_name
126       from gl_periods p,
127            gl_period_types t,
128            financials_system_parameters f,
129            gl_sets_of_books b
130      where f.set_of_books_id = b.set_of_books_id
131        and b.accounted_period_type = p.period_type
132        and b.period_set_name = p.period_set_name
133        and p.period_type = t.period_type
134        and trunc(sysdate) >= trunc(p.start_date)
135        and trunc(sysdate) <= trunc(p.end_date);
136 
137   EXCEPTION
138     when others then
139       null;
140   END;
141 
142   BEGIN
143      select nvl(poa_cm_operating_unit, name)
144        into l_operating_unit
145        from hr_operating_units
146       where organization_id = l_org_id;
147   EXCEPTION
148     when others then
149       null;
150   END;
151 
152   BEGIN
153        select decode(l_operating_unit, name, l_org_id, nvl(poa_cm_oper_unit_id, to_number(NULL)))
154        into l_oper_unit_id
155        from hr_operating_units
156        where organization_id = l_org_id;
157   EXCEPTION
158     when others then
159       null;
160   END;
161 
162   htp.htmlOpen;
163   htp.title('Survey Response');
164 
165   htp.headOpen;
166   icx_util.copyright;
167 
168   PrintCSS;
169 
170   js.scriptOpen;
171 
172   icx_util.LOVscript;
173 
174 ----- Begin Javascript -----
175 
176   htp.p('
177 
178 function submitDoc(submit_type)
179 {
180   var f = document.POA_CM_EVALUATION_R;
181 
182   if (submit_type == "Update")
183     f.POA_CM_SUBMIT_TYPE.value = "Update";
184   else if (submit_type == "Next")
185     f.POA_CM_SUBMIT_TYPE.value = "Next";
186 
187   if (f.POA_CM_USER_PERIOD_TYPE.value == "")
188     alert(''Please enter a valid period type.'');
189   else if (f.POA_CM_PERIOD_NAME.value == "")
190     alert(''Please enter a valid period name.'');
191   else if (f.POA_CM_SUPPLIER.value == "")
192     alert(''Please enter a valid supplier.'');
193   else
194     document.POA_CM_EVALUATION_R.submit();
195 }
196 
197 function call_LOV(c_attribute_code)
198 {
199   var f = document.POA_CM_EVALUATION_R;
200   var c_js_where_clause = "";
201 
202   if (c_attribute_code == "POA_CM_PERIOD_NAME")
203   {
204     if (f.POA_CM_PERIOD_TYPE.value != "")
205       c_js_where_clause = " PERIOD_TYPE = ''" + f.POA_CM_PERIOD_TYPE.value.replace(/''/g,"''''") + "''";
206     else
207       c_js_where_clause = " USER_PERIOD_TYPE = ''" + f.POA_CM_USER_PERIOD_TYPE.value.replace(/''/g,"''''") + "''";
208   }
209   else if (c_attribute_code == "POA_CM_SUPPLIER_SITE")
210   {
211     if (f.POA_CM_SUPPLIER_ID.value !="")
212       c_js_where_clause = " VENDOR_ID = " + f.POA_CM_SUPPLIER_ID.value.replace(/''/g,"''''") +
213                           " AND ORG_ID = " + f.POA_CM_ORG_ID.value.replace(/''/g,"''''");
214     else
215       c_js_where_clause = " VENDOR_NAME = ''" + f.POA_CM_SUPPLIER.value.replace(/''/g,"''''") +
216                           "'' AND ORG_ID = " + f.POA_CM_ORG_ID.value.replace(/''/g,"''''");
217   }
218   else if (c_attribute_code == "POA_CM_OPERATING_UNIT")
219   {
220     if (f.POA_CM_SUPPLIER_SITE.value != "")
221       if (f.POA_CM_SUPPLIER_SITE_ID.value != "")
222         if (f.POA_CM_SUPPLIER_ID.value != "")
223           c_js_where_clause = " ORG_ID in (select ORG_ID  from POA_CM_SITE_LOV_V where " +
224                               " VENDOR_ID = " + f.POA_CM_SUPPLIER_ID.value.replace(/''/g,"''''") + " AND " +
225                               " VENDOR_SITE_ID = " + f.POA_CM_SUPPLIER_SITE_ID.value.replace(/''/g,"''''") + ")";
226         else
227           c_js_where_clause = " ORG_ID in (select ORG_ID  from POA_CM_SITE_LOV_V where " +
228                               " VENDOR_NAME = ''" + f.POA_CM_SUPPLIER.value.replace(/''/g,"''''") + "'' AND " +
229                               " VENDOR_SITE_ID = " + f.POA_CM_SUPPLIER_SITE_ID.value.replace(/''/g,"''''") + ")";
230       else
231         if (f.POA_CM_SUPPLIER_ID.value != "")
232           c_js_where_clause = " ORG_ID in (select ORG_ID  from POA_CM_SITE_LOV_V where " +
233                               " VENDOR_ID = " + f.POA_CM_SUPPLIER_ID.value.replace(/''/g,"''''") + " AND " +
234                               " VENDOR_SITE_CODE = ''" + f.POA_CM_SUPPLIER_SITE.value.replace(/''/g,"''''") + "'')";
235         else
236           c_js_where_clause = " ORG_ID in (select ORG_ID  from POA_CM_SITE_LOV_V where " +
237                               " VENDOR_NAME = ''" + f.POA_CM_SUPPLIER.value.replace(/''/g,"''''") + "'' AND " +
238                               " VENDOR_SITE_CODE = ''" + f.POA_CM_SUPPLIER_SITE.value.replace(/''/g,"''''") + "'')";
239 
240   }
241   else if (c_attribute_code == "POA_CM_ITEM")
242   {
243     if (f.POA_CM_COMMODITY.value != "")
244       if (f.POA_CM_CATEGORY_ID.value != "")
245         c_js_where_clause = " ORGANIZATION_ID in (select INVENTORY_ORGANIZATION_ID from FINANCIALS_SYSTEM_PARAMETERS)" +
246                             " AND CATEGORY_ID = " + f.POA_CM_CATEGORY_ID.value.replace(/''/g,"''''");
247       else
248         c_js_where_clause = " ORGANIZATION_ID in (select INVENTORY_ORGANIZATION_ID from FINANCIALS_SYSTEM_PARAMETERS)" +
249                             " AND COMMODITY = ''" + f.POA_CM_COMMODITY.value.replace(/''/g,"''''") + "''";
250     else
251       c_js_where_clause = " ORGANIZATION_ID in (select INVENTORY_ORGANIZATION_ID from FINANCIALS_SYSTEM_PARAMETERS)";
252   }
253 
254   c_js_where_clause = escape(c_js_where_clause, 1);
255 
256   LOV("201", c_attribute_code, "201", "POA_CM_EVALUATION_R", "POA_CM_EVALUATION_R", "", "", c_js_where_clause);
257 
258   reset_hidden(c_attribute_code);
259 }
260 
261 function reset_hidden(c_attribute_code)
262 {
263   var f = document.POA_CM_EVALUATION_R;
264 
265   if (c_attribute_code == "POA_CM_USER_PERIOD_TYPE")
266   {
267     f.POA_CM_PERIOD_TYPE.value = "";
268     f.POA_CM_PERIOD_NAME.value = "";
269   }
270   else if (c_attribute_code == "POA_CM_SUPPLIER")
271   {
272     f.POA_CM_SUPPLIER_ID.value = "";
273     f.POA_CM_SUPPLIER_SITE_ID.value = "";
274     f.POA_CM_SUPPLIER_SITE.value = "";
275   }
276   else if (c_attribute_code == "POA_CM_SUPPLIER_SITE")
277   {
278     f.POA_CM_SUPPLIER_SITE_ID.value = "";
279     f.POA_CM_OPER_UNIT_ID.value = "";
280     f.POA_CM_OPERATING_UNIT.value = "";
281   }
282   else if (c_attribute_code == "POA_CM_OPERATING_UNIT")
283   {
284     f.POA_CM_OPER_UNIT_ID.value = "";
285   }
286   else if (c_attribute_code == "POA_CM_COMMODITY")
287   {
288     f.POA_CM_CATEGORY_ID.value = "";
289     f.POA_CM_ITEM_ID.value = "";
290     f.POA_CM_ITEM.value = "";
291   }
292   else if (c_attribute_code == "POA_CM_ITEM")
293   {
294     f.POA_CM_ITEM_ID.value = "";
295   }
296   else if (c_attribute_code == "POA_CM_EVALUATED_BY")
297   {
298     f.POA_CM_EVALUATED_BY_ID.value = "";
299   }
300 }
301 
302 
303 function check_read_only(c_attribute_code)
304 {
305   var f = document.POA_CM_EVALUATION_R;
306 
307   if (c_attribute_code == "POA_CM_CUSTOM_MEASURE")
308   {
309     f.POA_CM_CUSTOM_MEASURE.blur();
310   }
311 }
312 
313 function cancelAction()
314 {
315   var f = document.POA_CM_EVALUATION_R;
316 
317    f.POA_CM_PERIOD_TYPE.value = "";
318    f.POA_CM_USER_PERIOD_TYPE.value = "";
319    f.POA_CM_PERIOD_NAME.value = "";
320    f.POA_CM_SUPPLIER_ID.value = "";
321    f.POA_CM_SUPPLIER.value = "";
322    f.POA_CM_SUPPLIER_SITE_ID.value = "";
323    f.POA_CM_SUPPLIER_SITE.value = "";
324    f.POA_CM_CATEGORY_ID.value = "";
325    f.POA_CM_COMMODITY.value = "";
326    f.POA_CM_ITEM_ID.value = "";
327    f.POA_CM_ITEM.value = "";
328    f.POA_CM_COMMENTS.value = "";
329    f.POA_CM_EVALUATED_BY_ID.value = "";
330    f.POA_CM_EVALUATED_BY.value = "";
331    f.POA_CM_OPER_UNIT_ID.value = "";
332    f.POA_CM_OPERATING_UNIT.value = "";
333 }
334 
335 function loadPage(error_msg, emp_id, emp_name, cm_code, cm, p_type, u_type, p_name, org_id, oper_unit_id, oper)
336 {
337   var f = document.POA_CM_EVALUATION_R;
338 
339   f.POA_CM_EVALUATED_BY_ID.value = emp_id;
340   f.POA_CM_EVALUATED_BY.value = emp_name;
341 
342   f.POA_CM_CUSTOM_MEASURE_CODE.value = cm_code;
343   f.POA_CM_CUSTOM_MEASURE.value = cm;
344 
345   f.POA_CM_PERIOD_TYPE.value = p_type;
346   f.POA_CM_USER_PERIOD_TYPE.value = u_type;
347   f.POA_CM_PERIOD_NAME.value = p_name;
348 
349   f.POA_CM_OPER_UNIT_ID.value = oper_unit_id;
350   f.POA_CM_OPERATING_UNIT.value = oper;
351 
352   if (error_msg.length > 0)
353     alert(error_msg);
354 }
355 
356   ');
357 
358 ----- End Javascript -----
359 
360   js.scriptClose;
361 
362 htp.p('<LINK REL="stylesheet" HREF="/OA_HTML/bismarli.css">');
363 
364   htp.headClose;
365 
366   htp.bodyOpen;
367 
368 htp.p('<BODY bgColor="#ffffff" link="#663300" vlink="#996633" alink="#FF6600" text="#000000" onLoad="javascript:loadPage(');
369 htp.p('''' || ICX_UTIL.replace_quotes(error_msg) || ''',');
370 htp.p('''' || ICX_UTIL.replace_quotes(to_char(l_employee_id)) || ''',');
371 htp.p('''' || ICX_UTIL.replace_quotes(l_emp_name) || ''',');
372 htp.p('''' || ICX_UTIL.replace_quotes(l_cm_code) || ''',');
373 htp.p('''' || ICX_UTIL.replace_quotes(l_custom_measure) || ''',');
374 htp.p('''' || ICX_UTIL.replace_quotes(l_period_type) || ''',');
375 htp.p('''' || ICX_UTIL.replace_quotes(l_user_period_type) || ''',');
376 htp.p('''' || ICX_UTIL.replace_quotes(l_period_name) || ''',');
377 htp.p('''' || ICX_UTIL.replace_quotes(to_char(l_org_id)) || ''',');
378 htp.p('''' || ICX_UTIL.replace_quotes(to_char(l_oper_unit_id)) || ''',');
379 htp.p('''' || ICX_UTIL.replace_quotes(l_operating_unit) || ''')">');
380 
381 htp.p('<FORM NAME="POA_CM_EVALUATION_R" ACTION="'||l_script_name||'/POA_CM_EVAL_SCORES_ICX.redirect_page" METHOD="POST">');
382 
383 htp.p('<INPUT NAME="POA_CM_SUBMIT_TYPE" TYPE="hidden" value ="">');
384 htp.p('<INPUT NAME="POA_CM_EVALUATION_ID" TYPE="hidden" value ="">');
385 
386   htp.p('
387 
388      <table border=0 cellspacing=0 cellpadding=0 width=100%>
389      <tr><td rowspan=2 valign=bottom width=371>
390      <table border=0 cellspacing=0 cellpadding=0 width=100%>
391      <tr align=left><td height=30><img src=/OA_MEDIA/bisorcl.gif border=no height=23 width=141></a></td>
392      <tr align=left> <td valign=bottom><img src=/OA_MEDIA/POABRAND.gif border=no></a></td></td></tr>
393      </table>
394      </td><td colspan=2 rowspan=2 valign=bottom align=right>
395       <table border=0 cellpadding=0 align=right cellspacing=4>
396         <tr valign=bottom>
397           <td width=60 align=center><a href=Oraclemypage.home onMouseOver="window.status=''Return to Portal''; return true">
398           <img alt=Return to Portal src=/OA_MEDIA/bisrtrnp.gif width=32 border=0 height=32></a></td>
402           <td width=60 align=center valign=bottom><a href="javascript:help_window()", onMouseOver="window.status=''Help''; return true">
399           <td width=60 align=center><a href=OracleNavigate.Responsibility onMouseOver="window.status=''Menu''; return true">
400           <img alt=Menu src=/OA_MEDIA/bisnmenu.gif width=32 border=0
401 height=32></a></td>
403           <img alt=Help src=/OA_MEDIA/bisnhelp.gif width=32 border=0
404 height=32></a></td>
405         </tr>
406         <tr align=center valign=top>
407           <td width=60><a href=Oraclemypage.home onMouseOver="window.status=''Return to Portal''; return true">
408           <span class="OraGlobalButtonText">Return to Portal</span></a></td>
409           <td width=60><a href=OracleNavigate.Responsibility onMouseOver="window.status=''Menu''; return true">
410           <span class="OraGlobalButtonText">Menu</span></a></td>
411           <td width=60><a href="javascript:help_window()",  onMouseOver="window.status=''Help''; return true">
412           <span class="OraGlobalButtonText">Help</span></a></td>
413         </tr></table>
414     </td>
415     </tr></table>
416    </table>
417 
418 <table Border=0 cellpadding=0 cellspacing=0 width=100%>
419   <tbody>
420   <tr><td bgcolor=#ffffff colspan=3 height=1><img height=1 src=/OA_MEDIA/bisspace.gif width=1></td>
421   </tr>
422   <tr>
423     <td bgcolor=#31659c colspan=2 height=21><img border=0 height=21 src=/OA_MEDIA/bisspace.gif width=1></td>
424     <td bgcolor=#31659c  height=21><font face="Arial, Helvetica, sans-serif" size="4" color="#ffffff"> </font></td>
425     <td background=/OA_MEDIA/bisrhshd.gif height=21 width=5><img border=0 height=1
426 src=/OA_MEDIA/bisspace.gif width=1></td>
427   </tr>
428   <tr>
429     <td bgcolor=#31659c height=16 width=9><img border=0 height=1 src=/OA_MEDIA/bisspace.gif width=9></td>
430     <td bgcolor=#31659c height=16 width=5><img border=0 height=1 src=/OA_MEDIA/bisspace.gif width=5></td>
431     <td background=/OA_MEDIA/bisbot.gif width=1000><img align=top height=16
432 src=/OA_MEDIA/bistopar.gif width=26></td>
433     <td align=left valign=top width=5><img height=8 src=/OA_MEDIA/bisrend.gif width=8></td>
434   </tr>
435   <tr>
436     <td align=left background=/OA_MEDIA/bisbot.gif height=8 valign=top width=9><img height=8
437 src=/OA_MEDIA/bislend.gif width=10></td>
438     <td background=/OA_MEDIA/bisbot.gif height=8 width=5><img border=0 height=1
439 src=/OA_MEDIA/bisspace.gif width=1></td>
440     <td align=left valign=top width=1000><img height=8 src=/OA_MEDIA/bisarchc.gif width=9></td>
441     <td width=5></td>
442   </tr>
443   </tbody>
444 </table>
445 
446 <table width=100% border=0 cellspacing=0 cellpadding=15>
447 <tr><td><table width=100% border=0 cellspacing=0 cellpadding=0>
448         <tr><td class="OraHeader"><font face="Arial, Helvetica, sans-serif" size="5" color="#336699">Create/Find Survey Response</font></td></tr>
449         <tr bgcolor="#CCCC99"><td height=1><img src=/OA_MEDIA/bisspace.gif width=1 height=1></td></tr>
450         <tr><td><font face="Arial, Helvetica, sans-serif" size="2">Enter the criteria to either find a survey response or to create a new one.</font></td></tr>
451         </table>
452 </td></tr>
453 </table>
454 
455   ');
456 
457   htp.p('<table width=100% bgcolor=#FFFFFF cellpadding=1 cellspacing=0 border=0>');
458 
459   SetAttributeTable(poa_cm_custom_measure_code=>poa_cm_custom_measure_code,
460                     poa_cm_custom_measure=>poa_cm_custom_measure,
461                     poa_cm_period_type=>poa_cm_period_type,
462                     poa_cm_user_period_type=>poa_cm_user_period_type,
463                     poa_cm_period_name=>poa_cm_period_name,
464                     poa_cm_supplier_id=>poa_cm_supplier_id,
465                     poa_cm_supplier=>poa_cm_supplier,
466                     poa_cm_supplier_site_id=>poa_cm_supplier_site_id,
467                     poa_cm_supplier_site=>poa_cm_supplier_site,
468                     poa_cm_category_id=>poa_cm_category_id,
469                     poa_cm_commodity=>poa_cm_commodity,
470                     poa_cm_item_id=>poa_cm_item_id,
471                     poa_cm_item=>poa_cm_item,
472                     poa_cm_comments=>poa_cm_comments,
473                     poa_cm_evaluated_by_id=>poa_cm_evaluated_by_id,
474                     poa_cm_evaluated_by=>poa_cm_evaluated_by,
475                     poa_cm_org_id=>l_org_id,
476                     poa_cm_oper_unit_id=>poa_cm_oper_unit_id,
477                     poa_cm_operating_unit=>poa_cm_operating_unit,
478  		    poa_cm_submit_type=>poa_cm_submit_type,
479 		    poa_cm_evaluation_id=>poa_cm_evaluation_id);
480 
481 PrintHeaderPageFields(l_language);
482 
483  PrintBottomButtons(l_language);
484 
485   htp.bodyClose;
486   htp.htmlClose;
487 
488 END header_page;
489 
490 PROCEDURE PrintCSS IS
491 BEGIN
492 
493   htp.p('<STYLE TYPE="text/css">');
494   htp.p('<!--');
495   htp.p('font.pagetitle');
496   htp.p('                   {font-family: Arial, sans-serif;');
497   htp.p('                    font-style: italic;');
498   htp.p('                    font-weight: bold;');
499   htp.p('                    color: black;');
500   htp.p('                    font-size: 14pt;}');
501   htp.p('font.itemtitle');
502   htp.p('                   {font-family: Arial, sans-serif;');
503   htp.p('                    font-weight: bold;');
504   htp.p('                    color: white;');
505   htp.p('                    font-size: 14pt;}');
506   htp.p('font.bartitle');
507   htp.p('                   {font-family: Arial, sans-serif;');
511   htp.p('font.containertitle');
508   htp.p('                    color: black;');
509   htp.p('                    font-weight: bold;');
510   htp.p('                    font-size: 8pt;}');
512   htp.p('                   {font-family: Arial, sans-serif;');
513   htp.p('                    font-style: italic;');
514   htp.p('                    font-weight: bold;');
515   htp.p('                    color: #cccccc;');
516   htp.p('                    font-size: 14pt;}');
517   htp.p('font.graytab');
518   htp.p('                   {font-family: Arial, sans-serif;');
519   htp.p('                    color: black;');
520   htp.p('                    text-decoration: none;');
521   htp.p('                    font-size: 10pt;}');
522   htp.p('font.purpletab');
523   htp.p('                   {font-family: Arial, sans-serif;');
524   htp.p('                    color: white;');
525   htp.p('                    text-decoration: none;');
526   htp.p('                    font-size: 10pt;}');
527   htp.p('font.promptblack');
528   htp.p('                   {font-family: Arial, sans-serif;');
529   htp.p('                    color: black;');
530   htp.p('                    text-decoration: none;');
531   htp.p('                    font-size: 10pt;}');
532   htp.p('font.helptext');
533   htp.p('                   {font-family: Arial, sans-serif;');
534   htp.p('                    font-style: italic;');
535   htp.p('                    color: black;');
536   htp.p('                    font-size: 10pt;}');
537   htp.p('font.helptitle ');
538   htp.p('                   {font-family: Arial, sans-serif;');
539   htp.p('                    font-style: italic;');
540   htp.p('                    font-weight: bold;');
541   htp.p('                    color: black;');
542   htp.p('                    font-size: 14pt;}');
543   htp.p('font.promptwhite');
544   htp.p('                   {font-family: sans-serif;');
545   htp.p('                    font-face: arial;');
546   htp.p('                    color: white;');
547   htp.p('                    font-size: 10pt;}');
548   htp.p('font.datablack');
549   htp.p('                   {font-family: Arial, sans-serif;');
550   htp.p('                    font-weight: bold;');
551   htp.p('                    color: black;');
552   htp.p('                    font-size: 10pt;}');
553   htp.p('font.fielddata ');
554   htp.p('                   {font-family: Arial, sans-serif;');
555   htp.p('                    font-weight: bold;');
556   htp.p('                    color: black;');
557   htp.p('                    font-size: 10pt;}');
558   htp.p('font.tablefielddata ');
559   htp.p('                   {font-family: "arial narrow", sans-serif;');
560   htp.p('                    font-weight: bold;');
561   htp.p('                    color: black;');
562   htp.p('                    font-size: 10pt;}');
563   htp.p('font.tabledata ');
564   htp.p('                   {font-family: Arial, sans-serif;');
565   htp.p('                    color: black;');
566   htp.p('                    font-size: 10pt;}');
567   htp.p('font.button');
568   htp.p('                   {font-family: Arial, sans-serif;');
569   htp.p('                    color: black;');
570   htp.p('                    text-decoration: none;');
571   htp.p('                    font-size: 10pt;}');
572   htp.p('font.link');
573   htp.p('                   {font-family: Arial, sans-serif;');
574   htp.p('                    color: blue;');
575   htp.p('                    text-decoration: underline;');
576   htp.p('                    font-size: 10pt;}');
577   htp.p('font.linkbold');
578   htp.p('                   {font-family: Arial, sans-serif;');
579   htp.p('                    font-weight: bold;');
580   htp.p('                    color: blue;');
581   htp.p('                    text-decoration: underline;');
582   htp.p('                    font-size: 10pt;}');
583   htp.p('font.dropdownmenu');
584   htp.p('                   {font-family: Arial, sans-serif;');
585   htp.p('                    color: #003366;');
586   htp.p('                    font-style: italic;');
587   htp.p('                    font-size: 16pt;}');
588   htp.p('-->');
589   htp.p('</STYLE>');
590 
591 END PrintCSS;
592 
593 PROCEDURE SetAttributeTable(poa_cm_custom_measure_code IN VARCHAR2,
594                             poa_cm_custom_measure      IN VARCHAR2,
595                             poa_cm_period_type         IN VARCHAR2,
596                             poa_cm_user_period_type    IN VARCHAR2,
597                             poa_cm_period_name         IN VARCHAR2,
598                             poa_cm_supplier_id         IN VARCHAR2,
599                             poa_cm_supplier            IN VARCHAR2,
600                             poa_cm_supplier_site_id    IN VARCHAR2,
601                             poa_cm_supplier_site       IN VARCHAR2,
602                             poa_cm_category_id         IN VARCHAR2,
603                             poa_cm_commodity           IN VARCHAR2,
604                             poa_cm_item_id             IN VARCHAR2,
605                             poa_cm_item                IN VARCHAR2,
606                             poa_cm_comments            IN VARCHAR2,
607                             poa_cm_evaluated_by_id     IN VARCHAR2,
608                             poa_cm_evaluated_by        IN VARCHAR2,
609                             poa_cm_org_id              IN VARCHAR2,
610                             poa_cm_oper_unit_id        IN VARCHAR2,
614 ) IS
611                             poa_cm_operating_unit      IN VARCHAR2,
612 			    poa_cm_submit_type	       IN VARCHAR2,
613 			    poa_cm_evaluation_id       IN VARCHAR2
615 
616 BEGIN
617   IF (g_attribute_table.COUNT > 0) THEN
618     g_attribute_table.DELETE;
619   END IF;
620   g_attribute_table(1).attribute_name := 'POA_CM_CUSTOM_MEASURE_CODE';
621   g_attribute_table(1).attribute_value := poa_cm_custom_measure_code;
622   g_attribute_table(2).attribute_name := 'POA_CM_CUSTOM_MEASURE';
623   g_attribute_table(2).attribute_value := poa_cm_custom_measure;
624   g_attribute_table(3).attribute_name := 'POA_CM_PERIOD_TYPE';
625   g_attribute_table(3).attribute_value := poa_cm_period_type;
626   g_attribute_table(4).attribute_name := 'POA_CM_USER_PERIOD_TYPE';
627   g_attribute_table(4).attribute_value := poa_cm_user_period_type;
628   g_attribute_table(5).attribute_name := 'POA_CM_PERIOD_NAME';
629   g_attribute_table(5).attribute_value := poa_cm_period_name;
630   g_attribute_table(6).attribute_name := 'POA_CM_SUPPLIER_ID';
631   g_attribute_table(6).attribute_value := poa_cm_supplier_id;
632   g_attribute_table(7).attribute_name := 'POA_CM_SUPPLIER';
633   g_attribute_table(7).attribute_value := poa_cm_supplier;
634   g_attribute_table(8).attribute_name := 'POA_CM_SUPPLIER_SITE_ID';
635   g_attribute_table(8).attribute_value := poa_cm_supplier_site_id;
636   g_attribute_table(9).attribute_name := 'POA_CM_SUPPLIER_SITE';
637   g_attribute_table(9).attribute_value := poa_cm_supplier_site;
638   g_attribute_table(10).attribute_name := 'POA_CM_ORG_ID';
639   g_attribute_table(10).attribute_value := poa_cm_org_id;
640   g_attribute_table(11).attribute_name := 'POA_CM_OPER_UNIT_ID';
641   g_attribute_table(11).attribute_value := poa_cm_oper_unit_id;
642   g_attribute_table(12).attribute_name := 'POA_CM_OPERATING_UNIT';
643   g_attribute_table(12).attribute_value := poa_cm_operating_unit;
644   g_attribute_table(13).attribute_name := 'POA_CM_CATEGORY_ID';
645   g_attribute_table(13).attribute_value := poa_cm_category_id;
646   g_attribute_table(14).attribute_name := 'POA_CM_COMMODITY';
647   g_attribute_table(14).attribute_value := poa_cm_commodity;
648   g_attribute_table(15).attribute_name := 'POA_CM_ITEM_ID';
649   g_attribute_table(15).attribute_value := poa_cm_item_id;
650   g_attribute_table(16).attribute_name := 'POA_CM_ITEM';
651   g_attribute_table(16).attribute_value := poa_cm_item;
652   g_attribute_table(17).attribute_name := 'POA_CM_COMMENTS';
653   g_attribute_table(17).attribute_value := poa_cm_comments;
654   g_attribute_table(18).attribute_name := 'POA_CM_EVALUATED_BY_ID';
655   g_attribute_table(18).attribute_value := poa_cm_evaluated_by_id;
656   g_attribute_table(19).attribute_name := 'POA_CM_EVALUATED_BY';
657   g_attribute_table(19).attribute_value := poa_cm_evaluated_by;
658   g_attribute_table(20).attribute_name := 'POA_CM_SUBMIT_TYPE';
659   g_attribute_table(20).attribute_value := poa_cm_submit_type;
660   g_attribute_table(21).attribute_name := 'POA_CM_EVALUATION_ID';
661   g_attribute_table(21).attribute_value := poa_cm_evaluation_id;
662 END SetAttributeTable;
663 
664 FUNCTION GetAttributeValue(p_attribute_name  IN VARCHAR2,
665                            p_start_index     IN NUMBER) RETURN VARCHAR2 IS
666   l_start_index NUMBER;
667   l_index NUMBER;
668   l_wrapped BOOLEAN;
669 BEGIN
670   IF (p_attribute_name IS NULL OR g_attribute_table.COUNT <= 0) THEN
671     RETURN NULL;
672   END IF;
673   l_start_index := NVL(p_start_index, g_attribute_table.FIRST);
674   IF (g_attribute_table.EXISTS(p_start_index) AND
675       g_attribute_table(p_start_index).attribute_name = p_attribute_name) THEN
676     RETURN g_attribute_table(p_start_index).attribute_value;
677   END IF;
678   l_index := g_attribute_table.NEXT(p_start_index);
679   l_wrapped := FALSE;
680   WHILE (l_index IS NOT NULL AND NOT (l_wrapped AND l_index >= p_start_index)) LOOP
681     IF (g_attribute_table(l_index).attribute_name = p_attribute_name) THEN
682       RETURN g_attribute_table(p_start_index).attribute_value;
683     END IF;
684 
685     l_index := g_attribute_table.NEXT(l_index);
686     IF (l_index IS NULL) THEN
687       l_index := g_attribute_table.FIRST;
688       l_wrapped := TRUE;
689     END IF;
690   END LOOP;
691 
692   RETURN NULL;
693 
694 END GetAttributeValue;
695 
696 
697 PROCEDURE PrintHeaderPageFields(p_language IN VARCHAR2) IS
698   l_index NUMBER;
699   l_count NUMBER;
700   l_where_clause VARCHAR2(240) := null;
701   temp    VARCHAR2(30);
702 BEGIN
703   ak_query_pkg.exec_query(p_parent_region_appl_id=>201,
704                           p_parent_region_code=>'POA_CM_EVALUATION_R',
705                           p_responsibility_id=>icx_sec.getID(icx_sec.PV_RESPONSIBILITY_ID),
706                           p_user_id=>icx_sec.getID(icx_sec.PV_WEB_USER_ID),
707                           p_return_parents=>'F',
708                           p_return_children=>'F');
709 
710   l_count := 0;
711   l_index := ak_query_pkg.g_items_table.FIRST;
712   WHILE (l_index IS NOT NULL) LOOP
713     l_count := l_count + 1;
714     IF (ak_query_pkg.g_items_table(l_index).node_display_flag = 'Y') AND
715        (ak_query_pkg.g_items_table(l_index).secured_column = 'F') THEN
716       IF (ak_query_pkg.g_items_table(l_index).item_style = 'HIDDEN') THEN
717         htp.p('<INPUT NAME="'||
718               ak_query_pkg.g_items_table(l_index).attribute_code||
719               '" TYPE="hidden" VALUE="'||
723       ELSIF (ak_query_pkg.g_items_table(l_index).item_style = 'TEXT') THEN
720               GetAttributeValue(p_attribute_name=>ak_query_pkg.g_items_table(l_index).attribute_code,
721                                 p_start_index=>l_count)||
722               '">');
724         htp.p('<TR>');
725         htp.p('<TD VALIGN=CENTER ALIGN=RIGHT WIDTH=30%BGCOLOR=#FFFFFF>'||
726               '<FONT CLASS=promptblack>'||
727               ak_query_pkg.g_items_table(l_index).attribute_label_long||
728               '</FONT> </TD>');
729         htp.p('<TD VALIGN=MIDDLE ALIGN=LEFT WIDTH=70%BGCOLOR=#FFFFFF>'||
730               '<FONT CLASS=datablack>');
731         htp.p('<INPUT NAME="'||ak_query_pkg.g_items_table(l_index).attribute_code||'" TYPE="text"' ||
732               ' onChange="javascript:reset_hidden(''' || ak_query_pkg.g_items_table(l_index).attribute_code || ''')"' ||
733               ' onFocus="javascript:check_read_only(''' || ak_query_pkg.g_items_table(l_index).attribute_code || ''')"' ||
734               ' VALUE="'|| GetAttributeValue(p_attribute_name=>ak_query_pkg.g_items_table(l_index).attribute_code,
735                                             p_start_index=>l_count)||
736               '" SIZE='||ak_query_pkg.g_items_table(l_index).display_value_length||' MAXLENGTH='||ak_query_pkg.g_items_table(l_index).attribute_value_length||'></FONT> ');
737 
738         IF (ak_query_pkg.g_items_table(l_index).lov_region_code IS NOT NULL AND
739             ak_query_pkg.g_items_table(l_index).lov_attribute_code IS NOT NULL) THEN
740             htp.p('<A HREF="javascript:call_LOV('''|| ak_query_pkg.g_items_table(l_index).attribute_code || ''')"' ||
741 --            ' onMouseOver="window.status=''List of Values'';return true"' ||
742             '><IMG SRC="/OA_MEDIA/FNDILOV.gif" BORDER=0 align=absmiddle></A></TD>');
743 
744         END IF;
745 
746         htp.p('</TD>');
747         htp.p('<TD BGCOLOR=#FFFFFF> </TD>');
748         htp.p('</TR>');
749 
750       ELSE
751 
752         htp.p('<!-- '||ak_query_pkg.g_items_table(l_index).attribute_code||
753               ' - '||ak_query_pkg.g_items_table(l_index).item_style||' -->');
754 
755       END IF;
756 
757     END IF;
758 
759     l_index := ak_query_pkg.g_items_table.NEXT(l_index);
760 
761   END LOOP;
762 
763 htp.p('</TABLE>');
764 
765 END PrintHeaderPageFields;
766 
767 PROCEDURE PrintBottomButtons(p_language IN VARCHAR2) IS
768 BEGIN
769 
770 htp.p('
771 <table width=100% border=0 cellspacing=0 cellpadding=15>
772   <tr>
773     <td>
774       <table width=100% border=0 cellspacing=0 cellpadding=0>
775         <tr>
776           <td width=604> </td>
777           <td rowspan=2 valign=bottom width=12><img src=/OA_MEDIA/bisslghr.gif width=12
778 height=14></td>
779         </tr>
780         <tr>
781           <td bgcolor=#CCCC99 height=1><img src=/OA_MEDIA/bisspace.gif width=1 height=1></td>
782         </tr>
783         <tr>
784           <td height=5><img src=/OA_MEDIA/bisspace.gif width=1 height=1></td>
785         </tr>
786 
787         <tr>
788           <td align="right">   <span class="OraALinkText"><span class="OraALinkText">
789            <A href=OracleNavigate.Responsibility onMouseOver="window.status=''Cancel'';return true"><img src=/OA_MEDIA/poacancl.gif border="0"></a>   
790 	   <A href="javascript:submitDoc(''Update'')" onMouseOver="window.status=''Find Survey'';return true"><img src=/OA_MEDIA/poafind.gif border="0"></a>   
791            <A href="javascript:submitDoc(''Next'')" onMouseOver="window.status=''New Survey'';return true"><img src=/OA_MEDIA/poanew.gif border="0"></a>
792            </span></span></td>
793         </tr>
794 
795       </table>
796       </td>
797           </tr>
798         </table>
799 ');
800 
801 
802 END PrintBottomButtons;
803 
804 
805 END poa_cm_evaluation_icx;