$invoice['terms'] = $invoice['terms'] ? $invoice['terms'] : ($client['def_terms'] ? $client['def_terms'] : ($admin['def_terms'] ? $admin['def_terms'] : $lang['terms'])); $invoice['comments'] = $invoice['comments'] ? $invoice['comments'] : ($client['def_comments'] ? $client['def_comments'] : ($admin['def_comments'] ? $admin['def_comments'] : '')); $invoice['due_date'] = date($SYSTEM["regional"]["invoicedate"], $invoice['due_date']); $invoice['issue_date'] = date($SYSTEM["regional"]["invoicedate"], $invoice['issue_date']); $invoice['calc_tax'] = currency_format($invoice['calc_tax']); $invoice['calc_tax2'] = currency_format($invoice['calc_tax2']); $invoice['shipping'] = currency_format($invoice['shipping']); $invoice['cost'] = currency_format($invoice['cost']); $invoice['total'] = currency_format($invoice['total']); $emailSendID = $ISL->addEmailSend($invoice['clientid'], $invoiceID, $client['email'], 1); $e = new Emailer(); $e->setMainFile('forms/email_invoice.tpl'); $e->setFrom($SYSTEM['email']['from']); $e->setFromName($SYSTEM['email']['fromName']); $e->setSubject($lang['eml_subj_invoice']); $e->set('SYSTEM', $SYSTEM); $e->set('invoice', $invoice); $e->set('client', $client); $e->set('admin', $admin); $ispayed = strtolower($invoice['curr_status']) == 'fully paid' ? true : false; $e->set('ispayed', $ispayed); $e->fetchMessage(); $e->appendMessage('<img src="' . HTTP_ROOT . 'isop.php?sid=' . $emailSendID . '" width="1" height="1">'); $e->setRecipient($client['email']); $e->setPriority('High'); $result = $e->send(); unset($e); $result = $result ? 'Successful' : 'Failed'; if ($invoice['curr_status'] == 'unsent') { $ISL->UpdateInvoiceStatus($invoiceID, 'pending'); }
if (isset($_POST['btnSubmit'])) { if ($_POST['email'] != '') { $method = 'email'; $value = $_POST['email']; } elseif ($_POST['username'] != '') { $method = 'username'; $value = $_POST['username']; } $client = $ISL->recoverPassword($method, $value); if (is_array($client)) { $e = new Emailer(); $e->setMainFile('forms/email_forgotpass.tpl'); $e->setFrom($SYSTEM['email']['from']); $e->setFromName($SYSTEM['email']['fromName']); $e->setSubject($lang['eml_subj_forgotpass']); $e->set('client', $client); $e->fetchMessage(); $e->setRecipient($client['email']); $e->setPriority('High'); $e->send(); unset($e); } else { trigger_error($lang['no_client_found'], E_USER_WARNING); die; } $tpl->set('tbody', 'forgotpass_sent.tpl'); $tpl->set('message', sprintf($lang['password_sent'], 'index.php')); } else { $tpl->set('tbody', 'forgotpass.tpl'); } $tpl->set('toptext', $lang['password_recovery']);