-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprintcoupon.php
More file actions
48 lines (44 loc) · 1.7 KB
/
printcoupon.php
File metadata and controls
48 lines (44 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting source code
* which is considered copyrighted (c) material of the original comment or credit authors.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
* @copyright {@link https://xoops.org/ XOOPS Project}
* @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU GPL 2 or later}
* @package efqdirectory
* @since
* @author Martijn Hertog (aka wtravel)
* @author XOOPS Development Team,
*/
include __DIR__ . '/../../mainfile.php';
include XOOPS_ROOT_PATH . '/header.php';
$moduleDirName = basename(__DIR__);
$coupid = isset($_GET['coupid']) ? (int)$_GET['coupid'] : 0;
if (!($coupid > 0)) {
redirect_header('index.php');
}
/**
* @param $coupid
*/
function PrintPage($coupid)
{
global $xoopsModule, $xoopsTpl, $xoopsModuleConfig, $moduleDirName;
$couponHandler = xoops_getModuleHandler('coupon', $moduleDirName);
$couponHandler->increment($coupid);
$coupon = $couponHandler->getLinkedCoupon($coupid);
$coupon_arr = $couponHandler->prepare2show($coupon);
//$xoopsTpl->assign('coupon_footer', $xoopsModuleConfig['coupon_footer']);
$xoopsTpl->assign('coupon', $coupon_arr['items']['coupons'][0]);
$xoopsTpl->template_dir = XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->dirname();
$xoopsTpl->display('db:efqdiralpha1_print_savings.tpl');
}
//Smarty directory autodetect
$smartydir = $moduleDirName;
$xoopsTpl->assign('smartydir', $smartydir);
PrintPage($coupid);