Exemplo n.º 1
0
     mysql_query("INSERT INTO `entry_invoiced` (`entry_id` , `invoiced_id`) VALUES ('" . $entry['entry_id'] . "', '" . $invoiced_id . "');");
     // Updating invoice status
     mysql_query("UPDATE `entry` " . "SET " . "`invoice_status` = '3', " . "`user_last_edit` = '" . $login['user_id'] . "', " . "`time_last_edit` = '" . time() . "', " . "`rev_num` = '{$rev_num}', " . "`invoice_exported_time` = '" . time() . "' " . " WHERE `entry_id` = '" . $entry['entry_id'] . "' LIMIT 1 ;");
     $log_data = array();
     if (!newEntryLog($entry['entry_id'], 'edit', 'invoice_exported', $rev_num, $log_data)) {
     }
     if (is_null($from) || $from > $entry['time_start']) {
         $from = $entry['time_start'];
     }
     if (is_null($to) || $to < $entry['time_end']) {
         $to = $entry['time_end'];
     }
     // Generate PDF data
     $smarty = new Smarty();
     templateAssignEntry('smarty', $entry);
     templateAssignEntryChanges('smarty', $entry, $entry['rev_num']);
     templateAssignSystemvars('smarty');
     $invoicedata[] = $smarty->fetch('file:fakturagrunnlag.tpl');
 }
 if (count($entries) != 1) {
     $er = 'er';
 } else {
     $er = '';
 }
 $pdffile = 'fakturagrunnlag-' . date('Ymd-His') . '-' . count($entries) . '_booking' . $er . '.pdf';
 require_once "libs/dompdf/dompdf_config.inc.php";
 $dompdf = new DOMPDF();
 $dompdf->set_paper('A4');
 $dompdf->load_html(implode($invoicedata));
 $dompdf->render();
 file_put_contents($invoice_location . $pdffile, $dompdf->output());
Exemplo n.º 2
0
function emailSendEntryUserDeleted($entry, $rev_num, $user_id)
{
    global $smarty;
    if (!isUserDeactivated($user_id)) {
        $smarty = new Smarty();
        templateAssignEntry('smarty', $entry);
        templateAssignSystemvars('smarty');
        templateAssignEntryChanges('smarty', $entry, $rev_num);
        $message = $smarty->fetch('file:mail-entry-userdeleted.tpl');
        $subject = "[booking]" . $entry['entry_id'] . ' ' . date('d.m.Y', $entry['time_start']) . ' Ikke lenger vert - ' . $entry['entry_name'];
        emailSend($user_id, $subject, $message);
    }
}