Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5356 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|			          Bom_Comparison			 	 |
6
'|                                                   |
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
Response.Expires = 0
12
%>
13
<!--#include file="common/globals.asp"-->
14
<!--#include file="common/config.asp"-->
15
<!--#include file="common/common_subs.asp"-->
16
<!--#include file="common/_bom_common.asp"-->
17
<!--#include file="controls/ERGFormComponent/classFormComponent.asp"-->
18
<%
19
'------------ ACCESS CONTROL ------------------
20
%>
21
<!--#include file="_access_control_general.asp"-->
22
<%
23
'------------ VARIABLE DEFINITION -------------
24
Dim rsQry, rsTemp
25
Dim aProductList
26
Dim parProd_id_select
27
Dim parShowall
28
Dim numOfRows
29
Dim rowNum
30
Dim objFormCollector
31
Dim objFormComponent
32
Dim sMessage
33
Dim ProdId
34
Dim ChangeType
35
Dim PkgVersion, CurrentPkgVersion, IsDisplay, Comments
36
Dim PkgId, OldProdId, OsId
37
'------------ CONSTANTS DECLARATION -----------
38
Const LIMG_UPDATED = "<img src='icons/i_updated.gif' width='11' height='11' hspace='2' vspace='2' border='0' align='absmiddle' title='Updated'>"
39
Const LIMG_ADDED = "<img src='icons/i_added.gif' width='11' height='11' border='0' hspace='2' vspace='2' align='absmiddle' title='Added'>"
40
Const LIMG_REMOVED = "<img src='icons/i_removed.gif' width='11' height='11' border='0' hspace='2' vspace='2' align='absmiddle' title='Removed'>"
41
Const LIMG_NOTE_NEW = "<img src='icons/i_note_new.gif' width='18' height='18' border='0' align='absmiddle'>"
42
Const LIMG_NOTE_EDIT = "<img src='icons/i_note_edit.gif' width='18' height='18' border='0' align='absmiddle'>"
43
'------------ VARIABLE INIT -------------------
44
parProd_id_select = Request("prod_id_select")
45
parShowall = Request("showall")
46
Set objFormCollector = CreateObject("Scripting.Dictionary")
47
Set objFormComponent = New FormComponent
48
'------------ CONDITIONS ----------------------
49
'----------------------------------------------
50
%>
51
<%
52
'--------------------------------------------------------------------------------------------------------------------------
53
Function AddTrailingZeros(byval n, byval count)
54
	if len(n) >= count then
55
		AddTrailingZeros = n
56
		exit function
57
	end if
58
 
59
	dim c, s, i
60
	c = count - len(n)
61
 
62
	for i = 1 to c
63
		s = s & "0"
64
	next
65
	s = cstr(n) & s
66
 
67
	AddTrailingZeros = s
68
End function
69
'--------------------------------------------------------------------------------------------------------------
70
Sub GetProductList ( nBom_id, nComparedBomId, outProductList, Flag )
71
	Dim rsQry, query, showAll
72
 
73
	'' Use SHOWALL parameter is BOM has old bom
74
	'showAll = "Y"
75
	'If nBom_id <> nComparedBomId Then
76
	'	showAll = parShowall
77
	'End If
78
 
79
 
80
	OraDatabase.Parameters.Add "BOM_ID", 	 	 nBom_id,		 ORAPARM_INPUT, ORATYPE_NUMBER 
81
	OraDatabase.Parameters.Add "COMPARE_BOM_ID", nComparedBomId, ORAPARM_INPUT, ORATYPE_NUMBER 
82
	If Flag = "Less" Then
83
		Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("OrigBomCompare.sql"), ORADYN_DEFAULT )
84
	Else
85
		Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("SameProducts.sql"), ORADYN_DEFAULT )
86
	End If
87
	If rsQry.RecordCount > 0 Then
88
		outProductList = rsQry.GetRows()
89
	Else
90
		outProductList = NULL
91
	End If
92
 
93
 
94
	OraDatabase.Parameters.Remove "COMPARE_BOM_ID"
95
	OraDatabase.Parameters.Remove "BOM_ID"
96
End Sub
97
'--------------------------------------------------------------------------------------------------------------------------
98
Sub GetFormDetails ( nBom_id, ByRef outobjDetails )
99
 
100
	Call GetBomDetails ( nBom_id, outobjDetails )
101
 
102
	outobjDetails.Item("root_version") = GetRootVersion ( outobjDetails.Item("bom_version") )
103
 
104
	'-- Set compare_bom_id 
105
	If Request("compare_bom_id") <> "" Then
106
		outobjDetails.Item("compare_bom_id") =  Request("compare_bom_id")
107
	Else
108
		Dim rsQry, query, GetBomTree
109
 
110
		OraDatabase.Parameters.Add "BRANCH_ID", 	objFormCollector.Item("rtag_id_fk"),	ORAPARM_INPUT, ORATYPE_NUMBER 
111
		OraDatabase.Parameters.Add "COMPARE_BOM_ID", 	Request("bom_id"),	ORAPARM_INPUT, ORATYPE_NUMBER 
112
 
113
		Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("ProductionTreeCombo_Selected.sql"), ORADYN_DEFAULT )
114
 
115
		If rsQry.RecordCount > 0 Then
116
		'While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
117
			'If IsEmpty(GetBomTreeListMax) Then 
118
			GetBomTree = rsQry("bom_id")
119
 
120
			'rsQry.MoveNext
121
		'Wend
122
 
123
		Else
124
			GetBomTree = NULL
125
 
126
		End If
127
 
128
 
129
		OraDatabase.Parameters.Remove "BRANCH_ID"
130
		OraDatabase.Parameters.Remove "COMPARE_BOM_ID"
131
 
