forked from septor/anteup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
donations.php
62 lines (56 loc) · 1.62 KB
/
donations.php
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
/*
* AnteUp - A Donation Tracking Plugin for e107
*
* Copyright (C) 2012-2015 Patrick Weaver (http://trickmod.com/)
* For additional information refer to the README.mkd file.
*
*/
require_once("../../class2.php");
require_once(HEADERF);
require_once(e_PLUGIN."anteup/_class.php");
e107::lan('anteup');
$pref = e107::pref('anteup');
if(check_class($pref['anteup_pageviewclass']))
{
if(isset($_POST['filterDates']))
{
$startDate = strtotime($_POST['startDate']);
$endDate = strtotime($_POST['endDate']);
}
else
{
$startDate = strtotime($pref['anteup_lastdue']);
$endDate = strtotime($pref['anteup_due']);
}
$sql = e107::getDb();
$tp = e107::getParser();
$sc = e107::getScBatch('anteup', true);
$frm = e107::getForm();
$template = e107::getTemplate('anteup');
$template = array_change_key_case($template);
$entries = $sql->retrieve('anteup_ipn', '*', 'payment_date > '.$startDate.' AND payment_date < '.$endDate, true);
$sc->setVars(array($startDate, $endDate));
$text = $tp->parseTemplate($template['donations']['filter'], false, $sc);
if($entries)
{
$text .= $tp->parseTemplate($template['donations']['start'], false, $sc);
foreach($entries as $entry)
{
$sc->setVars($entry);
$text .= $tp->parseTemplate($template['donations']['entry'], false, $sc);
}
$text .= $tp->parseTemplate($template['donations']['end'], false, $sc);
}
else
{
$text .= "<div style='text-align:center;'>".LAN_ANTEUP_DONATIONS_07."</div>";
}
}
else
{
$text = "<div style='text-align:center;'>".LAN_ANTEUP_DONATIONS_08."</div>";
}
e107::getRender()->tablerender(LAN_ANTEUP_DONATIONS_TITLE, $text);
require_once(FOOTERF);
?>