X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-sponsor_infos.php;h=5adb08c67f9d087f376e11b0c4392cb8e673afe7;hb=4f7df133f736da124e6f7bd02008b9093f736451;hp=f172a5abfc502c1950bc1a4300f0004602f7bdac;hpb=3daede4c904e23905c3e48dd6749019deca0a0e0;p=mailer.git diff --git a/inc/modules/guest/what-sponsor_infos.php b/inc/modules/guest/what-sponsor_infos.php index f172a5abfc..5adb08c67f 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; - while (list($title, $conv, $name) = SQL_FETCHROW($result_act)) { - // Prepare data for the row template - $content = array( - 'sw' => $SW, - 'title' => $title, - 'conv' => round($conv), - 'name' => $name, - ); - + $OUT_ACT = ''; + while ($content = SQL_FETCHARRAY($result_act)) { // Load row template and switch color - $OUT_ACT .= LOAD_TEMPLATE("guest_sponsor_act_row", true, $content); - $SW = 3 - $SW; + $OUT_ACT .= loadTemplate('guest_sponsor_act_row', TRUE, $content); } // 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; - while (list($name, $rate, $min, $curr) = SQL_FETCHROW($result_pay)) { - // Prepare data for the row template - $content = array( - 'sw' => $SW, - 'name' => $name, - 'rate' => TRANSLATE_COMMA($rate), - 'min' => $min, - 'curr' => $curr, - 'price' => TRANSLATE_COMMA($min), - ); - + $OUT_PAY = ''; + while ($content = SQL_FETCHARRAY($result_pay)) { // Load row template and switch color - $OUT_PAY .= LOAD_TEMPLATE("guest_sponsor_pay_row", true, $content); - $SW = 3 - $SW; - } + $OUT_PAY .= loadTemplate('guest_sponsor_pay_row', TRUE, $content); + } // END - while } else { // No pay types setuped so far! - $OUT_PAY = " - ".LOAD_TEMPLATE("admin_settings_saved", true, 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 = " - ".LOAD_TEMPLATE("admin_settings_saved", true, SPONSOR_NO_ACTIONS_ACTIVATED)." -"; - $OUT_PAY = " - ".LOAD_TEMPLATE("admin_settings_saved", true, 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)); } -// Transfer rows to constans -define('__SPONSOR_ACTIONS' , $OUT_ACT); -define('__SPONSOR_PAYTYPES', $OUT_PAY); - // Free memory -if (isset($result_act)) SQL_FREERESULT($result_act); -if (isset($result_pay)) SQL_FREERESULT($result_pay); +SQL_FREERESULT($result_act); +SQL_FREERESULT($result_pay); + +// Transfer rows to an array +$content = array( + 'actions' => $OUT_ACT, + 'paytypes' => $OUT_PAY +); // Load main template -LOAD_TEMPLATE("guest_sponsor_infos"); +loadTemplate('guest_sponsor_infos', FALSE, $content); -// +// [EOF] ?>