132
 
133
		rsQry.Close
134
		Set rsQry = Nothing
135
 
136
		outobjDetails.Item("compare_bom_id") = GetBomTree
137
	End If
138
 
139
End Sub
140
'--------------------------------------------------------------------------------------------------------------
141
Sub GetBomTreeListMax
142
	Dim rsQry, query, GetBomTree
143
 
144
	OraDatabase.Parameters.Add "BRANCH_ID", 	objFormCollector.Item("rtag_id_fk"),	ORAPARM_INPUT, ORATYPE_NUMBER 
145
	OraDatabase.Parameters.Add "COMPARE_BOM_ID", 	Request("bom_id"),	ORAPARM_INPUT, ORATYPE_NUMBER 
146
 
147
	Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("ProductionTreeCombo_Selected.sql"), ORADYN_DEFAULT )
148
 
149
	If rsQry.RecordCount > 0 Then
150
		'While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
151
			'If IsEmpty(GetBomTreeListMax) Then 
152
		GetBomTree = rsQry("bom_id")
153
 
154
			'rsQry.MoveNext
155
		'Wend
156
 
157
	Else
158
		GetBomTree = NULL
159
 
160
	End If
161
 
162
 
163
	OraDatabase.Parameters.Remove "BRANCH_ID"
164
	OraDatabase.Parameters.Remove "COMPARE_BOM_ID"
165
 
166
 
167
	rsQry.Close
168
	Set rsQry = Nothing
169
End Sub
170
'--------------------------------------------------------------------------------------------------------------
171
Function GetBomTreeList ()
172
	Dim rsQry, query
173
 
174
	OraDatabase.Parameters.Add "BRANCH_ID", 	objFormCollector.Item("rtag_id_fk"),	ORAPARM_INPUT, ORATYPE_NUMBER 
175
	OraDatabase.Parameters.Add "COMPARE_BOM_ID", 	Request("compare_bom_id"),	ORAPARM_INPUT, ORATYPE_NUMBER 
176
	Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("ProductionTreeCombo_Selected.sql"), ORADYN_DEFAULT )
177
 
178
	If rsQry.RecordCount > 0 Then
179
		GetBomTreeList = rsQry.GetRows()
180
 
181
	Else
182
		GetBomTreeList = NULL
183
 
184
	End If
185
 
186
 
187
	OraDatabase.Parameters.Remove "BRANCH_ID"
188
	OraDatabase.Parameters.Remove "COMPARE_BOM_ID"
189
 
190
 
191
	rsQry.Close
192
	Set rsQry = Nothing
193
End Function
194
'--------------------------------------------------------------------------------------------------------------
195
Function GetCompareBomDetails ( nBomId )
196
	Dim rsQry, query
197
	OraDatabase.Parameters.Add "BOM_ID", 	nBomId,	ORAPARM_INPUT, ORATYPE_NUMBER 
198
 
199
	Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("BomLocationDetails.sql"), ORADYN_DEFAULT )
200
 
201
	If rsQry.RecordCount > 0 Then
202
		GetCompareBomDetails = rsQry("proj_name") &"&nbsp;/&nbsp;"& rsQry("branch_name") &"&nbsp;/&nbsp;"& rsQry("bom_name") &"&nbsp;"& rsQry("bom_version") &"."& rsQry("bom_lifecycle")
203
 
204
	Else
205
		GetCompareBomDetails = NULL
206
 
207
	End If
208
 
209
	OraDatabase.Parameters.Remove "BOM_ID"
210
 
211
	rsQry.Close
212
	Set rsQry = Nothing
213
End Function
214
'--------------------------------------------------------------------------------------------------------------
215
%>
216
<%
217
'------------ RUN BEFORE PAGE RENDER ----------
218
objPMod.PersistInQryString ( Array("compare_bom_id") )
219
 
220
Call GetFormDetails ( dbPARbom_id, objFormCollector )
221
'----------------------------------------------
222
%>
223
<html>
224
<head>
225
<title>Production Manager</title>
226
<link rel="shortcut icon" href="<%=FavIcon%>"/>
227
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
228
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
229
<link href="scripts/deployment_manager.css" rel="stylesheet" type="text/css">
230
<script language="JavaScript" src="scripts/common.js"></script>
231
<script language="JavaScript" src="scripts/remote_scripting.js"></script>
232
<script language="JavaScript" type="text/javascript">
233
<!--
234
 
235
function RequestProductLocation( paramString, rowId ){
236
	var requestURL;
237
 
238
	// Product is changes, hence can be found in current bom
239
	requestURL = 'RequestBomDiffProductLocation.asp';
240
 
241
 
242
	// Show div
243
	ToggleDisplay( 'PRODUCT_'+ rowId, 'IMG_EXPAND_PRODUCT_' + rowId, 'IMG_COLLAPSE_PRODUCT_' + rowId );
244
 
245
	// Set ajax divname
246
	ajaxdivname = 'PRODUCT_'+ rowId;
247
 
248
	if ( MM_findObj( ajaxdivname ).innerHTML == '<%=enumLOADING%>') 
249
	{
250
 
251
		//Append the name to search for to the requestURL
252
		var url = requestURL + paramString;
253
 
254
		//Create the xmlHttp object to use in the request
255
		//stateChangeHandler will fire when the state has changed, i.e. data is received back
256
		// This is non-blocking (asynchronous)
257
		xmlHttp = GetXmlHttpObject(stateChangeHandler);
258
 
259
		//Send the xmlHttp get to the specified url
260
		xmlHttp_Get(xmlHttp, url);
261
 
262
	}
263
 
264
 
265
}
266
 
