Subversion Repositories DevTools

Rev

Rev 29 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
27 rsolanki 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|			          AdminProjectIterations	 	 |
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/_admin_projects_common.asp"-->
17
<%
18
'------------ ACCESS CONTROL ------------------
19
%>
20
<!--#include file="_access_control_general.asp"-->
21
<!--#include file="_access_control_admin_pages.asp"-->
22
<%
23
'------------ VARIABLE DEFINITION -------------
24
Dim rsQry
25
Dim i
26
Dim LastRow
27
Dim aIterationCollector
28
Dim parAction
29
'------------ CONSTANTS DECLARATION -----------
30
'------------ VARIABLE INIT -------------------
31
parAction = Request("action")
32
parBranch_id = Request("branch_id")
33
'------------ CONDITIONS ----------------------
34
'----------------------------------------------
35
%>
36
<%
37
'--------------------------------------------------------------------------------------------------------------------------------
38
Sub GetIterations ( aIterationCollector, nProj_id )
39
	Dim rsQry
40
 
41
	OraDatabase.Parameters.Add "PROJ_ID", nProj_id,	ORAPARM_INPUT, ORATYPE_NUMBER 
42
 
43
	Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("AdminProductionList.sql"), ORADYN_DEFAULT )
44
 
45
	If rsQry.RecordCount > 0 Then
46
		aIterationCollector = rsQry.GetRows()
47
	Else
48
		aIterationCollector = NULL
49
	End If
50
 
51
	rsQry.Close
52
	Set rsQry = Nothing
53
	OraDatabase.Parameters.Remove "PROJ_ID"
54
End Sub
55
'--------------------------------------------------------------------------------------------------------------------------------
56
Sub RenderPMBOMCombo( nVtree_id, nRMProj_fk ) 
57
	Dim rsQry, Disabled, Query
58
 
59
	Disabled = ""
60
 
61
	If (nRMProj_fk = "") OR ( IsNull(nRMProj_fk) ) Then Disabled = "disabled"
62
 
63
	OraDatabase.Parameters.Add "RM_PROJ_FK", 	nRMProj_fk,	ORAPARM_INPUT, ORATYPE_NUMBER
64
	OraDatabase.Parameters.Add "VTREE_ID", 		nVtree_id,	ORAPARM_INPUT, ORATYPE_NUMBER
65
 
66
	Query  = "select * from"&_
67
			 "	branches br, boms bm, bom_names bn"&_
68
			 "	where br.proj_id = "&Request("PROJ_ID")&""&_
69
			 "	and bm.BRANCH_ID = br.BRANCH_ID"&_
70
			 "	and bn.BOM_NAME_ID = bm.BOM_NAME_ID"&_
71
			 "  and bm.bom_id not in (select bom_id from production_bom)"
72
 
73
	Set rsQry = OraDatabase.DbCreateDynaset( Query, ORADYN_DEFAULT )
74
 
75
 
76
	Response.write "<select name='bom_id' class='form_iname' "& Disabled &">"
77
 
78
 
79
	While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
80
		Response.write "<option value='"& rsQry("bom_id") &"'>"& rsQry("bom_name").Value &""&VBNewLine&""& rsQry("bom_version") &"."&rsQry("bom_lifecycle")&"</option>"
81
 
82
		rsQry.MoveNext
83
	WEnd
84
 
85
 
86
	Response.write "</select>"
87
 
88
 
89
 
90
	rsQry.Close
91
	Set rsQry = Nothing
92
 
93
	OraDatabase.Parameters.Remove "RM_PROJ_FK"
94
	OraDatabase.Parameters.Remove "VTREE_ID"
95
End Sub
96
'--------------------------------------------------------------------------------------------------------------------------------
97
Sub RenderPMBranchesCombo( nVtree_id, nRMProj_fk ) 
98
	Dim rsQry, Disabled
99
 
100
	Disabled = ""
101
 
102
	If (nRMProj_fk = "") OR ( IsNull(nRMProj_fk) ) Then Disabled = "disabled"
103
 
104
	Set rsQry = OraDatabase.DbCreateDynaset( "select * from branches where proj_id = "&nRMProj_fk&" and is_hidden is null order by branch_id desc", ORADYN_DEFAULT )
105
 
106
 
107
	Response.write "<select name='branch_id' class='form_iname' "& Disabled &">"
108
 
109
 
110
	While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
111
		Response.write "<option value='"& rsQry("branch_id") &"'>"& rsQry("branch_name").Value &"</option>"
112
 
