codebang
Posts: 74
|
Posted: 12/24/2015, 8:12 AM |
|
Dears
Hi hows all.
I know that his might be a bit stupid to ask, but i would like to add/pass some information from the login page(details like branch name and company name) onto another page where more data is to be filled out.
The information from the login page is to be passed to the other page which are already available on the database. Yes i know how it can be done with parameters by creating a link, but passing them to another form on another page without using the link/parameters is the issue.
A user has all sorts of information on his/her record, which are already available in the database. When logging, some of this data moves on to another form on another page.
I really hope that i was clear.
Sorry if i wasn't.
|
|
|
Oper
Posts: 1195
|
Posted: 12/24/2015, 9:11 AM |
|
user login is stored in a variable/session/etc
you could get userid using ccgetuserid() function
and on the next form/page you just look for information using that ID
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
|
|
codebang
Posts: 74
|
Posted: 12/26/2015, 11:02 PM |
|
ok.. i will give it a try and revert back to u buddy....
|
|
|
codebang
Posts: 74
|
Posted: 12/27/2015, 12:43 AM |
|
$db = new clsDBOptoware();
global $branch_name;
global $company_name;
$sql = "Select * from tbl_users where user_id =".CCGetUserID();
$db->query($sql);
$db->next_record();
$branch_name = $db->f("branch_name");
$company_name = $db->f("company_name");
$branch_name->SetValue(.$branch_name.);
$company_name->SetValue(.$company_name.);
$db->close();
This was added to a beforeshow() Event. Am i doing it wrong?
|
|
|
eratech
Posts: 513
|
Posted: 12/28/2015, 10:36 PM |
|
Might be a problem with the naming - you are using a variable "$branch_name" etc and setting it to the values from the DB - but there is nowhere to set the actual fields on the Record?
eg in BeforeShow of the 'company_name' field (note: no full-stops in the SetValue)
$Component->SetValue($company_name);
or
$Record1->company_name->SetValue($company_name);
Also, the 'global' scope will work throughout the current page, but not when another page is loaded.
I suggest putting the code in a separate file (eg: MyFunctions.php) and require_once it in with Common.php This will let you have some global functions and then you can load the values in on a page with a single Function call.
Cheers
Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia |
|
|
MichaelMcDonald
Posts: 640
|
Posted: 12/29/2015, 11:54 PM |
|
Does CCGetUserID() work ?
I always used CCGetSession("UserID");
_________________
Central Coast, NSW, Australia.
|
|
|
Oper
Posts: 1195
|
Posted: 12/30/2015, 5:18 AM |
|
Check your common File CCGetuserid Call Session Variable.
But that way you do not depend on Session Name used.
keep in mind CCS allow you to change USERID session Name.
in my case i never use "USERID" for all my Projects
also if YesSoft change something in the future CCGetUserID will work
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
|
|
codebang
Posts: 74
|
Posted: 12/31/2015, 12:04 AM |
|
Thank you guys for all your posts.
Much appreciated.
|
|
|