267
function MM_findObj(n, d) { //v4.0
268
  var p,i,x;
269
  if(!d) d=document; 
270
  if((p=n.indexOf("?"))>0&&parent.frames.length) {
271
  	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
272
  }
273
  if(!(x=d[n])&&d.all) x=d.all[n]; 
274
  for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
275
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
276
  if(!x && document.getElementById) x=document.getElementById(n); 
277
  return x;
278
}
279
 
280
function DisplaySPAN(show, x) {
281
	if (show) {
282
		MM_findObj("spanHideDetails" + x).style.display = "block";
283
		MM_findObj("spanPkgInfo" + x).style.display = "block";
284
		MM_findObj("spanShowDetails" + x).style.display = "none";
285
	} else {
286
		MM_findObj("spanHideDetails" + x).style.display = "none";
287
		MM_findObj("spanPkgInfo" + x).style.display = "none";
288
		MM_findObj("spanShowDetails" + x).style.display = "block";
289
	}
290
}
291
 
292
 
293
 
294
//-->
295
</script>
296
 
297
 
298
 
299
 
300
</head>
301
 
302
<body leftmargin="0" topmargin="0">
303
<!-- HEADER ++++++++++++++++ -->
304
<!--#include file="_header.asp"-->
305
<!-- +++++++++++++++++++++++ -->
306
<!-- MAIN MENU  +  CRUMBS ++++++++++++++++ -->
307
<!--#include file="_main_menu.asp"-->
308
<!-- +++++++++++++++++++++++++++++++++++++ -->
309
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
310
  <tr>
311
    <td width="1%" valign="top" background="images/bg_bage_0.gif">
312
	<!-- NODE BROWSER ++++++++++++++++++++++ -->
313
	<!--#include file="_bom_browser.asp"-->
314
	<!-- END OF NODE BROWSER +++++++++++++++ -->
315
	</td>
316
    <td width="1" background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="600"></td>
317
    <td width="100%" valign="top" bgcolor="#FFFFFF">
318
	<table width="100%"  border="0" cellspacing="0" cellpadding="0">
319
	  <tr>
320
        <td valign="top" background="images/bg_green.gif"></td>
321
        <td align="right" valign="bottom" background="images/bg_green.gif" class="body_txtw"><%Call RenderTitleWithoutVersion( objBomCollector )%></td>
322
        <td background="images/bg_green.gif"><img src="images/spacer.gif" width="10" height="20"></td>
323
      </tr>
324
      <tr>
325
        <td width="1%" valign="top" background="images/bg_green.gif"></td>
326
        <td width="100%" valign="bottom" background="images/bg_green.gif">
327
		<!-- TAB CONTROLS ++++++++++++++++++++++ -->
328
		<!--#include file="_tabs_definition.asp"-->
329
		<%
330
		Set objTabControl = New TabControl
331
		objTabControl.TemplateDoc = ReadFile( Server.MapPath("controls/ERGTabStyleWinXP/tab_style.html") ) ' Supply tab style definition
332
		objTabControl.TabStyle = "StyleWinXP"
333
		objTabControl.AddTabDefnition ( arrBomTabDef )
334
		objTabControl.SelectByName("BOM Comparison")
335
		objTabControl.Render ()
336
		%>
337
		<!-- END OF TAB CONTROLS +++++++++++++++ -->
338
		</td>
339
        <td width="1%" background="images/bg_green.gif"><img src="images/spacer.gif" width="10" height="35"></td>
340
        </tr>
341
      <tr>
342
        <td background="images/bg_bage_0.gif"><img src="images/spacer.gif" width="30" height="10"></td>
343
        <td background="images/bg_bage_0.gif">
344
		<!-- BUTTONS CONTROL +++++++++++++++++++ -->
345
 
346
		<!-- +++++++++++++++++++++++++++++++++++ -->
347
		</td>
348
        <td background="images/bg_green.gif"><img src="images/p_bar_corrner.gif" width="17" height="42"></td>
349
        </tr>
350
      <tr>
351
        <td>&nbsp;</td>
352
        <td>&nbsp;</td>
353
        <td valign="top"><%If Request.Cookies( enumCOOKIE_NAME )( "user_bar" ) = "hide" Then%><a href="<%=SCRIPT_NAME%>?user_bar=<%=enumDEFAULT%>&<%=objPMod.ComposeURL()%>"><img src="icons/b_left.gif" title="Maximize favourits" width="13" height="13" vspace="5" border="0"></a><%End If%></td>
354
        </tr>
355
    </table>
356
 
357
<!-- PRODUCT REJECTED ------------------------------------------------------------------------------------------ -->	
358
	<%If objBomCollector.Item ("is_rejected") = enumDB_YES Then%>
359
	<table width="100%"  border="0" cellspacing="10" cellpadding="0">
360
      <tr>
361
        <td>
362
		<%
363
			OraDatabase.Parameters.Add "ENTITY_ID", 		dbPARbom_id,	ORAPARM_INPUT, ORATYPE_NUMBER
364
			OraDatabase.Parameters.Add "ENUM_ENTITY_TYPE", 	"enumENTITY_TYPE_BOM",	ORAPARM_INPUT, ORATYPE_VARCHAR2
365
 
366
			Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("RejectionTrail.sql"), ORADYN_DEFAULT )
367
 
368
 
369
			sMessage = "<table width='100%'  border='0' cellspacing='3' cellpadding='0'>"
370
			sMessage = sMessage &"<tr>"
371
			sMessage = sMessage &"<td width='100%' class='body_txt'><b>BOM is REJECTED!</b><br><br><br></td>"
372
			sMessage = sMessage &"<td width='1%' nowrap valign='bottom' align='right'><a href='javascript:;' onClick=""MM_openBrWindow('wBomRejectNote.asp?rfile="& SCRIPT_NAME &"&"& objPMod.ComposeURL() &"','BomRejectNote','scrollbars=yes,resizable=yes,width=600,height=350');""  class='body_smllink' title='Create new note'>Create Note"& LIMG_NOTE_NEW &"</a></td>"
373
			sMessage = sMessage &"</tr>"
374
 
375
			While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
376
				sMessage = sMessage & "<tr><td colspan='2' background='images/bg_table_border.gif'><img src='images/spacer.gif' width='1' height='1'></td></tr>"
377
				sMessage = sMessage &"<tr>"
378
				sMessage = sMessage &"<td class='body_txt'>"
379
				If rsQry("is_rejected") = enumDB_YES Then
380
					sMessage = sMessage &"BOM is REJECTED!<br>"
381
				Else
382
					sMessage = sMessage &"BOM is Accepted!<br>"
383
				End If
384
				sMessage = sMessage & objFormater.TextToHTML( rsQry("comments") ) &"<br><SPAN class='body_smltxtg'>"& rsQry("creator") &"</SPAN></td>"
385
				sMessage = sMessage &"<td nowrap valign='bottom' align='right'><a href='javascript:;' onClick=""MM_openBrWindow('wBomRejectNote.asp?reject_seq="& rsQry("reject_seq") &"&rfile="& SCRIPT_NAME &"&"& objPMod.ComposeURL() &"','BomRejectNote','scrollbars=yes,resizable=yes,width=600,height=350');"" class='body_smllink' title='Edit note'>Edit Note"& LIMG_NOTE_EDIT &"</a></td>"
386
				sMessage = sMessage &"</tr>"
387
 
388
				rsQry.MoveNext
389
			WEnd
390
			rsQry.Close
391
 
392
			sMessage = sMessage &"</table>"
393
 
394
			Call Messenger ( sMessage, "bi_rejected.gif", "100%" )
395
 
396
			Response.write "<br>"
397
 
398
 
399
			OraDatabase.Parameters.Remove "ENTITY_ID"
400
			OraDatabase.Parameters.Remove "ENUM_ENTITY_TYPE"
401
		%>
402
 
403
		</td>
404
        </tr>
405
    </table>
406
	<%End If%>	
407
<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->	
408
 
409
 
410
	<table width="100%"  border="0" cellspacing="10" cellpadding="0">
411
 
412
	  <tr>
413
        <td width="1"><img src="images/spacer.gif" width="1" height="1"></td>
414
        <td width="100%"><img src="images/spacer.gif" width="1" height="1"></td>
415
      </tr>
416
 
417
	  <!-- BOM Comments +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
418
	  <%If (objBomCollector.Item("bom_comments") <> "") Then%>
419
      <tr>
420
        <td align="right" valign="top"><img src="icons/i_bom_properties.gif" width="30" height="30" hspace="3"></td>
421
        <td valign="top" class="body_txt">
422
 
423
 
424
			<SPAN class="body_colb">BOM Comments</SPAN>
425
			<hr width="100%" size="1px" noshade color="#808080">
426
			<SPAN class="body_txt"><%= objFormater.TextToHTML( objBomCollector.Item("bom_comments") )%></SPAN><br><br><br><br>
427
        </td>
428
      </tr>
429
	  <%End If%>
430
 
431
 
432
	  <!-- COMPARE BOM +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
433
      <tr>
434
        <td align="right" valign="top"><img src="icons/i_bom_diff.gif" width="37" height="33" hspace="3"></td>
435
        <td valign="top" class="body_txt">
436
 
437
		<%
438
		'-- FROM START --------------------------------------------------------------------------------------------------------------
439
		objFormComponent.FormName = "OldVersion"
440
		objFormComponent.Action = SCRIPT_NAME
441
		objFormComponent.Method = "get"
442
		Call objFormComponent.FormStart()
443
		%> 	
444
		<SPAN class="body_colb"><%Call RenderTitle( objBomCollector )%><br>compared with <%= GetCompareBomDetails( objFormCollector.Item("compare_bom_id") ) %></SPAN><br>
445
            <hr width="100%" size="1px" noshade color="#808080"><br>
446
 
447
		<SPAN class="body_txt">Show changes since BOM version&nbsp;</SPAN>
448
		<%=objFormComponent.Combo ( "compare_bom_id", GetBomTreeList(), False, "class='form_ivalue'" )%>
449
		<%=objPMod.ComposeHiddenTagsWithout("compare_bom_id")%>
450
		<%=objFormComponent.SubmitButton ( "Compare", "class='form_btn'" )%><br><br>
451
 
452
		<SPAN class="body_txtr"><b>Products/Patches Existing in <%= GetCompareBomDetails( objFormCollector.Item("compare_bom_id") ) %> but not yet deployed in Production BOM</b></SPAN><br>
453
		<SPAN id="spanShowDetails1" name="spanShowDetails" class="body_rowlite"><a href="javascript:;" class="body_rowlite" onClick="DisplaySPAN(true,'1');"><b>Display...</b></a><br><br></SPAN>
454
		<SPAN id="spanHideDetails1" name="spanHideDetails" style="display:none;"><a href="javascript:;" class="body_rowlite" onClick="DisplaySPAN(false,'1');"><b>Hide...</b></a><br><br></SPAN>
455
 
456
 
457
 
458
		<SPAN id="spanPkgInfo1" name="spanPkgInfo" style="display:none;">
459
		<table width="100%"  border="0" cellspacing="2" cellpadding="0">
460
          <tr>
461
 
462
		  	<td width="20%" background="images/bg_table_border.gif"><table width="100%"  border="0" cellspacing="1" cellpadding="2">
463
              <tr>
464
                <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Product</td>
465
              </tr>
466
            </table></td>
