Get PIN field from user profile
This commit is contained in:
parent
599adda141
commit
0b97efcbd5
1 changed files with 4 additions and 1 deletions
|
@ -25,6 +25,7 @@
|
|||
namespace mod_htmlcert;
|
||||
|
||||
require_once(__DIR__ . "/../vendor/autoload.php");
|
||||
require_once($CFG->dirroot.'/user/profile/lib.php');
|
||||
|
||||
use mikehaertl\wkhtmlto\Pdf;
|
||||
|
||||
|
@ -117,6 +118,8 @@ class template {
|
|||
$user = \core_user::get_user($userid);
|
||||
}
|
||||
|
||||
profile_load_data($user);
|
||||
|
||||
$htmlcert = $DB->get_record('htmlcert', ['templateid' => $this->id]);
|
||||
|
||||
$pdf = new Pdf(array(
|
||||
|
@ -173,7 +176,7 @@ class template {
|
|||
|
||||
$html = str_replace("__DATE__", userdate($date, '%B %d, %Y'), $html);
|
||||
|
||||
$html = str_replace("__PIN__", $user->profile["pin"], $html);
|
||||
$html = str_replace("__PIN__", $user->profile_field_pin, $html);
|
||||
|
||||
$pdf->addPage($html);
|
||||
$pdf->send();
|
||||
|
|
Loading…
Reference in a new issue