X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-sponsor_infos.php;h=8f38abf6583a3dba4fde45430dd9afca32ddced9;hp=28019f4e7c03115a4ce4597b7058c319d4570144;hb=27272fdaa3ad8895e6b55ec77658ad5c1f80e89c;hpb=8f14df8c3232a31917df0ac57363dbd6e975c147 diff --git a/inc/modules/guest/what-sponsor_infos.php b/inc/modules/guest/what-sponsor_infos.php index 28019f4e7c..8f38abf658 100644 --- a/inc/modules/guest/what-sponsor_infos.php +++ b/inc/modules/guest/what-sponsor_infos.php @@ -55,52 +55,49 @@ $result_act = false; $result_pay = false; // Load all sponsor actions -$result_act = SQL_QUERY("SELECT m.title, c.conv_rate, c.conv_name -FROM `{?_MYSQL_PREFIX?}_sponsor_menu` AS m -LEFT JOIN `{?_MYSQL_PREFIX?}_sponsor_action_convert` AS c ON m.what=c.ext_name -LEFT JOIN `{?_MYSQL_PREFIX?}_sponsor_registry` AS r ON m.what=r.ext_name -WHERE m.`action`='actions' AND r.is_active='Y' -ORDER BY m.sort ASC", __FILE__, __LINE__); +$result_act = SQL_QUERY("SELECT + m.title AS `conv_title`, c.conv_rate, c.conv_name +FROM + `{?_MYSQL_PREFIX?}_sponsor_menu` AS m +LEFT JOIN + `{?_MYSQL_PREFIX?}_sponsor_action_convert` AS c +ON + m.what=c.ext_name +LEFT JOIN + `{?_MYSQL_PREFIX?}_sponsor_registry` AS r +ON + m.what=r.ext_name +WHERE + m.`action`='actions' AND + r.is_active='Y' +ORDER BY + m.sort ASC", __FILE__, __LINE__); -if (SQL_NUMROWS($result_act) > 0) { +if (!SQL_HASZERONUMS($result_act)) { // Load all actions - $OUT_ACT = ''; $SW = 2; + $OUT_ACT = ''; while ($content = SQL_FETCHARRAY($result_act)) { - // Prepare data for the row template - // @TODO Rewritings: conv->conv_rate,name->conv_name in template - $content = array( - 'sw' => $SW, - 'title' => $content['title'], - 'conv' => round($content['conv_rate']), - 'name' => $content['conv_name'], - ); - // Load row template and switch color $OUT_ACT .= loadTemplate('guest_sponsor_act_row', true, $content); - $SW = 3 - $SW; } // END - while // Check for pay types $result_pay = SQL_QUERY('SELECT `pay_name`, `pay_rate`, `pay_min_count`, `pay_currency` FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` ORDER BY `pay_name` ASC', __FILE__, __LINE__); - if (SQL_NUMROWS($result_pay) > 0) { + if (!SQL_HASZERONUMS($result_pay)) { // Load all pay types - $OUT_PAY = ''; $SW = 2; + $OUT_PAY = ''; while ($content = SQL_FETCHARRAY($result_pay)) { - // Prepare data for the row template - $content['sw'] => $SW; - // Load row template and switch color $OUT_PAY .= loadTemplate('guest_sponsor_pay_row', true, $content); - $SW = 3 - $SW; - } + } // END - while } else { // No pay types setuped so far! - $OUT_PAY = loadTemplate('guest_sponsor_infos_none_row', loadTemplate('admin_settings_saved', true, getMessage('SPONSOR_NO_ACTIONS_ACTIVATED'))); + $OUT_PAY = loadTemplate('guest_sponsor_infos_none_row', false, loadTemplate('admin_settings_saved', true, '{--SPONSOR_NO_ACTIONS_ACTIVATED--}')); } } else { // No actions activated so far! - $OUT_ACT = loadTemplate('guest_sponsor_infos_none_row', loadTemplate('admin_settings_saved', true, getMessage('SPONSOR_NO_ACTIONS_ACTIVATED'))); - $OUT_PAY = loadTemplate('guest_sponsor_infos_none_row', loadTemplate('admin_settings_saved', true, getMessage('SPONSOR_NO_ACTIONS_ACTIVATED'))); + $OUT_ACT = loadTemplate('guest_sponsor_infos_none_row', true, loadTemplate('admin_settings_saved', true, '{--SPONSOR_NO_ACTIONS_ACTIVATED--}')); + $OUT_PAY = loadTemplate('guest_sponsor_infos_none_row', true, loadTemplate('admin_settings_saved', true, '{--SPONSOR_NO_ACTIONS_ACTIVATED--}')); } // Free memory