113
		rsQry.MoveNext
114
	WEnd
115
 
116
 
117
	Response.write "</select>"
118
 
119
 
120
 
121
	rsQry.Close
122
	Set rsQry = Nothing
123
 
124
 
125
End Sub
126
'--------------------------------------------------------------------------------------------------------------------------------
127
Sub RenderState( nVtree_id, nRMProj_fk ) 
128
	Dim rsQry, Disabled
129
 
130
	Disabled = ""
131
 
132
	If (nRMProj_fk = "") OR ( IsNull(nRMProj_fk) ) Then Disabled = "disabled"
133
 
134
	Set rsQry = OraDatabase.DbCreateDynaset( "select * from states where proj_id = "&nRMProj_fk, ORADYN_DEFAULT )
135
 
136
 
137
	Response.write "<select name='state_id' class='form_iname' "& Disabled &">"
138
 
139
 
140
	While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
141
		Response.write "<option value='"& rsQry("state_id") &"'>"& rsQry("state_name").Value &"</option>"
142
 
143
		rsQry.MoveNext
144
	WEnd
145
 
146
 
147
	Response.write "</select>"
148
 
149
 
150
 
151
	rsQry.Close
152
	Set rsQry = Nothing
153
 
154
 
155
End Sub
156
'--------------------------------------------------------------------------------------------------------------------------------
157
Sub AddProductionBOM ()
158
	On Error Resume Next
159
 
160
	OraDatabase.Parameters.Add "BOM_ID", 	Request("bom_id"),		ORAPARM_INPUT, ORATYPE_VARCHAR2
161
	OraDatabase.Parameters.Add "BRANCH_ID", Request("branch_id"), 		ORAPARM_INPUT, ORATYPE_NUMBER 
162
	OraDatabase.Parameters.Add "STATE_ID", 	Request("state_id"), 	ORAPARM_INPUT, ORATYPE_NUMBER 
163
	OraDatabase.Parameters.Add "PROJ_ID", 	Request("proj_id"), 	ORAPARM_INPUT, ORATYPE_VARCHAR2 
164
 
165
 
166
	objEH.TryORA ( OraSession )
167
 
168
	OraDatabase.ExecuteSQL _
169
	"BEGIN   pk_Production.Add_Production_Bom ( :BOM_ID, :BRANCH_ID, :STATE_ID, :PROJ_ID );   END;"
170
 
171
	objEH.CatchORA ( OraSession )
172
 
173
 
174
	OraDatabase.Parameters.Remove "BOM_ID"
175
	OraDatabase.Parameters.Remove "BRANCH_ID"
176
	OraDatabase.Parameters.Remove "STATE_ID"
177
	OraDatabase.Parameters.Remove "PROJ_ID"
178
 
179
End Sub
180
'--------------------------------------------------------------------------------------------------------------------------------
181
%>
182
<%
183
'------------ RUN BEFORE PAGE RENDER ----------
184
' --- Get Form details from DB ---
185
'Call GetFormDetails ( Request("bom_id"), objFormCollector )
186
 
187
' --- Load Validation Rules ---
188
'Call objForm.LoadValidationRules ( Array("branch_name","branch_comments"), OraDatabase )		' Load Validation Rules
189
 
190
' --- Enter Form Validation Rule Changes here... ----
191
'----------------------------------------------------
192
 
193
' --- RUN onPostBack ---
194
If Request("doit") <> "" Then
195
	If objForm.IsValidOnPostBack Then
196
		' --- Form is Valid ---
197
 
198
		Select Case Request("action")
199
			Case "new"
200
				Call AddProductionBOM()
201
			Case "edit"
202
				Call EditBranch()
203
 
204
		End Select
205
 
206
 
207
		If objEH.Finally Then
208
			Call OpenInWindow ( SCRIPT_NAME &"?"& objPMod.ComposeURL() )
209
		End If
210
 
211
	End If
212
 
213
 
214
 
215
End If
216
 
217
'----------------------------------------------
218
%>
219
<html>
220
<head>
221
<title>Deployment Manager</title>
222
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
223
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
224
<link href="scripts/deployment_manager.css" rel="stylesheet" type="text/css">
225
<script language="JavaScript" src="scripts/common.js"></script>
226
</head>
227
 
29 jtweddle 228
<body leftmargin="0" topmargin="0">
27 rsolanki 229
<!-- HEADER ++++++++++++++++ -->
230
<!--#include file="_header.asp"-->
231
<!-- +++++++++++++++++++++++ -->
232
<!-- MAIN MENU  ++++++++++++++++++++++++++ -->
233
<!--#include file="_main_menu_admin.asp"-->
234
<!-- +++++++++++++++++++++++++++++++++++++ -->
235
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
236
  <tr>
