CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Would somebody help me with PHP?

Print topic Send  topic

Author Message
Valdi
Posted: 01/31/2002, 11:12 AM

I cant manage sorting basing on the article "Maintaining Sort order and Page Number in a Grid form After navigating to a Record form"

Would somebody help me and translate it to PHP?

sParams = sParams& "&FormTasks_Sorting=" & Session("FormTasks_Sorting")&"&FormTasks_Page="& Session("FormTasks_Page"

Shouldn't I also set session for FormMyFormName_Sorted when I work with PHP???

TIA and Regards,
Valdi
Denis Delarze
Posted: 01/31/2002, 12:41 PM

try this:


sParams = sParams."&FormTasks_Sorting=".get_session("FormTasks_Sorting")."&FormTasks_Page=".get_session("FormTasks_Page"


this make your sParams string... but the i'm not sure of your content
Valdi
Posted: 02/01/2002, 2:14 PM

Of course Denis! Thank you - it works!

It was so simple and full of logic,
I suppose - I were tired too much...

Reagrds

Valdi
Janice Scott
Posted: 11/22/2002, 4:57 AM

We are using the following code to maintain the page and sort on a grid when you return to it after viewing or upgrading a record.

CodeCharge returns to the base page going from a record to a grid. If your grid has multiple pages or a unique sort it is lost and you must page through and or resort your grid.

We are using PHP with templates and have set our record page to POST method in the common page.

If you put the following code, just as written there is no need to make any changes, in the OPEN event of the grid:

global $HTTP_SERVER_VARS;
if ($HTTP_SERVER_VARS['QUERY_STRING'])
set_session("qstring",$HTTP_SERVER_VARS['QUERY_STRING']);
else
set_session("qstring","");


And then place this single line of code, just as written no changes needed, in the corresponding record, in both the EXECUTE the CANCEL events:

$sActionFileName=$sActionFileName."?".get_session("qstring");

When you return to your grid it will be on the same page and have the same sort as when you left it.

Here is how it works.

The bit of code in the grid open event, creates a session variable that captures the query string(everything that comes after the ? in the page url.) This string contains the sort and page number of the current grid page. The code saves this to a session variable we called "qstring" but you can name it anything you like.

In the record events the single line of code reads the session variable "qstring" and assigns it as an extension to the $sActionFileName which is the CodeCharge handle for the page open function.

Hope this is helpful,

Janice


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.