X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-sponsor_infos.php;h=cc3966051d1466c0b37c610a37b4b09054fdefdb;hb=ee3a0b42f93de7676fca549c866c1c2e6f3f0576;hp=0e72d18acef6410710ec96c0c79546d41486d6a2;hpb=64c8349613addc3da2242c5cd6b99d64e3fb5f8e;p=mailer.git diff --git a/inc/modules/guest/what-sponsor_infos.php b/inc/modules/guest/what-sponsor_infos.php index 0e72d18ace..cc3966051d 100644 --- a/inc/modules/guest/what-sponsor_infos.php +++ b/inc/modules/guest/what-sponsor_infos.php @@ -1,7 +1,7 @@ 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', __FILE__, __LINE__); - if (SQL_NUMROWS($result_pay) > 0) { + $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_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 - // @TODO Rewritings: name->pay_name,min->pay_min_count,min->pay_min_count,curr->pay_currency - $content = array( - 'sw' => $SW, - 'name' => $content['pay_name'], - 'rate' => translateComma($content['pay_rate']), - 'min' => $content['pay_min_count'], - 'curr' => $content['pay_currency'], - 'price' => translateComma($content['pay_min_count']), - ); - // 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, displayMessage('{--SPONSOR_NO_ACTIONS_ACTIVATED--}', true)); } } 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, displayMessage('{--SPONSOR_NO_ACTIONS_ACTIVATED--}', true)); + $OUT_PAY = loadTemplate('guest_sponsor_infos_none_row', true, displayMessage('{--SPONSOR_NO_ACTIONS_ACTIVATED--}', true)); } // Free memory