237
    <td width="1%" valign="top" background="images/bg_bage_0.gif">
238
	<!-- ADMIN BROWSER ++++++++++++++++++++++ -->
239
	<!--#include file="_admin_project_browser.asp"-->
240
    <!-- END OF ADMIN BROWSER +++++++++++++++ -->
241
	</td>
242
    <td width="1" background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="600"></td>
243
    <td width="100%" valign="top" bgcolor="#FFFFFF">
244
	<table width="100%"  border="0" cellspacing="0" cellpadding="0">
245
      <tr>
246
        <td width="1%" valign="top" background="images/bg_darkbage.gif"></td>
247
        <td width="100%" valign="bottom" background="images/bg_darkbage.gif">
248
 
249
		</td>
250
        <td width="1%" background="images/bg_darkbage.gif"><img src="images/img_spanner.gif" width="190" height="55"></td>
251
        </tr>
252
      <tr>
253
        <td background="images/bg_bage_0.gif"><img src="images/spacer.gif" width="30" height="10"></td>
254
        <td background="images/bg_bage_0.gif">
255
		<!-- BUTTONS CONTROL +++++++++++++++++++ -->
256
		<!-- +++++++++++++++++++++++++++++++++++ -->
257
		</td>
258
        <td background="images/bg_darkbage.gif"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
259
          <tr>
260
            <td width="100%" background="images/bg_bage_0.gif">&nbsp;</td>
261
            <td width="1"><img src="images/p_bar_corrner.gif" width="17" height="42"></td>
262
          </tr>
263
        </table></td>
264
        </tr>
265
      <tr>
266
        <td>&nbsp;</td>
267
        <td><br><br>
268
		  <!-- PAGE DETAILS +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
269
          <table width="100%"  border="0" cellspacing="0" cellpadding="0">
270
		  <form name="FormName" method="post" action="<%=SCRIPT_NAME%>" onSubmit="ShowProgress();">
271
		  <%
272
		  Call GetIterations ( aIterationCollector, parProj_id )
273
 
274
 
275
		  %>
276
            <tr>
277
              <td background="images/bg_bage_0a.gif"><table width="100%"  border="0" cellspacing="1" cellpadding="2">
278
                <tr>
279
                  <td width="1" background="images/bg_bage_0.gif"></td>
280
                  <td width="20%" background="images/bg_bage_0.gif" class="body_col" nowrap>Production Branch </td>
281
                  <td width="20%" background="images/bg_bage_0.gif" class="body_col" nowrap>Production BOM </td>
282
				  <td width="60%" background="images/bg_bage_0.gif" class="body_col" nowrap>Production State</td>
283
				 <!--  <td width="1" background="images/bg_bage_0.gif" class="body_col" nowrap>Hide</td> -->
284
                </tr>
285
				<%
286
				If NOT IsNull(aIterationCollector) Then
287
					LastRow = Ubound( aIterationCollector, 2 )
288
					For i = 0 To LastRow
289
					%>
290
					<%If parAction = "" Then%>
291
					<!-- NORMAL ROW +++++++++++++++++++ -->
292
	                <tr>
293
	                  <td background="images/bg_bage_0.gif" align="center"></td>
294
	                  <td valign="top" bgcolor="#FFFFFF" class="body_row" nowrap><%=aIterationCollector(9, i)%></td>					  
295
	                  <td valign="top" bgcolor="#FFFFFF" class="body_row" nowrap><%=aIterationCollector(7, i)%><%=VBNewLine%><%=aIterationCollector(12, i)%></td>
296
					  <td valign="top" bgcolor="#FFFFFF" class="body_row" nowrap><%=( aIterationCollector(11, i) )%></td>
297
<!-- 	                  <td align="center" nowrap background="images/bg_bage_0.gif"><a href="<%=SCRIPT_NAME%>?action=edit&branch_id=<%=aIterationCollector(0, i)%>&<%=objPMod.ComposeURL()%>"><%=LIMG_EDIT%></a><a href="_RemoveBranch.asp?rfile=<%=SCRIPT_NAME%>&branch_id=<%=aIterationCollector(0, i)%>&<%=objPMod.ComposeURL()%>" onClick="return confirmAction('Remove \'<%=aIterationCollector(1, i)%>\' from this list?');"><%=LIMG_REMOVE%></a></td> -->
298
	                </tr>
