$NAV = '';
for ($page = 1; $page <= $PAGES; $page++) {
// Is the page currently selected or shall we generate a link to it?
- if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET(('page'))) && ($page == "1"))) {
+ if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET('page')) && ($page == "1"))) {
// Is currently selected, so only highlight it
$NAV .= "<strong>-";
} else {
$NAV .= "\">";
}
$NAV .= $page;
- if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET(('page'))) && ($page == "1"))) {
+ if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET('page')) && ($page == "1"))) {
// Is currently selected, so only highlight it
$NAV .= "-</strong>";
} else {
if ((REQUEST_ISSET_POST(('mysql'))) && (is_array(REQUEST_POST('mysql')))) $mysql = REQUEST_POST('mysql');
// Check if both passwords from SMTP are matching
-if ((REQUEST_ISSET_GET(('page')) && (REQUEST_GET('page') == 5))) {
+if ((REQUEST_ISSET_GET('page') && (REQUEST_GET('page') == 5))) {
// Okay, we have to check it
if (REQUEST_ISSET_POST(('smtp_user')) && (!REQUEST_ISSET_POST(('smtp_host')))) {
// Hostname not set
// Add links for selecting some users
function alpha ($sortby, $colspan, $return=false) {
- if (!REQUEST_ISSET_GET(('offset'))) REQUEST_SET_GET('offset', 0);
- $add = "&page=".REQUEST_GET(('page'))."&offset=".REQUEST_GET(('offset'));
+ if (!REQUEST_ISSET_GET('offset')) REQUEST_SET_GET('offset', 0);
+ $add = "&page=".REQUEST_GET('page')."&offset=".REQUEST_GET('offset');
if (REQUEST_ISSET_GET(('mode'))) $add .= "&mode=".REQUEST_GET(('mode'));
/* Creates the list of letters and makes them a link. */
// Add links for sorting
function SortLinks ($letter, $sortby, $colspan, $return=false) {
$OUT = '';
- if (!REQUEST_ISSET_GET(('offset'))) REQUEST_SET_GET('offset', 0);
- if (!REQUEST_ISSET_GET(('page'))) REQUEST_SET_GET('page' , 0);
+ if (!REQUEST_ISSET_GET('offset')) REQUEST_SET_GET('offset', 0);
+ if (!REQUEST_ISSET_GET('page')) REQUEST_SET_GET('page' , 0);
// Add page and offset
- $add = "&page=".REQUEST_GET(('page'))."&offset=".REQUEST_GET(('offset'));
+ $add = "&page=".REQUEST_GET('page')."&offset=".REQUEST_GET('offset');
// Add status or mode
if (REQUEST_ISSET_GET(('status'))) $add .= "&mode=".REQUEST_GET(('status'));
$OUT = '';
for ($page = 1; $page <= $PAGES; $page++) {
- if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET(('page'))) && ($page == "1"))) {
+ if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET('page')) && ($page == "1"))) {
$OUT .= "<strong>-";
} else {
if (!REQUEST_ISSET_GET(('letter'))) REQUEST_SET_GET('letter', getMessage('_ALL2'));
$OUT .= $page;
- if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET(('page'))) && ($page == "1"))) {
+ if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET('page')) && ($page == "1"))) {
$OUT .= "-</strong>";
} else {
$OUT .= "</a>";
__FILE__, __LINE__);
// Process all entries
- while ($content = SQL_FETCHROW($result_main)) {
+ while ($content = SQL_FETCHARRAY($result_main)) {
// Remove depth to prevent booking errors. This is a bad coding
// practice, thats also why we need to write this project from
// scratch...
// Remove double eintries
// @TODO This can be somehow rewritten to a function
$prev = ''; $dmy = $menus; $dmy2 = $titles; $dmy3 = $below;
- foreach ($menus as $key => $value)
- {
- if ($value == $prev)
- {
+ foreach ($menus as $key => $value) {
+ if ($value == $prev) {
unset($dmy[$key]);
unset($dmy2[$key]);
unset($dmy3[$key]);
- }
- else
- {
+ } else {
$prev = $value;
}
- }
- $menus = $dmy; $titles = $dmy2; $below = $dmy3;
+ } // END - foreach
+
+ // Write dummys back to our array
+ $menus = $dmy; unset($dmy);
+ $titles = $dmy2; unset($dmy2);
+ $below = $dmy3; unset($dmy3);
+
// Load sub menus :)
foreach ($menus as $key_main => $value_main) {
$result = SQL_QUERY_ESC("SELECT what, title, sort FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`",
$below[$value_main] = array();
// Read menu structure
- while ($content = SQL_FETCHROW($result)) {
+ while ($content = SQL_FETCHARRAY($result)) {
// Menu actions
- $menus[$value_main][] = $content['action'];
+ $menus[$value_main][] = $content['what'];
// Menu titles
$titles[$value_main][] = $content['title'];
$result_normal = SQL_QUERY($sql, __FILE__, __LINE__);
// Set offset an current page to default values
-if (!REQUEST_ISSET_GET(('page'))) REQUEST_GET('page') = "1";
-if (!REQUEST_ISSET_GET(('offset'))) REQUEST_SET_GET('offset', getConfig('mails_page'));
+if (!REQUEST_ISSET_GET('page')) REQUEST_SET_GET('page' , "1");
+if (!REQUEST_ISSET_GET('offset')) REQUEST_SET_GET('offset', getConfig('mails_page'));
// Add limitation to SQL string
$sql .= " LIMIT ".(REQUEST_GET('offset') * REQUEST_GET('page') - REQUEST_GET('offset')).", ".REQUEST_GET('offset');
$PAGES = round(SQL_NUMROWS($result_normal) / getConfig('mails_page') + 0.5);
SQL_FREERESULT($result_normal);
-if (SQL_NUMROWS($result) > 0)
-{
+if (SQL_NUMROWS($result) > 0) {
// Mail orders are in pool so we can display them
// Add navigation table rows
- if ($PAGES > 1)
- {
+ if ($PAGES > 1) {
define('__TOP_EMAIL_NAV' , ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), true , "3", true));
define('__BOTTOM_EMAIL_NAV', ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), false, "3", true));
- }
- else
- {
+ } else {
define('__TOP_EMAIL_NAV' , '');
define('__BOTTOM_EMAIL_NAV', '');
}
$OUT = ''; $SW = 2;
- while ($pool = SQL_FETCHROW($result))
- {
+ while ($pool = SQL_FETCHROW($result)) {
// Check sent mails and clicks
$result_mails = SQL_QUERY_ESC("SELECT max_rec, clicks FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE pool_id=%s LIMIT 1",
- array(bigintval($pool[0])), __FILE__, __LINE__);
+ array(bigintval($pool[0])), __FILE__, __LINE__);
list($sent, $clicks) = SQL_FETCHROW($result_mails);
SQL_FREERESULT($result_mails);
// Unconfirmed mails
$unconfirmed = $sent - $clicks;
- if ($unconfirmed > 0)
- {
+ if ($unconfirmed > 0) {
// Add link to list_unconfirmed what-file
$unconfirmed = "<strong><a href=\"{!URL!}/modules.php?module=admin&what=list_unconfirmed&mid=".$pool[0]."\">".$unconfirmed."</a></strong>";
}
// No mail orders fond
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_NO_MAILS_IN_POOL'));
}
+
//
?>
$SQL2 = '';
// Set offset an current page to default values
-if (!REQUEST_ISSET_GET(('page'))) REQUEST_GET('page') = "1";
-if (!REQUEST_ISSET_GET(('offset'))) REQUEST_SET_GET('offset', getConfig('mails_page'));
+if (!REQUEST_ISSET_GET('page')) REQUEST_GET('page') = "1";
+if (!REQUEST_ISSET_GET('offset')) REQUEST_SET_GET('offset', getConfig('mails_page'));
if ((EXT_IS_ACTIVE('bonus')) && ($WHO == getMessage('_ALL'))) {
// Bonus mails sent by you
if (SQL_NUMROWS($result) > 0) {
// List found payouts
$OUT = ''; $SW = 2;
- while ($content = SQL_FETCHROW($result)) {
+ while ($content = SQL_FETCHARRAY($result)) {
if ($content['status'] == "NEW") {
// Generate links for direct accepting and rejecting
$content['status'] = "<a href=\"{!URL!}/modules.php?module=admin&what=list_payouts&do=accept&pid=".$content['id']."\">".PAYOUT_ACCEPT_PAYOUT."</a> | <a href=\"{!URL!}/modules.php?module=admin&what=list_payouts&do=reject&pid=".$content['id']."\">".PAYOUT_REJECT_PAYOUT."</a>";
// Init unset data (bad that we change $_GET here!)
if (!REQUEST_ISSET_GET(('letter'))) { REQUEST_SET_GET('letter', getMessage('_ALL2')); }
if (!REQUEST_ISSET_GET(('sortby'))) { REQUEST_SET_GET('sortby', 'userid'); }
-if (!REQUEST_ISSET_GET(('page'))) { REQUEST_SET_GET('page' , "1"); }
+if (!REQUEST_ISSET_GET('page')) { REQUEST_SET_GET('page' , "1"); }
// Set base URL
$BASE = "[<a href=\"{!URL!}/modules.php?module=admin";
// Activate the extension please!
$PAGES = round(SQL_NUMROWS($result_master) / getConfig('user_limit') + 0.5);
- if (!REQUEST_ISSET_GET(('page'))) REQUEST_SET_GET('page' , "1");
- if (!REQUEST_ISSET_GET(('offset'))) REQUEST_SET_GET('offset', getConfig('user_limit'));
+ if (!REQUEST_ISSET_GET('page')) REQUEST_SET_GET('page' , "1");
+ if (!REQUEST_ISSET_GET('offset')) REQUEST_SET_GET('offset', getConfig('user_limit'));
// Add limitation to SQL string and run him again
$sql .= " LIMIT ".(REQUEST_GET('offset') * REQUEST_GET('page') - REQUEST_GET('offset')).", ".REQUEST_GET('offset');
if (SQL_NUMROWS($result_main) == 1) {
// Load data
- $content = SQL_FETCHROW($result_main);
+ $content = SQL_FETCHARRAY($result_main);
// Check for open payments and close them
$result = SQL_QUERY_ESC("SELECT DISTINCT so.aid, so.pay_count, so.pay_ordered, so.pay_status,