X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-del_transfer.php;h=567b318c215162c5b81e4e440a06eaad8fdcea79;hb=101e5f161c0c367c022c9288398226a57f3919d7;hp=9cc0a1b92ca57fe1c7eb5bf9cff9c971cc7fa9fa;hpb=a84b517e5ce0d1601ca09082aad89f9b673bc202;p=mailer.git diff --git a/inc/modules/admin/what-del_transfer.php b/inc/modules/admin/what-del_transfer.php index 9cc0a1b92c..567b318c21 100644 --- a/inc/modules/admin/what-del_transfer.php +++ b/inc/modules/admin/what-del_transfer.php @@ -1,7 +1,7 @@ 0) { + if (ifPostContainsSelections()) { // Init SQLs - INIT_SQLS(); + initSqls(); // Delete entries... - foreach (REQUEST_POST('sel') as $id => $sel) { - ADD_SQL(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_transfers_in` WHERE trans_id=%s LIMIT 1", + foreach (postRequestParameter('sel') as $id => $sel) { + addSql(SQL_QUERY_ESC('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_transfers_in` WHERE `trans_id`=%s LIMIT 1', array(bigintval($id)), __FILE__, __LINE__, false)); - ADD_SQL(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_transfers_out` WHERE trans_id=%s LIMIT 1", + addSql(SQL_QUERY_ESC('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_transfers_out` WHERE `trans_id`=%s LIMIT 1', array(bigintval($id)), __FILE__, __LINE__, false)); } // END - foreach // Run all SQLs runFilterChain('run_sqls'); - } -} + } // END - if +} // END - if // We only need outgoing transfers -$result = SQL_QUERY("SELECT userid, to_uid, trans_id, points, reason, time_trans FROM `{!_MYSQL_PREFIX!}_user_transfers_out` ORDER BY trans_id", __FILE__, __LINE__); -$total = 0; -if (SQL_NUMROWS($result) > 0) { +$result = SQL_QUERY('SELECT + `userid` AS `from_userid`, `to_userid`, `trans_id`, `points`, `reason`, `time_trans` +FROM + `{?_MYSQL_PREFIX?}_user_transfers_out` +ORDER BY + `trans_id` ASC', __FILE__, __LINE__); + +$total = '0'; +if (!SQL_HASZERONUMS($result)) { // Output rows - $OUT = ''; $SW = 2; + $OUT = ''; while ($content = SQL_FETCHARRAY($result)) { // Prepare data for the row template - // @TODO Rewritings: idx->trans_id in template - $content = array( - 'sw' => $SW, - 'idx' => $content['trans_id'], - 'stamp' => generateDateTime($content['time_trans'], "3"), - 'uid_from' => generateUserProfileLink($content['userid']), - 'uid_to' => generateUserProfileLink($content['to_uid']), - 'reason' => $content['reason'], - 'points' => translateComma($content['points']), - ); + $content['time_trans'] = generateDateTime($content['time_trans'], 3); // Load row template - $OUT .= LOAD_TEMPLATE("admin_del_transfer_row", true, $content); + $OUT .= loadTemplate('admin_delete_transfer_row', true, $content); // Sum points and switch colors - $total += $content['points']; $SW = 3 - $SW; - } + $total += $content['points']; + } // END - while // Free memory SQL_FREERESULT($result); } else { // Nothing for in and out - $OUT = "