467
			<td width="20%" nowrap align="left" background="images/bg_table_col.gif" class="body_col">Version</td>
468
			<td width="60%" nowrap align="left" background="images/bg_table_col.gif" class="body_col">Comments</td>
469
			<td width="60%" nowrap align="left" background="images/bg_table_col.gif" class="body_col">Approval</td>
470
          </tr>
471
		  <%
472
		  Call GetProductList ( dbPARbom_id, objFormCollector.Item("compare_bom_id"), aProductList, "Less" )
473
 
474
		  If NOT IsNull( aProductList ) Then
475
		  	numOfRows = UBound( aProductList, 2 )
476
 
477
			For rowNum = 0 To numOfRows
478
 
479
				ProdId = aProductList( 0, rowNum )
480
				ChangeType = aProductList( 3, rowNum )
481
				PkgVersion = aProductList( 2, rowNum )
482
				PkgId = aProductList( 6, rowNum )
483
			If	ChangeType	=	"A"	or	ChangeType	=	"U"	Then	
484
 
485
 
486
				OraDatabase.Parameters.Add "PRODUCTION_BOM", dbPARbom_id, ORAPARM_INPUT, ORATYPE_NUMBER
487
				OraDatabase.Parameters.Add "PKG_ID", PkgId, ORAPARM_INPUT, ORATYPE_NUMBER
488
 
489
				Set rsQry = OraDatabase.DbCreateDynaset(GetQuery("ProdVersion.sql"), ORADYN_DEFAULT)
490
 
491
				OldProdId = rsQry("prod_id")
492
				CurrentPkgVersion = rsQry("pkg_version")
493
				Comments = rsQry("comments")
494
 
495
				OraDatabase.Parameters.Remove "PRODUCTION_BOM"
496
				OraDatabase.Parameters.Remove "PKG_ID"	
497
				IsDisplay = True
498
 
499
				Dim MajorA, MajorB, MinorA, MinorB, PatchA, PatchB, pos
500
						MajorA = NULL
501
						MajorB = NULL
502
						MinorA = NULL
503
						MinorB = NULL
504
						PatchA = NULL
505
						PatchB = NULL
506
 
507
				' Find the first occurence of the dot in package version A
508
						pos = InStr(PkgVersion, ".")
509
						If pos <> 0 Then
510
							' Extract the Major Version for A
511
							MajorA = Mid(PkgVersion, 1, pos - 1)
512
							' Delete the Major Version Value from the string to get the minor and patch version
513
							PkgVersion = Mid(PkgVersion, pos + 1, Len(PkgVersion))
514
							' Find the second occurence of the dot in package version A
515
							pos = InStr(PkgVersion, ".")
516
							' Extract the Minor Version for A
517
							If pos <> 0 Then
518
								MinorA = Mid(PkgVersion, 1, pos - 1)
519
								' Delete the Minor Version value from the string to get the patch version
520
								PkgVersion = Mid(PkgVersion, pos + 1, Len(PkgVersion))
521
								' Find the last occurence of the dot in package version A
522
								pos = InStr(PkgVersion, ".")
523
								If pos <> 0 Then
524
									' Extract the Patch Version for A
525
									PatchA = Mid(PkgVersion, 1, pos - 1)
526
								End If	
527
							End If	
528
						End If	
529
 
530
						' Find the first occurence of the dot in package version B
531
						pos = InStr(CurrentPkgVersion, ".")
532
						If pos <> 0 Then
533
							' Extract the Major Version for B
534
							MajorB = Mid(CurrentPkgVersion, 1, pos - 1)
535
							' Delete the Major Version Value from the string to get the minor and patch version
536
							CurrentPkgVersion = Mid(CurrentPkgVersion, pos + 1, Len(CurrentPkgVersion))
537
							' Find the second occurence of the dot in package version B
538
							pos = InStr(CurrentPkgVersion, ".")
539
							' Extract the Minor Version for B
540
							If pos <> 0 Then
541
								MinorB = Mid(CurrentPkgVersion, 1, pos - 1)
542
								' Delete the Minor Version value from the string to get the patch version
543
								CurrentPkgVersion = Mid(CurrentPkgVersion, pos + 1, Len(CurrentPkgVersion))
544
								' Find the last occurence of the dot in package version B
545
								pos = InStr(CurrentPkgVersion, ".")
546
									If pos <> 0 Then
547
									' Extract the Patch Version for B
548
									PatchB = Mid(CurrentPkgVersion, 1, pos - 1)
549
								End If
550
							End If
551
						End If
552
 
553
						If NOT isNull(PatchA) AND NOT isNull(PatchB) Then
554
							If len(PatchA) < 4 Then PatchA = AddTrailingZeros(PatchA, 4)
555
							If len(PatchB) < 4 Then PatchB = AddTrailingZeros(PatchB, 4)
556
						End If 
557
 
558
						If MajorA = MajorB Then
559
							If MinorA = MinorB Then
560
								If IsNumeric(PatchA) AND IsNumeric(PatchB) Then
561
 
562
									If CDbl(PatchB) > CDbl(PatchA) Then
563
										IsDisplay = False
564
									Else										
565
										IsDisplay = True
566
									End If
567
								End If
568
							Else
569
								If IsNumeric(MinorA) AND IsNumeric(MinorB) Then
570
									If CInt(MinorB) > CInt(MinorA) Then
571
										IsDisplay = False
572
									Else
573
										IsDisplay = True								
574
									End If									
575
								End If
576
							End If
577
						Else
578
							If IsNumeric(MajorA) AND IsNumeric(MajorB) Then
579
								If 	CInt(MajorB) > CInt(MajorA) Then
580
									IsDisplay = False
581
								Else
582
									IsDisplay = True
583
								End If	
584
							End If
585
						End If		
