Anda di halaman 1dari 4

<script language="VBScript" runat="server">

logeduser_uid = Session("LUID")
sub write(sqlstring01)

//check if user is Responsible over selected Administrative Unit


Set AdoConn78=Session("DataConn3")
sqlString78 = "SELECT * FROM responsibles_tbl WHERE (resp_uid= '" & loge
duser_uid & "') AND (active = '1')"
AdoConn78.Execute(sqlString78)
//check if logged user is an active user
Set AdoConn79=Session("DataConn3")
sqlString79 = "SELECT * FROM users_tbl WHERE (user_uid= '" & logeduser_u
id & "') AND (active = '1')"
AdoConn79.Execute(sqlString79)
If AdoConn78.Recordset.RecordCount <> 0 OR AdoConn79.Recordset.RecordCount <
> 0 Then
is_resp = "1"
Else
is_resp = "0"
End If
set AdoConn10=Session("DataConn3")
AdoConn10.Execute(sqlstring01)
iTotalDisplayRecords = AdoConn10.RecordSet.RecordCount

p=AdoConn10.RecordSet.GetRows(150,0)
response.write("<table>")
for j = 0 to 150
'other sqlstrings
Set AdoConn77=Session("DataConn3")
sqlString77 = "SELECT shopping_cart_no, ceos_status, po_number, buyer, s
ince_when FROM purchase_orders_ceos WHERE (shopping_cart_no= '" &p(6,j)& "')"
AdoConn77.Execute(sqlString77)
s=AdoConn77.RecordSet.GetRows(2,0)
imported_status_from_ceos = "0"
imp_status_ceos_id = "0"
imp_po_number = ""
buyer = ""
since_when = ""
buyer = s(3,0)
since_when = s(4,0)

If AdoConn77.RecordSet.RecordCount = 0 Then
buyer = ""
since_when = ""
Else
imported_status_from_ceos = s(1,0)
If imported_status_from_ceos="Awaiting Approval" Then
imp_status_ceos_id = "1"
imp_po_number = ""
End If
If imported_status_from_ceos="Follow-on Document Created" Then
imp_status_ceos_id = "2"
imp_po_number = s(2,0)
End If
If imported_status_from_ceos="Follow-on Document Deleted" Then
imp_status_ceos_id = "3"
imp_po_number = ""
End If
If imported_status_from_ceos="REJECTED" Then
imp_status_ceos_id = "4"
imp_po_number = ""
End If
End If
Set AdoConn6=Session("DataConn3")
sqlString6 = "SELECT status_from_ceos_def FROM dbo.po_status_ceos WHERE
(id= '" & imp_status_ceos_id & "')"
AdoConn6.Execute(sqlString6)
If AdoConn6.RecordSet.RecordCount <> 0 Then
ceos = AdoConn6.RecordSet.GetRows(2,0)
po_status_ceos_transformed = ceos(0,0)
End If
'cost center sqlstrings
Set AdoConn11=Session("DataConn3")
sqlString11 = "SELECT cost_center_id FROM dbo.cost_centers_tbl WHERE (id
= '" & p(11,j) & "') AND (active='1')"
AdoConn11.Execute(sqlString11);
cost_center_id = AdoConn11.RecordSet("cost_center_id")
'initiated on
response.write("<tr><td>")
response.write(p(5,j))
response.write("</td>")
'id
response.write("<td>")
response.write(p(0,j))
response.write("</td>")
'actions
response.write("<td>")
response.write("<a href='my_orders_view_order_details.asp?view_po_id=")
response.write(p(0,j))
response.write("&admin_unit_chg=1' target='p_content_frame'")
response.write("><img src='")
If is_resp = "1" Then
response.write("../images/process_req_icon.png'")
Else

response.write("../images/icon_view.png'")
End If
response.write(" border='0' align='absmiddle' alt='")
If is_resp = "1" Then
response.write("Process/Update/View Order")
Else
response.write("View Order Details")
End If
response.write("'/></a>")
If p(1,j) <= "2" AND p(8,j)=logeduser_uid Then
response.write("<a href='my_orders_edit_order.asp?po_id=" & p(0,j) & "&admin_uni
t_chg=1' target='p_content_frame'><img src='../images/edit_icon.gif' border='0'
align='absmiddle' alt='Edit Order' title='Edit Order' /> </a>")
response.write("<a href='all_orders_cancel_order.asp?view_po_id=" & p(0,j) & "'
target='p_content_frame'>")
response.write("<img src='../images/cancel_ico.gif' border='0' align='absmiddle'
alt='You can inform the Purchasing Responsible that you want to CANCEL your pur
chasing order!' title='You can inform the Purchasing Responsible that you want t
o CANCEL your purchasing order!' /> </a>")
End If
response.write("</td>")
'order status
response.write("<td>")
If imp_status_ceos_id<>"4" Then
response.write("<font color='blue' size='2'><strong><%=po_status_internal%></str
ong></font>")
If imp_status_ceos_id <> "0" Then
response.write("<br /><br /><font color='#003366' size='2'>CEOS:
")
response.write(po_status_ceos_transformed)
response.write("</font>")
End If
If buyer <> "" Then
response.write("<br /><font color='#003366' size='2'><b>Processor:</b>")
response.write(buyer)
response.write("</strong></font>")
response.write("<br /><font color='#003366' size='2'>Since when:")
response.write(since_when)
response.write("</strong></font>")
End If
If imp_po_number <> "" Then
response.write("<br /><font color='#009900' size='2'>PO No: <strong>")
response.write(imp_po_number)
response.write("</strong></font>")
End If
If imp_status_ceos_id = "4" Then
response.write("<font color='red' size='2'><strong>")
response.write(po_status_ceos_transformed)
response.write("</strong></font>")

End If
End If
response.write("</td>")
' req_name and cost center
response.write("<td align='center'>")
response.write("<strong>" & p(7,j) & "</strong>")
response.write("</td>")
response.write("</tr>")

Next
response.write("</table>")

end sub
</script>

Anda mungkin juga menyukai