]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/guest/what-sponsor_reg.php
We need a solution for this...
[mailer.git] / inc / modules / guest / what-sponsor_reg.php
index ee9b518b38efe78f7a3cfba164342ce7c000c618..5d12728fdf77e79491e8e05c06cd60611329e47f 100644 (file)
@@ -279,23 +279,24 @@ ORDER BY pay_name", __FILE__, __LINE__);
                // @TODO Swap this HTML code to templates
                $OUT = "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"300\" class=\"left2 right2 top2\">\n";
                $SW = 2;
-               while (list($id, $name, $rate, $curr, $min) = SQL_FETCHROW($result)) {
-                       $OUT .= "<tr>
-  <td class=\"bottom2 switch_sw".$SW."\" height=\"50\" style=\"padding-left: 2px; padding-right: 2px\">
-    <input type=\"radio\" name=\"pay_type\" class=\"guest_normal\" value=\"".bigintval($id)."\" />&nbsp;".$name."<br />
-    <div align=\"right\">(".$min." ".$curr." = ".TRANSLATE_COMMA($rate * $min)." {!POINTS!})</div>
-  </td>
-</tr>\n";
+               while ($content = SQL_FETCHARRAY($result)) {
+                       // Prepare content for output
+                       $content['sw']  = $SW;
+                       $content['res'] = TRANSLATE_COMMA($content['pay_rate'] * $content['pay_min_count']);
+
+                       // Load row template and switch color
+                       $OUT .= LOAD_TEMPLATE("guest_sponsor_payment_row", false, $content);
                        $SW = 3 - $SW;
                }
                $OUT .= "</table>\n";
+
+               // @TODO Rewrite this constant
                define('__PAYMENT_LIST', $OUT);
-               SQL_FREERESULT($result);
 
                // Check for invalid entries
-               if (count($FORM_ERRORS) > 0)
-               {
+               if (count($FORM_ERRORS) > 0) {
                        // Some found... :-(
+                       // @TODO Rewrite these constants
                        define('__COMPANY'  , COMPILE_CODE(REQUEST_POST('company')));
                        define('__POSITION' , COMPILE_CODE(REQUEST_POST('position')));
                        define('__TAX_IDENT', COMPILE_CODE(REQUEST_POST('tax_ident')));
@@ -400,7 +401,7 @@ ORDER BY pay_name", __FILE__, __LINE__);
                LOAD_TEMPLATE("guest_sponsor_reg");
        } else {
                // Nothing added so far
-               LOAD_TEMPLATE("admin_settings_saved", false, SPONSOR_PAYMENT_LIST_IS_EMPTY);
+               LOAD_TEMPLATE("admin_settings_saved", false, getMessage('SPONSOR_PAYMENT_LIST_IS_EMPTY'));
        }
 
        // Free memory