586
 
587
			If IsDisplay Then							
588
		  %>
589
		  <tr>
590
            <td nowrap valign="top" class="menu_link">
591
			<%
592
 
593
			Set rsTemp = OraDatabase.DbCreateDynaset("SELECT * FROM PACKAGE_VERSIONS PV, PRODUCT_DETAILS PD WHERE PD.PROD_ID(+) = PV.PV_ID AND PV.PV_ID ="&ProdId, ORADYN_DEFAULT )
594
			%>
595
			<%=GetProductIcon( rsTemp ) &  aProductList( 1, rowNum )%>
596
			<%
597
			rsTemp.Close()
598
			Set rsTemp = nothing
599
			%>
600
			</td>
601
            <td nowrap class="body_row" valign="top"><%=aProductList( 2, rowNum )%></td>
602
			<td class="body_rowlite"><%=Comments%></td>
603
<%
604
			Dim rsForm
605
			Set rsForm = OraDatabase.DbCreateDynaset("SELECT * FROM RELEASE_AUTHORISATION WHERE PV_ID="&ProdId&" AND BOM_ID="&Request("bom_id"), ORADYN_DEFAULT)
606
 
607
			%>
608
			<%If rsForm.RecordCount = 0 Then%>
609
 
610
					<td class="body_txtr">Awaiting Approval</td>
611
 
612
			<%ElseIf IsNull(rsForm("is_official")) Then%>
613
 
614
				<%If NOT IsNull(rsForm("tester_id"))Then%>
615
					<td class="body_txto">Tester Approved</td>
616
				<%End If%>
617
			<%Else%>
618
				<td class="body_txtg">Approved</td>
619
			<%End If
620
 
621
			rsForm.Close()
622
			Set rsForm = nothing
623
			%>			
624
          </tr>
625
 
626
		  <tr>
627
			  	<td><img src="images/spacer.gif" width="1" height="1"></td>
628
	            <td nowrap valign="top" class="body_row" colspan="3">
629
				<DIV id="PRODUCT_<%=ProdId & ChangeType%>" name="PRODUCT_<%=ProdId & ChangeType%>" style="display:none;"><%=enumLOADING%></DIV>
630
				</td>
631
	          </tr>
632
 
633
		  <%If rowNum <> numOfRows Then%>
634
		  <tr>
635
            <td colspan="4" background="images/bg_table_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
636
          </tr>
637
		  <%End If%>
638
 
639
		  <%End If%>
640
		  <%
641
			rsQry.Close()
642
			Set rsQry = Nothing
643
			End If
644
 
645
		  	Next
646
		  Else%>
647
 
648
		  <tr>
649
            <td colspan="4" class="body_txt">No Changes Found.</td>
650
          </tr>
651
 
652
		  <%End If%>
653
		  </table>
654
		  <br>
655
		  <br>
656
		 </SPAN>
657
 
658
		<SPAN class="body_txtr"><b>Products/Patches Existing in <%= GetCompareBomDetails( objFormCollector.Item("compare_bom_id") ) %> And Production BOM</b></SPAN><br>		  
659
		<SPAN id="spanShowDetails2" name="spanShowDetails" class="body_rowlite"><a href="javascript:;" class="body_rowlite" onClick="DisplaySPAN(true,'2');"><b>Display...</b></a><br><br></SPAN>
660
		<SPAN id="spanHideDetails2" name="spanHideDetails" style="display:none;"><a href="javascript:;" class="body_rowlite" onClick="DisplaySPAN(false,'2');"><b>Hide...</b></a><br><br></SPAN>  
661
 
662
		<SPAN id="spanPkgInfo2" name="spanPkgInfo" style="display:none;">
663
 
664
		<table width="100%"  border="0" cellspacing="2" cellpadding="0">
665
 
666
          <tr>
667
 
668
		  	<td width="20%" background="images/bg_table_border.gif"><table width="100%"  border="0" cellspacing="1" cellpadding="2">
669
              <tr>
670
                <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Product</td>
671
              </tr>
672
            </table></td>
673
			<td width="20%" nowrap align="left" background="images/bg_table_col.gif" class="body_col">Version</td>
674
			<td width="60%" nowrap align="left" background="images/bg_table_col.gif" class="body_col"></td>
675
          </tr>
676
		  <%
677
		  Call GetProductList ( dbPARbom_id, objFormCollector.Item("compare_bom_id"), aProductList, "Equal" )
678
 
679
		  If NOT IsNull( aProductList ) Then'2
680
		  	numOfRows = UBound( aProductList, 2 )
681
 
682
			For rowNum = 0 To numOfRows
683
 
684
				ProdId = aProductList( 0, rowNum )
685
 
686
				PkgVersion = aProductList( 1, rowNum )
687
				PkgId = aProductList( 2, rowNum )
688
 
689
		  %>
690
		  <tr>
691
            <td nowrap valign="top" class="menu_link">
692
			<%
693
 
694
			Set rsTemp = OraDatabase.DbCreateDynaset("SELECT * FROM PACKAGE_VERSIONS PV, PRODUCT_DETAILS PD WHERE PD.PROD_ID(+) = PV.PV_ID AND PV.PV_ID ="&ProdId, ORADYN_DEFAULT )
695
			%>
696
			<%=GetProductIcon( rsTemp ) &  aProductList( 3, rowNum )%>
697
			<%
698
			rsTemp.Close()
699
			Set rsTemp = nothing
700
			%>
701
			</td>
702
            <td nowrap class="body_row" valign="top"><%=aProductList( 1, rowNum )%></td>
703
			<td class="body_rowlite"></td>
704
          </tr>
705
 
706
		  <tr>
707
			  	<td><img src="images/spacer.gif" width="1" height="1"></td>
