X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_doubler.php;h=39fbab603b0f2d39a851f610ff644a27e90864c0;hb=180f978ebe21d5fcec3a51be8405028e7523e6a9;hp=b436e2ffe4b3b364fc77c1960d502c6a9ab543eb;hpb=d8148e3f1f3a6762b2e786dbe99ada269dcf2ea0;p=mailer.git
diff --git a/inc/modules/admin/what-list_doubler.php b/inc/modules/admin/what-list_doubler.php
index b436e2ffe4..39fbab603b 100644
--- a/inc/modules/admin/what-list_doubler.php
+++ b/inc/modules/admin/what-list_doubler.php
@@ -1,7 +1,7 @@
".$cnt."");
- }
- $result = SQL_QUERY("SELECT COUNT(id) FROM `{!_MYSQL_PREFIX!}_doubler` WHERE completed='Y' AND is_ref='Y'", __FILE__, __LINE__);
- list($cnt) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
-
- if ((empty($cnt)) || ($cnt == "0"))
- {
- // Nothing payed out so far
- define('__DOUBLER_ALREADY_REF_LINK', "0");
- }
- else
- {
- // Something was payed out
- $SUM_ALREADY += $cnt;
- define('__DOUBLER_ALREADY_REF_LINK', "".$cnt."");
- }
- define('__DOUBLER_ALREADY_ALL_LINK', "".$SUM_ALREADY."");
-
- // And the same for waiting pouts (direct and referal)
- $result = SQL_QUERY("SELECT COUNT(id) FROM `{!_MYSQL_PREFIX!}_doubler` WHERE completed='N' AND is_ref='N'", __FILE__, __LINE__);
- list($cnt) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
-
- if ((empty($cnt)) || ($cnt == "0"))
- {
- // Nothing payed out so far
- define('__DOUBLER_WAITING_DIRECT_LINK', "0");
- }
- else
- {
- // Something was payed out
- $SUM_WAITING += $cnt;
- define('__DOUBLER_WAITING_DIRECT_LINK', "".$cnt."");
- }
- $result = SQL_QUERY("SELECT COUNT(id) FROM `{!_MYSQL_PREFIX!}_doubler` WHERE completed='N' AND is_ref='Y'", __FILE__, __LINE__);
- list($cnt) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
-
- if ((empty($cnt)) || ($cnt == "0"))
- {
- // Nothing payed out so far
- define('__DOUBLER_WAITING_REF_LINK', "0");
- }
- else
- {
- // Something was payed out
- $SUM_WAITING += $cnt;
- define('__DOUBLER_WAITING_REF_LINK', "".$cnt."");
- }
- define('__DOUBLER_WAITING_ALL_LINK', "".$SUM_WAITING."");
-
- // All data is loaded here...
- break;
-}
+switch (getRequestParameter('mode')) {
+ case 'already': // Already payed out points
+ break;
+
+ case 'overview': // General overview page
+ // Prepare links
+ foreach (array('already_direct','already_ref','waiting_direct','waiting_ref') as $entry) {
+ $content[$entry . '_link'] = '0';
+ } // END - switch
+
+ // Init sums
+ $sumAlready = '0'; $sumWaiting = '0';
+
+ // Number of direct already payouts and referal
+ $count = countSumTotalData('Y','doubler','id','completed',true, " AND `is_ref`='N'");
+
+ if ($count > 0) {
+ // Something was payed out
+ $sumAlready += $count;
+ $content['already_direct_link'] = '' . $count . '';
+ } // END - if
+
+ $count = countSumTotalData('Y','doubler','id','completed',true, " AND `is_ref`='Y'");
+
+ if ($count > 0) {
+ // Something was payed out
+ $sumAlready += $count;
+ $content['already_ref_link'] = '' . $count . '';
+ } // END - if
+
+ // And the same for waiting pouts (direct and referal)
+ $count = countSumTotalData('N','doubler','id','completed',true, " AND `is_ref`='N'");
+
+ if ($count > 0) {
+ // Something was payed out
+ $sumWaiting += $count;
+ $content['waiting_direct_link'] = '' . $count . '';
+ } // END - if
+
+ $count = countSumTotalData('N','doubler','id','completed',true, " AND `is_ref`='Y'");
+
+ if ($count > 0) {
+ // Something was payed out
+ $sumWaiting += $count;
+ $content['waiting_ref_link'] = '' . $count . '';
+ } // END - if
+
+ // Links for all
+ $content['already_all_link'] = '' . $sumAlready . '';
+ $content['waiting_all_link'] = '' . $sumWaiting . '';
+
+ // All data is loaded here...
+ break;
+} // END - switch
// Load mode template
-LOAD_TEMPLATE("admin_list_doubler_".REQUEST_GET('mode'));
+loadTemplate('admin_list_doubler_' . getRequestParameter('mode'), false, $content);
-//
+// [EOF]
?>