X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_sponsor.php;h=f7c4601ce9830e45a4af6c2722cd5e2536bff177;hp=569ff0e1d08e54935f3e82dae9802a36110c440d;hb=4001187f22197f55e5a1f211fc8defcc180f7c32;hpb=d8148e3f1f3a6762b2e786dbe99ada269dcf2ea0 diff --git a/inc/modules/admin/what-list_sponsor.php b/inc/modules/admin/what-list_sponsor.php index 569ff0e1d0..f7c4601ce9 100644 --- a/inc/modules/admin/what-list_sponsor.php +++ b/inc/modules/admin/what-list_sponsor.php @@ -65,6 +65,7 @@ WHERE id='%s' LIMIT 1", if (empty($orders)) $orders = 0; // Prepare all data for the template + // @TODO Rewrite this huge amount of constants // Sponsor's ID define('__SPONSOR_ID' , REQUEST_GET('id')); // Company's data @@ -144,20 +145,21 @@ FROM `{!_MYSQL_PREFIX!}_sponsor_data` ORDER BY `id`", __FILE__, __LINE__); if (SQL_NUMROWS($result_main) > 0) { // At least one sponsor found! $OUT = ""; $SW = 2; - while (list($id, $gender, $sname, $fname, $email, $status, $created, $last, $amount, $used, $ip) = SQL_FETCHROW($result_main)) { + while ($content = SQL_FETCHARRAY($result_main)) { // Transfer data to array + // @TODO Rewritings: sname->surname,fname->family,ip->remote_addr in template $content = array( - 'id' => $id, + 'id' => $content['id'], 'sw' => $SW, - 'gender' => TRANSLATE_GENDER($gender), - 'sname' => $sname, - 'fname' => $fname, - 'email' => "mailto:".$email, - 'status' => SPONSOR_TRANSLATE_STATUS($status), - 'created' => MAKE_DATETIME($created, "2"), - 'last' => MAKE_DATETIME($last, "2"), - 'points' => TRANSLATE_COMMA($amount - $used), - 'ip' => $ip, + 'gender' => TRANSLATE_GENDER($content['gender']), + 'sname' => $content['surname'], + 'fname' => $content['family'], + 'email' => "mailto:".$content['email'], + 'status' => SPONSOR_TRANSLATE_STATUS($content['status']), + 'created' => MAKE_DATETIME($content['sponsor_created'], "2"), + 'last' => MAKE_DATETIME($content['last_online'], "2"), + 'points' => TRANSLATE_COMMA($content['points_amount'] - $content['points_used']), + 'ip' => $content['remote_addr'], ); // Load row template @@ -167,6 +169,8 @@ FROM `{!_MYSQL_PREFIX!}_sponsor_data` ORDER BY `id`", __FILE__, __LINE__); // Free memory SQL_FREERESULT($result_main); + + // @TODO Rewrite this constant define('__SPONSOR_ROWS', $OUT); // Load final template