708
	            <td nowrap valign="top" class="body_row" colspan="3">
709
				<DIV id="PRODUCT_<%=ProdId & ChangeType%>" name="PRODUCT_<%=ProdId & ChangeType%>" style="display:none;"><%=enumLOADING%></DIV>
710
				</td>
711
	          </tr>
712
 
713
		  <%If rowNum <> numOfRows Then'1%>
714
		  <tr>
715
            <td colspan="4" background="images/bg_table_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
716
          </tr>
717
		  <%End If'1%>
718
 
719
 
720
		  <%
721
 
722
 
723
 
724
		  	Next
725
		  Else%>
726
 
727
		  <tr>
728
            <td colspan="4" class="body_txt">No Changes Found.</td>
729
          </tr>
730
 
731
		  <%End If'2%>
732
		</table>
733
		<br>
734
		<br>
735
		</SPAN>
736
 
737
		<SPAN class="body_txtr"><b>Products/Patches Existing in <%= GetCompareBomDetails( objFormCollector.Item("compare_bom_id") ) %> but Superceeded in Production BOM</b></SPAN><br>		  
738
		<SPAN id="spanShowDetails3" name="spanShowDetails" class="body_rowlite"><a href="javascript:;" class="body_rowlite" onClick="DisplaySPAN(true,'3');"><b>Display...</b></a><br><br></SPAN>
739
		<SPAN id="spanHideDetails3" name="spanHideDetails" style="display:none;"><a href="javascript:;" class="body_rowlite" onClick="DisplaySPAN(false,'3');"><b>Hide...</b></a><br><br></SPAN>  
740
 
741
		<SPAN id="spanPkgInfo3" name="spanPkgInfo" style="display:none;">	 
742
 
743
		<table width="100%"  border="0" cellspacing="2" cellpadding="0">
744
 
745
 
746
          <tr>
747
 
748
		  	<td width="20%" background="images/bg_table_border.gif"><table width="100%"  border="0" cellspacing="1" cellpadding="2">
749
              <tr>
750
                <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Product</td>
751
              </tr>
752
            </table></td>
753
			<td width="20%" nowrap align="left" background="images/bg_table_col.gif" class="body_col">Version</td>
754
			<td width="60%" nowrap align="left" background="images/bg_table_col.gif" class="body_col"></td>
755
          </tr>
756
		  <%
757
		  Call GetProductList ( dbPARbom_id, objFormCollector.Item("compare_bom_id"), aProductList, "Less" )
758
 
759
		  If NOT IsNull( aProductList ) Then
760
		  	numOfRows = UBound( aProductList, 2 )
761
 
762
			For rowNum = 0 To numOfRows
763
 
764
				ProdId = aProductList( 0, rowNum )
765
				ChangeType = aProductList( 3, rowNum )
766
				PkgVersion = aProductList( 2, rowNum )
767
				PkgId = aProductList( 6, rowNum )
768
			If	ChangeType	=	"A"	or	ChangeType	=	"U"	Then	
769
 
770
 
771
 
772
				OraDatabase.Parameters.Add "PRODUCTION_BOM", dbPARbom_id, ORAPARM_INPUT, ORATYPE_NUMBER
773
				OraDatabase.Parameters.Add "PKG_ID", PkgId, ORAPARM_INPUT, ORATYPE_NUMBER
774
 
775
				Set rsQry = OraDatabase.DbCreateDynaset(GetQuery("ProdVersion.sql"), ORADYN_DEFAULT)
776
 
777
				OldProdId = rsQry("prod_id")
778
				CurrentPkgVersion = rsQry("pkg_version")
779
				Comments = rsQry("comments")
780
 
781
				OraDatabase.Parameters.Remove "PRODUCTION_BOM"
782
				OraDatabase.Parameters.Remove "PKG_ID"	
783
				IsDisplay = True
784
 
785
						MajorA = NULL
786
						MajorB = NULL
787
						MinorA = NULL
788
						MinorB = NULL
789
						PatchA = NULL
790
						PatchB = NULL
791
 
792
				' Find the first occurence of the dot in package version A
793
						pos = InStr(PkgVersion, ".")
794
						If pos <> 0 Then
795
							' Extract the Major Version for A
796
							MajorA = Mid(PkgVersion, 1, pos - 1)
797
							' Delete the Major Version Value from the string to get the minor and patch version
798
							PkgVersion = Mid(PkgVersion, pos + 1, Len(PkgVersion))
799
							' Find the second occurence of the dot in package version A
800
							pos = InStr(PkgVersion, ".")
801
							' Extract the Minor Version for A
802
							If pos <> 0 Then
803
								MinorA = Mid(PkgVersion, 1, pos - 1)
804
								' Delete the Minor Version value from the string to get the patch version
805
								PkgVersion = Mid(PkgVersion, pos + 1, Len(PkgVersion))
806
								' Find the last occurence of the dot in package version A
807
								pos = InStr(PkgVersion, ".")
808
								If pos <> 0 Then
809
									' Extract the Patch Version for A
810
									PatchA = Mid(PkgVersion, 1, pos - 1)
811
								End If	
812
							End If	
813
						End If	
814
 
815
						' Find the first occurence of the dot in package version B
816
						pos = InStr(CurrentPkgVersion, ".")
817
						If pos <> 0 Then
818
							' Extract the Major Version for B
819
							MajorB = Mid(CurrentPkgVersion, 1, pos - 1)
820
							' Delete the Major Version Value from the string to get the minor and patch version
821
							CurrentPkgVersion = Mid(CurrentPkgVersion, pos + 1, Len(CurrentPkgVersion))
822
							' Find the second occurence of the dot in package version B
823
							pos = InStr(CurrentPkgVersion, ".")
