Exemplo n.º 1
0
} else {
    $theguestid = $request->GetVar('frm_theguestid', 'get');
    $start = $request->GetVar('frm_start', 'get');
    $end = $request->GetVar('frm_end', 'get');
    $guestarticles = $kassacls->getTimeline($theguestid, $start, $end, 'ASC', $cats);
    $table = '\\trowd\\trgaph10\\trleft-10\\trrh301\\trpaddl10\\trpaddr10\\trpaddfl3\\trpaddfr3\\clbrdrb\\brdrw10\\brdrs \\cellx830\\clbrdrb\\brdrw10\\brdrs \\cellx3420\\clbrdrb\\brdrw10\\brdrs \\cellx4662\\clbrdrb\\brdrw10\\brdrs \\cellx5904\\clbrdrb\\brdrw10\\brdrs \\cellx7145\\clbrdrb\\brdrw10\\brdrs \\cellx8387\\clbrbrb\\brdrw10\\brdrs \\cellx9629\\pard\\intbl\\nowidctlpar\\b Anzahl\\b0\\cell\\b Artikel\\b0\\cell\\b Datum\\b0\\cell\\b\\qr Preis\\b0\\cell\\b Total\\b0\\cell\\b Bezahlt\\cell Datum\\cell\\row';
    for ($i = 0; $i < count($guestarticles); $i++) {
        if ($i == count($guestarticles) - 2) {
            $table .= '\\trowd\\trgaph10\\trleft-10\\trrh301\\trpaddl10\\trpaddr10\\trpaddfl3\\trpaddfr3\\cellx830\\clbrdrt\\brdrw10\\brdrs \\cellx3420\\clbrdrt\\brdrw10\\brdrs \\cellx4662\\clbrdrt\\brdrw10\\brdrs \\cellx5904\\clbrdrt\\brdrw10\\brdrs \\cellx7145\\clbrdrt\\brdrw10\\brdrs \\cellx8387\\clbrdrt\\brdrw10\\brdrs\\brdrw10\\brdrs \\cellx9629\\pard\\intbl\\nowidctlpar\\cell\\cell\\cell\\pard\\intbl\\nowidctlpar\\qr\\b Summe:\\cell ' . $guestarticles[$i]['total1'] . ' \\\'80\\cell ' . $guestarticles[$i]['total2'] . ' \\\'80\\cell\\cell\\b0\\row';
        } elseif ($i == count($guestarticles) - 1) {
            $table .= '\\trowd\\trgaph10\\trleft-10\\trrh301\\trpaddl10\\trpaddr10\\trpaddfl3\\trpaddfr3\\cellx830\\cellx3420\\cellx4662\\cellx5904\\cellx7145\\cellx8387\\brdrw10\\brdrs\\brdrw10\\brdrs \\cellx9629\\pard\\intbl\\nowidctlpar\\cell\\cell\\cell\\pard\\intbl\\nowidctlpar\\qr\\b Differenz:\\cell ' . $guestarticles[$i]['total1'] . ' \\\'80\\b0\\cell\\cell\\cell\\row\\pard\\nowidctlpar\\par';
        } else {
            $table .= '\\trowd\\trgaph10\\trleft-10\\trrh301\\trpaddl10\\trpaddr10\\trpaddfl3\\trpaddfr3\\clbrdrt\\brdrw10\\brdrs\\clbrdrb\\brdrw10\\brdrs \\cellx830\\clbrdrt\\brdrw10\\brdrs\\clbrdrb\\brdrw10\\brdrs \\cellx3420\\clbrdrt\\brdrw10\\brdrs\\clbrdrb\\brdrw10\\brdrs \\cellx4662\\clbrdrt\\brdrw10\\brdrs\\clbrdrb\\brdrw10\\brdrs \\cellx5904\\clbrdrt\\brdrw10\\brdrs\\clbrdrb\\brdrw10\\brdrs \\cellx7145\\clbrdrt\\brdrw10\\brdrs\\clbrdrb\\brdrw10\\brdrs \\cellx8387\\clbrdrt\\brdrw10\\brdrs\\clbrdrb\\brdrw10\\brdrs \\cellx9629\\pard\\intbl\\nowidctlpar\\b0 ' . $guestarticles[$i]['num'] . '\\cell ' . $guestarticles[$i]['description'] . '\\cell ' . str_replace(',', ',\\par', $guestarticles[$i]['timestamp']) . ' Uhr\\cell\\pard\\intbl\\nowidctlpar\\qr ' . $guestarticles[$i]['price'] . ' \\\'80\\cell ' . $guestarticles[$i]['total1'] . ' \\\'80\\cell ' . $guestarticles[$i]['total2'] . ' \\\'80\\cell ' . str_replace(',', ',\\par', $guestarticles[$i]['updated']) . ' \\cell\\row';
        }
    }
}
// get RTF-Template
$tplfile = selectfile('tpl_receipt.rtf');
// $tplfile = 'C:\wwwroot\zvs\default\tpl_meldeschein.rtf';
$tplHandle = fopen($tplfile, 'r');
$tpl = fread($tplHandle, filesize($tplfile));
fclose($tplHandle);
// replace placeholders
$tpl = ereg_replace("%test%", $table, $tpl);
$tpl = ereg_replace("%name%", $barguest->getName($theguestid), $tpl);
$tpl = ereg_replace("%date%", date("d.m.Y"), $tpl);
// show RTF-File
header("Cache-control: private");
header("Content-type: application/rtf");
header("Content-Disposition: attachment; filename=\"bon.rtf\"");
echo $tpl;
Exemplo n.º 2
0
* 
* 01/06/2004 by Christian Ehret chris@uffbasse.de
*/
$smartyType = "www";
include_once "../includes/default.inc.php";
$auth->is_authenticated();
$smarty->assign("tpl_title", "Liste &uuml;ber Zeitraum erstellen");
$smarty->assign("tpl_title", "Archiv");
$smarty->assign('tpl_nav', 'archive');
$smarty->assign('tpl_subnav', '');
$theguestid = $request->GetVar('guestid', 'get');
include_once "kassaclass.inc.php";
$kassacls = new Kassa();
include_once "barguestclass.inc.php";
$barguest = new Barguest();
if ($request->GetVar('frm_start', 'get') !== $request->undefined) {
    include_once 'articlecatclass.inc.php';
    $articlecat = new articlecat();
    $allcats = $articlecat->getall();
    for ($i = 0; $i < count($allcats); $i++) {
        $cats[$i] = $allcats[$i]['articlecatid'];
    }
    $theguestid = $request->GetVar('frm_theguestid', 'get');
    $start = $request->GetVar('frm_start', 'get');
    $end = $request->GetVar('frm_end', 'get');
    $guestarticles = $kassacls->getTimeline($theguestid, $start, $end, 'ASC', $cats);
    $smarty->assign('tpl_guestarticles', $guestarticles);
}
$smarty->assign('tpl_guest', $barguest->getName($theguestid));
$smarty->assign('tpl_theguestid', $theguestid);
$smarty->display('selectreceipt2.tpl');
Exemplo n.º 3
0
} else {
    $cat = "verkauf" . $cats[0]['articlecatid'];
}
if ($request->GetVar('showlast', 'get') !== $request->undefined) {
    $smarty->assign('tpl_showlast', 'true');
}
if ($request->GetVar('frm_articleid', 'post') !== $request->undefined) {
    $articleid = $request->GetVar('frm_articleid', 'post');
    $theguestid = $request->GetVar('guestid', 'get');
    $num = $request->GetVar('frm_num', 'post');
    $barguest->buy($articleid, $theguestid, $num);
    $smarty->assign('tpl_showlast', 'true');
}
if ($request->GetVar('guestid', 'get') !== $request->undefined) {
    $theguestid = $request->GetVar('guestid', 'get');
    $theguest = $barguest->getName($theguestid);
    $thegroupcolor = $barguest->getGroupColor($theguestid);
    $thebookingcat = $barguest->getBookingcat($theguestid);
    include_once "articleclass.inc.php";
    $articlecls = new Article();
    //$articles = $articlecls->Getall(true);
    $articles = array();
    for ($i = 0; $i < count($cats); $i++) {
        $cats[$i]['articles'] = $articlecls->Getallcat(true, $cats[$i]['articlecatid']);
    }
    $smarty->assign('tpl_articles', $articles);
    include_once "kassaclass.inc.php";
    $kassacls = new Kassa();
    if ($request->GetVar('frm_checkout', 'post') == "true") {
        $payids = $request->getVar('payid', 'post');
        for ($i = 0; $i < count($payids); ++$i) {