This topic is locked

What am I doing wrong

1/2/2008 12:20:39 PM
PHPRunner General questions
3
3dwizard author

OK, I have been going over this a million times already. First time I tried it about a month ago it worked perfectly. Now for some reason is not displaying the wanted result. Here is the problem.
What I want is to be able to approve the input as an admin once data is entered into database.
I have "Table A" with this:
Edit SQL Query manually:

select...

From ...

WHERE Approved = 1
And a Custom "View A" (which is derived from the actual table A).

without WHERE clause...in edit sql query
I have setup a bolean checkbox and the field is named "Approved"(uppercase A).
I created "test" as a default registered user and another "admin" to approve it after-which is an absolute admin btw.
Now, I input everything as a default registered user and nothing shows (which is expected because it needs to be approved). Then I log in as an Admin and still nothing shows in custom view or regular table view.
What am I doing wrong? I tried so many different tweaks and variations but no luck. Am I forgeting something as an event?

G
gverras 1/2/2008

I tackled this problem where we do workflow using ASP runner Pro forms. We send Legal Descriptions around to different levels using ASP Runner Pro
First of all I am using SQL Server 2K with NT authentication, but this can be adapted to a SQL authentication as well.

All of our Managers are in the Manager SQL Role and all of our Users are in the User role
There is set of User-Level forms without an Approved checkbox

and a set of Manager level forms with an Approved checkbox.
The Manager Level forms are based on a view of the original table that also includes the Approved checkbox.
The record also has an "Edit Level" column
When the form opens it tests on the role that user belongs to and the Edit Level and redirects accordingly.

I make extensive use of the ASP Runner Form Events. Here is an example of the AddOnLoad Event for the User-Level form
Sub AddOnLoad()

'

' Do a Security Check

ManagerFlg = Session("ManagerLvl")

if ManagerFlg = "" then

tsql = "Select is_member('WorkflowManager')"

set rsSecurity = CreateObject("ADODB.Recordset")

rsSecurity.Open tSQL, dbConnection
if not(rsSecurity.eof and rsSecurity.bof) then

ManagerFlg = rsSecurity(0)

rsSecurity.close : set rsSecurity = nothing

end if

end if
Session("ManagerLvl") = ManagerFlg
'


' Get the MatterID from the Querystring

if request.querystring("MatterID") <> "" then

MatID = request.querystring("MatterID")

Session("Legl_Desc_masterkey1") = MatID

end if

MatID = Session("Legl_Desc_masterkey1")
'** Check if specific record exists ****

strSQLExists = "select * from Legl_Desc (nolock) where MatterID=" & MatID

set rsExists = CreateObject("ADODB.Recordset")

rsExists.Open strSQLExists, dbConnection
if not rsExists.eof then

' if record exists do something
rsExists.Close : set rsExists = Nothing

Response.redirect "Legl_Desc_Edit.asp?editid1=" & MatID

end if

' if dont exist do something else
'ReviewLvl =rsExists("ReviewLvl")

'if ReviewLvl > 0 then

' Response.Redirect "Legl_Desc_View.asp?editID1=" & MatID

'end if

'**

End Sub
there is a lot more code that I've added to the forms via the Event handlers, but I don't want to clutter up the Forum. This gives you some idea about the approach that I took.
Hope this helps.

OK, I have been going over this a million times already. First time I tried it about a month ago it worked perfectly. Now for some reason is not displaying the wanted result. Here is the problem.

What I want is to be able to approve the input as an admin once data is entered into database.
I have "Table A" with this:
Edit SQL Query manually:

select...

From ...

WHERE Approved = 1
And a Custom "View A" (which is derived from the actual table A).

without WHERE clause...in edit sql query
I have setup a bolean checkbox and the field is named "Approved"(uppercase A).
I created "test" as a default registered user and another "admin" to approve it after-which is an absolute admin btw.
Now, I input everything as a default registered user and nothing shows (which is expected because it needs to be approved). Then I log in as an Admin and still nothing shows in custom view or regular table view.
What am I doing wrong? I tried so many different tweaks and variations but no luck. Am I forgeting something as an event?

Sergey Kornilov admin 1/3/2008

3dwizard,
check if data is actually added to the database.
You can also post your application to Demo Account (last tab in PHPRunner) and send the URL with instructions to support@xlinesoft.com.