299
					<!-- +++++++++++++++++++++++++++++++++ -->
300
 
301
					<%Else%>
302
 
303
						<%If CStr(aIterationCollector(0, i)) <> parBranch_id Then%>
304
						<!-- JUST DATA ROW +++++++++++++++++++ -->
305
						<tr>
306
		                  <td background="images/bg_bage_0.gif" align="center"></td>
307
		                  <td valign="top" bgcolor="#FFFFFF" class="body_row" nowrap><%=aIterationCollector(9, i)%></td>						  
308
		                  <td valign="top" bgcolor="#FFFFFF" class="body_row" nowrap><%=aIterationCollector(7, i)%><%=VBNewLine%><%=aIterationCollector(12, i)%></td>
309
						  <td valign="top" bgcolor="#FFFFFF" class="body_row" nowrap><%=( aIterationCollector(11, i) )%></td>
310
		                </tr>
311
						<!-- +++++++++++++++++++++++++++++++++ -->
312
						<%End If%>
313
					<%End If%>
314
 
315
 
316
				<%
317
					Next
318
 
319
				End If
320
				%>
321
 
322
 
323
				<!-- NEW ENTRY ROW FORM ++++++++++++++ -->
324
				<%If parAction = "new" Then%>
325
 
326
				<input type="hidden" name="action" value="new">
327
				<tr>
328
                  <td background="images/bg_bage_0.gif" align="center" valign="top"><%=LIMG_POINTER%></td>
329
                  <td background="images/bg_note.gif" class="body_row" valign="top"><%Call RenderPMBranchesCombo( Request("rm_vtree_fk"), objProjCollector.Item("rm_projects_fk") )%></td>
330
                  <td background="images/bg_note.gif" class="body_row" valign="top"><%Call RenderPMBOMCombo( Request("rm_vtree_fk"), objProjCollector.Item("rm_projects_fk") )%></td>
331
				  <td background="images/bg_note.gif" class="body_row" valign="top"><%Call RenderState( Request("rm_vtree_fk"), objProjCollector.Item("rm_projects_fk") )%></td>
332
                  <td background="images/bg_note.gif" align="center" nowrap valign="top"><%=LIMG_ROW_SUBMIT%><a href="<%=SCRIPT_NAME%>?<%=objPMod.ComposeURL()%>" ><%=LIMG_ROW_CANCEL%></a></td>
333
                </tr>
334
				<%End If%>
335
				<!-- +++++++++++++++++++++++++++++++++ -->
336
 
337
 
338
				<!-- NEW ENTRY BUTTON ++++++++++++++++ -->
339
				<%If parAction = "" Then%>
340
				<tr>
341
                  <td background="images/bg_bage_0.gif" align="center"><a href="<%=SCRIPT_NAME%>?action=new&<%=objPMod.ComposeURL()%>"><%=LIMG_NEW_ENTRY%></a></td>
342
                  <td bgcolor="#FFFFFF" class="body_row">&nbsp;</td>
343
                  <td bgcolor="#FFFFFF" class="body_row">&nbsp;</td>
344
				  <td bgcolor="#FFFFFF" class="body_row">&nbsp;</td>
345
                </tr>
346
				<%End If%>
347
				<!-- +++++++++++++++++++++++++++++++++ -->
348
 
349
              </table></td>
350
            </tr>
351
		  <%=objPMod.ComposeHiddenTags()%>
352
		  <input type="hidden" name="doit" value="true">
353
		  </form>
354
          </table>
355
          </td>
356
        <td valign="top"></td>
357
        </tr>
358
    </table>
359
	<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
360
	</td>
361
  </tr>
362
  <tr>
363
    <td background="images/bg_bage_0a.gif"><img src="images/spacer.gif" width="200" height="15"></td>
364
    <td background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="1"></td>
365
    <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="1"></td>
366
  </tr>
367
  <tr>
368
    <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="20"></td>
369
    <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="1"></td>
370
    <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="1"></td>
371
  </tr>
372
</table>
373
<!-- FOOTER ++++++++++++++++ -->
374
<!--#include file="_footer.asp"-->
375
<!-- +++++++++++++++++++++++ -->
376
</body>
377
</html>
378
<%
379
'------------ RUN AFTER PAGE RENDER -----------
380
Set objPMod = Nothing
381
Set objTabControl = Nothing
382
'----------------------------------------------
29 jtweddle 383
%><!--#include file="common/globals_destructor.asp"-->