824
							' Extract the Minor Version for B
825
							If pos <> 0 Then
826
								MinorB = Mid(CurrentPkgVersion, 1, pos - 1)
827
								' Delete the Minor Version value from the string to get the patch version
828
								CurrentPkgVersion = Mid(CurrentPkgVersion, pos + 1, Len(CurrentPkgVersion))
829
								' Find the last occurence of the dot in package version B
830
								pos = InStr(CurrentPkgVersion, ".")
831
									If pos <> 0 Then
832
									' Extract the Patch Version for B
833
									PatchB = Mid(CurrentPkgVersion, 1, pos - 1)
834
								End If
835
							End If
836
						End If
837
 
838
						If NOT isNull(PatchA) AND NOT isNull(PatchB) Then
839
							If len(PatchA) < 4 Then PatchA = AddTrailingZeros(PatchA, 4)
840
							If len(PatchB) < 4 Then PatchB = AddTrailingZeros(PatchB, 4)
841
						End If 
842
 
843
						If MajorA = MajorB Then
844
							If MinorA = MinorB Then
845
								If IsNumeric(PatchA) AND IsNumeric(PatchB) Then
846
 
847
									If CDbl(PatchB) > CDbl(PatchA) Then
848
										IsDisplay = False
849
									Else										
850
										IsDisplay = True
851
									End If
852
								End If
853
							Else
854
								If IsNumeric(MinorA) AND IsNumeric(MinorB) Then
855
									If CInt(MinorB) > CInt(MinorA) Then
856
										IsDisplay = False
857
									Else
858
										IsDisplay = True								
859
									End If									
860
								End If
861
							End If
862
						Else
863
							If IsNumeric(MajorA) AND IsNumeric(MajorB) Then
864
								If 	CInt(MajorB) > CInt(MajorA) Then
865
									IsDisplay = False
866
								Else
867
									IsDisplay = True
868
								End If	
869
							End If
870
						End If		
871
 
872
		If NOT IsDisplay Then								
873
		  %>
874
		  <tr>
875
            <td nowrap valign="top" class="menu_link">
876
			<%
877
 
878
			Set rsTemp = OraDatabase.DbCreateDynaset("SELECT * FROM PACKAGE_VERSIONS PV, PRODUCT_DETAILS PD WHERE PD.PROD_ID(+) = PV.PV_ID AND PV.PV_ID ="&ProdId, ORADYN_DEFAULT )
879
			%>
880
			<%=GetProductIcon( rsTemp ) &  aProductList( 1, rowNum )%>
881
			<%
882
			rsTemp.Close()
883
			Set rsTemp = nothing
884
			%>
885
			</td>
886
            <td nowrap class="body_row" valign="top"><%=aProductList( 2, rowNum )%></td>
887
			<td class="body_rowlite"><%=Comments%></td>
888
          </tr>
889
 
890
		  <tr>
891
			  	<td><img src="images/spacer.gif" width="1" height="1"></td>
892
	            <td nowrap valign="top" class="body_row" colspan="3">
893
				<DIV id="PRODUCT_<%=ProdId & ChangeType%>" name="PRODUCT_<%=ProdId & ChangeType%>" style="display:none;"><%=enumLOADING%></DIV>
894
				</td>
895
	          </tr>
896
 
897
		  <%If rowNum <> numOfRows Then%>
898
		  <tr>
899
            <td colspan="4" background="images/bg_table_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
900
          </tr>
901
		  <%End If%>
902
 
903
		  <%End If%>
904
		  <%
905
			rsQry.Close()
906
			Set rsQry = Nothing
907
			End If
908
 
909
		  	Next
910
		  Else%>
911
 
912
		  <tr>
913
            <td colspan="4" class="body_txt">No Changes Found.</td>
914
          </tr>
915
 
916
		  <%End If%>
917
 
918
 
919
 
920
 
921
 
922
          <tr>
923
            <td colspan="4" background="images/bg_table_border.gif">
924
			 <table width="100%"  border="0" cellspacing="1" cellpadding="2">
925
              <tr>
926
                <td nowrap background="images/bg_table_col.gif"><img src="images/spacer.gif" width="1" height="1"></td>
927
              </tr>
928
             </table>
929
			</td>
930
          </tr>
931
         </table>	
932
		 </SPAN>
933
		<%
934
		Call objFormComponent.FormEnd()
935
		'-- FROM END ----------------------------------------------------------------------------------------------------------------
936
		%>
937
 
938
	    </td>
939
      </tr>
940
    </table></td>
941
    <td width="1%" valign="top" background="images/bg_favourits.gif">
942
	<%If Request.Cookies( enumCOOKIE_NAME )( "user_bar" ) <> "hide" Then%>
943
 
944
	<%End If%>
945
   </td>
946
  </tr>
947
  <tr>
948
    <td background="images/bg_bage_0a.gif"><img src="images/spacer.gif" width="1" height="15"></td>
949
    <td background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="1"></td>
950
    <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="1"></td>
951
    <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="1"></td>
952
  </tr>
953
  <tr>
954
    <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="20"></td>
955
    <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="1"></td>
956
    <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="1"></td>
957
    <td bgcolor="#FFFFFF">&nbsp;</td>
958
  </tr>
959
</table>
960
<!-- FOOTER ++++++++++++++++ -->
961
<!--#include file="_footer.asp"-->
962
<!-- +++++++++++++++++++++++ -->
963
</body>
964
</html>
965
<%
966
'------------ RUN AFTER PAGE RENDER -----------
967
Set objPMod = Nothing
968
Set objCrumbs = Nothing
969
Set objTabControl = Nothing
970
'----------------------------------------------
62 rsolanki 971
%><!--#include file="common/globals_destructor.asp"-->