Page 1 of 1

Customize User Add page

Posted: Wed Oct 11, 2017 8:50 pm
by Dalila

hi, I need to customize the "Add user page": when I create e new user (with username and password(md5) ), before to click "ADD", I would like to print the page in pdf and customize this page with logo, other text, address and frame.

is possible to do this? and in which way?

thank a lot for help me


Re: Customize User Add page

Posted: Wed Oct 11, 2017 9:34 pm
by mobhar

Try "Custom Files" of PHPMaker and PDF PHP third-party library. Just Google for more info.


Re: Customize User Add page

Posted: Thu Oct 12, 2017 7:33 pm
by Dalila

hi,
I added pdf folder and I create e file "formpdf".php but how can I do for using this file when I add e new User (when I push "ADD" on Useradd.php file) ?

thank's again for help me


Re: Customize User Add page

Posted: Fri Oct 13, 2017 1:03 pm
by mobhar

Put this code in "Row_Inserted" server event:

$this->Page_Terminate("formpdf.php");


Re: Customize User Add page

Posted: Mon Oct 23, 2017 3:06 am
by Dalila

Thank you so mutch. I did.


Re: Customize User Add page

Posted: Sat Nov 18, 2017 12:36 am
by Dalila

Hi, when I added a customer is it possible to include username and password from user table in the formpdf?


Re: Customize User Add page

Posted: Sat Nov 18, 2017 7:12 pm
by mobhar

You may simply use CurrentUserInfo() global function which has one param as the field name, for example, you want to get the current Password user, then simply use:

if (IsLoggedIn()) {
echo "<br>Current Username: " . CurrentUserName(); // <-- or you may also use CurrentUserInfo("Username") assume the field name is "Username"
echo "<br>Current Password: " . CurrentUserInfo("Password"); // <-- assume the field name is "Password"
}


Re: Customize User Add page

Posted: Sun Nov 19, 2017 10:01 am
by Chris

Do not use CurrentUserName() or CurrentUserInfo() because this will return your own username and password, pretty sure you are not looking to print that info into a PDF for someone else.

On an add page, you will have access to the $rsnew array which contains all of your required info. Use $rsnew['required_field'] to access this info.


Re: Customize User Add page

Posted: Fri Nov 24, 2017 9:59 pm
by Dalila

I tried to add current user name and password in phpform.php but in this way:
if (IsLoggedIn()) {
echo "<br>Current Username: " . CurrentUserName("username"); // <-- or you may also use CurrentUserInfo("Username") assume the field name is "Username"
echo "<br>Current Password: " . CurrentUserInfo("password"); // <-- assume the field name is "Password"
}

But I need to call the function to use this.
How to do?

thank's a lot for your help


Re: Customize User Add page

Posted: Sat Nov 25, 2017 9:45 am
by mobhar

Make sure you have already created "phpform.php" file via "Custom Files", and you have enabled "Includes common files" for that Custom File.

Please read "Custom Files" topic from PHPMaker Help menu for more info and example.