nBill Community nBill Home Page
23/May/2012, 12:35:38 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Click Here for the nBill home page, or take a tour.  
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Easy way to access client data in the pre-calculate field of a form?  (Read 81 times)
deckard
Jr. Member
**
Offline Offline

Posts: 15


View Profile
« on: 02/February/2012, 03:42:55 PM »

Hi!

Is there an existing data object for the client I could use in the pre-calculate field of a form? If yes how would I access it?
I would need at least the current client ID so I can query the database for the detailed data?

Thank you in advance.

Regards
Carsten
Logged
netshine
Administrator
Hero Member
*****
Offline Offline

Posts: 4,563


View Profile
« Reply #1 on: 02/February/2012, 05:04:05 PM »

At the time the pre-calculate is called, there might not be a client at all. If there is an existing client, the entity ID would normally be posted in $_POST['nbill_entity_id'] (and you would need to load the rest of the data from the database), but if a new user is signing up on an order form, that will not be populated. If you do use the posted ID value, beware: the value can easily be spoofed. You would have to verify that it belongs to the currently logged in user. So I guess the answer is no! There is no easy way!
« Last Edit: 02/February/2012, 05:05:47 PM by netshine » Logged
deckard
Jr. Member
**
Offline Offline

Posts: 15


View Profile
« Reply #2 on: 02/February/2012, 06:11:02 PM »

Ok, I will go from the currently logged-in user then. Well, it maybe a suggestion for future version to provide this some easier way Wink.

Thank you!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!