Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WestWind/database filter help
Message
From
22/07/2011 14:01:03
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01516279
Message ID:
01518932
Views:
75
Alrighty I'm back again. I got the page redirect sorted, and now have both tables showing the information I need. The only thing I need now is to only have the second table display when the link on the HTML page is clicked... So basically you enter the record number on the main page and click Submit, a table pops up below the text box and Submit button that contains information. In that information is a link to display a second table below the first with more detailed information. Right now they both show when I click submit and I'm not sure how to have the second table "fire" when the link is clicked. Maybe that's something else I need to do in JS? Thoughts?

Here is my updated messy code:
FUNCTION r214input

fdBlNo = ALLTRIM(UPPER(Request.Form("blno")))
fdBN   = Request.Form("BN")
fdPK   = Request.Form("PK")
mEr = ""
lcTable=""
m.protbl = ""
m.rplen = 0

DO CASE
CASE ! EMPTY(fdBN)
	SQLWhere = "BN=" + ALLTRIM(fdBN)
	IF ! EMPTY(fdPK)
		SQLWhere = SQLWhere + " AND PK=" + ALLTRIM(fdPK)
	ENDIF 
OTHERWISE
	lcTable = "Not Found" 
	Response.Expandtemplate(goWCServer.oConfig.oTask.cHtmPath+"r214input.htm")
	RETURN 
ENDCASE 
lcTable="TBL Master File<br>"

THESQLDB = "TBL_BL"	
THESQLTABLE = "TBL_BOL"
THESERVER = goWCServer.oConfig.oTask.cSQLServer
usr = "sa"
pas = "Th1nk@123"
ConnStr = [driver=SQL Server; server=]+THESERVER+[; database=]+THESQLDB+[; uid=]+usr+[;pwd=]+pas+[; Trusted_Connection=No;]
curHandle = SQLstringCONNECT( connStr )



THESQLDB = "TBL_BL"	
THESQLTABLE = "TBL_BOL"
THESERVER = goWCServer.oConfig.oTask.cSQLServer
usr = ""
pas = ""
ConnStr = [driver=SQL Server; server=]+THESERVER+[; database=]+THESQLDB+[; uid=]+usr+[;pwd=]+pas+[; Trusted_Connection=No;]
curHandle = SQLstringCONNECT( connStr )
*!*	cmd = [exec InTransit ?']+ALLTRIM(user.cclientcd)+[']
text to cmd textmerge noshow
exec InTransitRN 
endtext
lr = SQLEXEC( curHandle, cmd, "sq")  && sq is the cursor the data is loaded into


IF SQLEXEC( curHandle, cmd, "sq")  = -1
messagebox(message())
ENDIF

SELECT;	
	client_zip,;
   [<a href="javascript:back('BNRN~X~]+fdBN+[~]+fdPK+[') "target="_self"> ]+TRIM(fdBlNo)+[</a>            ] as bol_number,;
	ref_num,;
	weight,;
	pro_number,;
	customer_name,;
	customer_state,;
	customer_zip,;
	carrier_name,;
	ship_date,;
	est_delivery,;
	appt_date,;
	latest_status_description,;
	latest_reason_description,;
	date_last_updated;
	FROM sq;
	WHERE bol_Number = ?m.fdBlNo;
	INTO CURSOR TQuery
	SELECT TQuery
	SET CENTURY ON 
	recs=RECCOUNT()
		
loSC = CREATEOBJECT("wwShowCursor")
loSC.lCenterTable = .f.
loSC.cHeaderBGColor = "black"   &&"#336633"
loSC.lAlternateRows = .T.
	loSC.cAlternatingBGColor = "white"  &&"#EFEFEF"
loSC.cTableBorder ="3"
loSC.cTableWidth="1000"
DIMENSION laHeaders[15]
laHeaders[1] = "Ozp"
laHeaders[2] = "BOL#"
laHeaders[3] = "Ref#"
laHeaders[4] = "Weight"
laHeaders[5] = "Pro#"
laHeaders[6] = "Customer Name"
laHeaders[7] = "Dst"
laHeaders[8] = "Dzp"
laHeaders[9] = "Carrier"
laHeaders[10] = "Ship Date"
laHeaders[11] = "Est_Delivery"
laHeaders[12] = "Appt. Date"
laHeaders[13] = "Latest Status"
laHeaders[14] = "Latest Reason"
laHeaders[15] = "Last Updated"
loSC.BuildFieldListHeader(@laHeaders)
loSC.lSumNumerics = .t.
loSC.ShowCursor()
lctable=loSC.GetOutput()


*******TABLE TWO (TO BE POPPED UP AFTER CLICKING LINK)*********


THESQLDB = "TBL_BL"	
THESQLTABLE = "TBL_BOL"
THESERVER = goWCServer.oConfig.oTask.cSQLServer
usr = ""
pas = ""
ConnStr = [driver=SQL Server; server=]+THESERVER+[; database=]+THESQLDB+[; uid=]+usr+[;pwd=]+pas+[; Trusted_Connection=No;]
curHandle = SQLstringCONNECT( connStr )
*!*	cmd = [exec InTransit ?']+ALLTRIM(user.cclientcd)+[']
text to cmd2 textmerge noshow
exec InTransitRNStatus 
endtext
lr = SQLEXEC( curHandle, cmd2, "sq2")  && sq is the cursor the data is loaded into

IF SQLEXEC( curHandle, cmd2, "sq2")  = -1
messagebox(message())
ENDIF

SELECT;	
	date_added,;
	status_date,;
	status_time,;
	status_city,;
	status_state,;
	equipment_id;
	FROM sq2;
	WHERE bol = ?m.fdBlNo;
	INTO CURSOR TQuery2
	SELECT TQuery2
	SET CENTURY ON 
	recs=RECCOUNT()

loSC = CREATEOBJECT("wwShowCursor")
loSC.lCenterTable = .f.
loSC.cHeaderBGColor = "black"   &&"#336633"
loSC.lAlternateRows = .T.
loSC.cAlternatingBGColor = "white"  &&"#EFEFEF"
loSC.cTableBorder ="3"
loSC.cTableWidth="750"
DIMENSION laHeaders[6]
laHeaders[1] = "Date Added"
laHeaders[2] = "Status date"
laHeaders[3] = "Status time"
laHeaders[4] = "City"
laHeaders[5] = "State"
laHeaders[6] = "Equipment ID"
loSC.BuildFieldListHeader(@laHeaders)
loSC.lSumNumerics = .t.
loSC.ShowCursor()
protbl=loSC.GetOutput()


Response.ExpandTemplate(goWCServer.oConfig.oTask.cBTSHTMPath+"r214Input.htm")
ENDFUNC
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform