userstr = trim(strtolower($_GET['user'])); } if(isset($_GET['email'])) { $this->emailstr = trim(strtolower($_GET['email'])); } try { $this->user = $this->user_init($this->userstr, $this->emailstr); } catch(Exception $e) { $this->error = $e->getMessage(); } } protected function render_body() { $username = $this->userstr; $email = $this->emailstr; $displayname = ''; $notes = ''; $loan_table = ''; $subhead = ''; $enddate = ''; $disabled = 'disabled'; if($this->user !== null) { $username = $this->user->get_name(); $email = $this->user->get_email($this->ldap); $displayname = $this->user->get_displayname($this->ldap); $notes = $this->user->get_notes(); $enddate = format_date(default_loan_end()); $disabled = ''; $loans = $this->user->get_loans('active'); $loan_table = i18n('No active loans.'); if($loans) { $loan_table = $this->build_user_loan_table($loans); } $subhead = replace(array('title' => i18n('Borrowed products')), $this->fragments['subtitle']); } $loan_presets = $this->build_loan_preset_buttons(); print(replace(array('user' => $username, 'email' => $email, 'displayname' => $displayname, 'notes' => $notes, 'end' => $enddate, 'subtitle' => $subhead, 'disabled' => $disabled, 'loan_table' => $loan_table, 'loan_presets' => $loan_presets), $this->fragments['checkout_page'])); } } ?>