07b38b1ba401671190299c654e488d451a2ef9ea
[mailer.git] / inc / modules / member / what-transfer.php
1 <?php
2 /************************************************************************
3  * Mailer v0.2.1-FINAL                                Start: 10/07/2004 *
4  * ===================                          Last change: 10/07/2004 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : what-transfer.php                                *
8  * -------------------------------------------------------------------- *
9  * Short description : Point transfers                                  *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Punktetransfers                                  *
12  * -------------------------------------------------------------------- *
13  * $Revision::                                                        $ *
14  * $Date::                                                            $ *
15  * $Tag:: 0.2.1-FINAL                                                 $ *
16  * $Author::                                                          $ *
17  * -------------------------------------------------------------------- *
18  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
19  * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
20  * For more information visit: http://www.mxchange.org                  *
21  *                                                                      *
22  * This program is free software; you can redistribute it and/or modify *
23  * it under the terms of the GNU General Public License as published by *
24  * the Free Software Foundation; either version 2 of the License, or    *
25  * (at your option) any later version.                                  *
26  *                                                                      *
27  * This program is distributed in the hope that it will be useful,      *
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
30  * GNU General Public License for more details.                         *
31  *                                                                      *
32  * You should have received a copy of the GNU General Public License    *
33  * along with this program; if not, write to the Free Software          *
34  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
35  * MA  02110-1301  USA                                                  *
36  ************************************************************************/
37
38 // Some security stuff...
39 if (!defined('__SECURITY')) {
40         die();
41 } elseif (!isMember()) {
42         redirectToIndexMemberOnlyModule();
43 }
44
45 // Add description as navigation point
46 addYouAreHereLink('member', __FILE__);
47
48 if ((!isExtensionActive('transfer')) && (!isAdmin())) {
49         displayMessage('{%pipe,generateExtensionInactiveNotInstalledMessage=transfer%}');
50         return;
51 } // END - if
52
53 // Check for mode in GET
54 $mode = '';
55 if (isGetRequestParameterSet('mode')) {
56         $mode = getRequestParameter('mode');
57 } // END - if
58
59 // Check for "faker"
60 if ((getUserData('opt_in') != 'Y') && ($mode == 'new')) {
61         $mode = '';
62 } // END - if
63
64 switch ($mode) {
65         case 'new': // Start new transfer
66                 // Get total points and subtract the balance amount from it = maximum transferable points
67                 $total = getTotalPoints(getMemberId());
68
69                 // Remember maximum value for template
70                 $content['max_transferable'] = round($total - getConfig('transfer_balance') - 0.5);
71
72                 if (isFormSent()) {
73                         // Add new transfer
74                         if (getTransferCode() > 0) {
75                                 // Check for code
76                                 $code = generateRandomCode(getTransferCode(), postRequestParameter('code_chk'), getMemberId(), $content['max_transferable']);
77                                 $valid_code = ($code == postRequestParameter('code'));
78                         } else {
79                                 // Zero length (= disabled) is always valid!
80                                 $valid_code = true;
81                         }
82
83                         // Test password
84                         $valid_pass = ($pass == generateHash(postRequestParameter('password'), $pass));
85
86                         // Test transfer amount
87                         $valid_amount = ((isPostRequestParameterSet('points')) && (postRequestParameter('points') <= $content['max_transferable']));
88
89                         // Test reason for transfer
90                         $valid_reason = (isPostRequestParameterSet('reason'));
91
92                         // Test if a recipient is selected
93                         $valid_recipient = isValidUserId(postRequestParameter('to_userid'));
94
95                         // Re-check receivers and own personal data
96                         $result = SQL_QUERY_ESC("SELECT `userid`, `gender`, `surname`, `family`, `email` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid` IN ('%s','%s') AND `status`='CONFIRMED' LIMIT 2",
97                                 array(
98                                         getMemberId(),
99                                         bigintval(postRequestParameter('to_userid'))
100                                 ), __FILE__, __LINE__);
101
102                         // Do we have two entries?
103                         $valid_data = (SQL_NUMROWS($result) == 2);
104
105                         // Final check if all is fine
106                         if ($valid_code && $valid_data && $valid_pass && $valid_amount && $valid_reason && $valid_recipient) {
107                                 // Let's start the transfer and load user data
108                                 $content['sender']    = SQL_FETCHARRAY($result);
109                                 $content['recipient'] = SQL_FETCHARRAY($result);
110
111                                 // Is the nickname extension not installed?
112                                 if (!isExtensionActive('nickname')) {
113                                         // Fix empty nicknames
114                                         $content['sender']['nickname']    = '';
115                                         $content['recipient']['nickname'] = '';
116                                 } // END - if
117
118                                 // Prepare variables for testing
119                                 $TEST_NICK_SENDER = $content['sender']['nickname'];
120                                 $TEST_NICK_REC    = $content['recipient']['nickname'];
121
122                                 // Default is userids for subject line
123                                 $SENDER    = getMemberId();
124                                 $RECIPIENT = bigintval(postRequestParameter('to_userid'));
125
126                                 // If nickname is installed we can set the nickname
127                                 // @TODO Rewrite this to a filter
128                                 if (isExtensionActive('nickname')) {
129                                         if (($TEST_NICK_SENDER != getMemberId()) && (!empty($TEST_NICK_SENDER))) {
130                                                 $SENDER = $content['sender']['nickname'];
131                                         } // END - if
132
133                                         if (($TEST_NICK_REC != postRequestParameter('to_userid')) && (!empty($TEST_NICK_REC))) {
134                                                 $RECIPIENT = $content['recipient']['nickname'];
135                                         } // END - if
136                                 } // END - if
137
138                                 // Remember transfer reason
139                                 $content['reason']  = postRequestParameter('reason');
140
141                                 // Generate tranafer id
142                                 $content['trans_id'] = bigintval(generateRandomCode('10', mt_rand(0, 99999), getMemberId(), postRequestParameter('reason')));
143
144                                 // Add entries to both tables
145                                 SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_transfers_in` (`userid`, `from_userid`, `points`, `reason`, `time_trans`, `trans_id`) VALUES (%s,%s,%s,'%s', UNIX_TIMESTAMP(),%s)",
146                                         array(bigintval(postRequestParameter('to_userid')), getMemberId(), bigintval(postRequestParameter('points')), postRequestParameter('reason'), $content['trans_id']), __FILE__, __LINE__);
147                                 SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_transfers_out` (`userid`, `to_userid`, `points`, `reason`, `time_trans`, `trans_id`) VALUES (%s,%s,%s,'%s', UNIX_TIMESTAMP(),%s)",
148                                         array(getMemberId(), bigintval(postRequestParameter('to_userid')), bigintval(postRequestParameter('points')), postRequestParameter('reason'), $content['trans_id']), __FILE__, __LINE__);
149
150                                 // Add points to account *directly* ...
151                                 addPointsDirectly('transfer', bigintval(postRequestParameter('to_userid')), bigintval(postRequestParameter('points')));
152
153                                 // ... and add it to current user's used points
154                                 subtractPoints('transfer', getMemberId(), postRequestParameter('points'));
155
156                                 // First send email to recipient
157                                 $message = loadEmailTemplate('member_transfer_recipient', $content, postRequestParameter('to_userid'));
158                                 sendEmail($content['recipient']['userid'], '{--TRANSFER_MEMBER_RECIPIENT_SUBJECT--}' . ': ' . $SENDER, $message);
159
160                                 // Second send email to sender
161                                 $message = loadEmailTemplate('member_transfer_sender', $content, getMemberId());
162                                 sendEmail($content['sender']['userid'], '{--TRANSFER_MEMBER_SENDER_SUBJECT--}' . ': ' . $RECIPIENT, $message);
163
164                                 // At last send admin mail(s)
165                                 $adminSubject = sprintf("%s (%s->%s)", '{--TRANSFER_ADMIN_SUBJECT--}', $SENDER, $RECIPIENT);
166                                 sendAdminNotification($adminSubject, 'admin_transfer_points', $content);
167
168                                 // Transfer is completed
169                                 displayMessage('<div>{--TRANSFER_COMPLETED--}' . '</div><div><a href="{%url=modules.php?module=login&amp;what=transfer%}">{--TRANSFER_CONTINUE_OVERVIEW--}</a></div>');
170                         } elseif ($valid_code === false) {
171                                 // Invalid Touring code!
172                                 loadTemplate('admin_settings_unsaved', false, '{--TRANSFER_INVALID_CODE--}');
173                                 unsetPostRequestParameter('ok');
174                         } elseif ($valid_pass === false) {
175                                 // Wrong password entered
176                                 loadTemplate('admin_settings_unsaved', false, '{--TRANSFER_INVALID_PASSWORD--}');
177                                 unsetPostRequestParameter('ok');
178                         } elseif ($valid_amount === false) {
179                                 // Too much points entered
180                                 loadTemplate('admin_settings_unsaved', false, '{--TRANSFER_INVALID_POINTS--}');
181                                 unsetPostRequestParameter('ok');
182                         } elseif ($valid_reason === false) {
183                                 // No transfer reason entered
184                                 loadTemplate('admin_settings_unsaved', false, '{--TRANSFER_INVALID_REASON--}');
185                                 unsetPostRequestParameter('ok');
186                         } elseif ($valid_recipient === false) {
187                                 // No recipient selected
188                                 loadTemplate('admin_settings_unsaved', false, '{--TRANSFER_INVALID_RECIPIENT--}');
189                                 unsetPostRequestParameter('ok');
190                         } elseif ($valid_data === false) {
191                                 // No recipient/sender selected
192                                 loadTemplate('admin_settings_unsaved', false, '{--TRANSFER_INVALID_DATA--}');
193                                 unsetPostRequestParameter('ok');
194                         }
195
196                         // Free result
197                         SQL_FREERESULT($result);
198                 } // END - if
199
200                 if (!isFormSent()) {
201                         // Load member list
202                         $result = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `status`='CONFIRMED' AND `opt_in`='Y' AND `userid` != '%s' ORDER BY `userid` ASC",
203                                 array(getMemberId()), __FILE__, __LINE__);
204
205                         if (!SQL_HASZERONUMS($result)) {
206                                 // Load list
207                                 $OUT  = '<select name="to_userid" size="1" class="form_select">
208         <option value="0">{--SELECT_NONE--}</option>';
209                                 while (list($userid) = SQL_FETCHROW($result)) {
210                                         $OUT .= '       <option value="' . $userid . '"';
211                                         if ((isPostRequestParameterSet('to_userid')) && (postRequestParameter('to_userid') == $userid)) {
212                                                 $OUT .= ' selected="selected"';
213                                         } // END - if
214                                         $OUT .= '>' . $userid . ' ({%user,nickname,fixEmptyContentToDashes=' . $userid . '%})</option>';
215                                 } // END - while
216                                 $OUT .= '</select>';
217                                 $content['to_disabled'] = '';
218
219                                 // Free memory
220                                 SQL_FREERESULT($result);
221                         } else {
222                                 // No one else is opt-in
223                                 $OUT = displayMessage('{--TRANSFER_NO_ONE_ELSE_OPT_IN--}', true);
224                                 $content['to_disabled'] = ' disabled="disabled"';
225                         }
226
227                         // Transfer output to constant for the template
228                         $content['userid_selection'] = $OUT;
229
230                         // Generate Code
231                         if (getTransferCode() > 0) {
232                                 // Generate random number
233                                 $rand = mt_rand(0, 99999);
234
235                                 // Generate CAPTCHA code
236                                 $code = generateRandomCode(getTransferCode(), $rand, getMemberId(), $content['max_transferable']);
237
238                                 // Generate image (HTML code)
239                                 $img = generateImageOrCode($code, false);
240
241                                 // Add all and hidden field
242                                 $content['captcha_code'] = '<input type="hidden" name="code_chk" value="' . $rand . '" /><input type="text" name="code" class="form_field" size="5" maxlength="7"' . $content['to_disabled'] . ' />&nbsp;' . $img;
243                         } else {
244                                 $code = '00000';
245                                 $content['captcha_code'] = displayMessage('{--TRANSFER_NO_CODE--}', true);
246                         }
247
248                         // Init points/reason
249                         $content['points'] = '';
250                         $content['reason'] = '';
251
252                         // Transfer maybe already entered valued'
253                         if (isPostRequestParameterSet('ok')) {
254                                 // Get values from form
255                                 $content['points'] = postRequestParameter('points');
256                                 $content['reason'] = postRequestParameter('reason');
257                         } // END - if
258
259                         // Output form
260                         loadTemplate('member_transfer_new', false, $content);
261                 } // END - if
262                 break;
263
264         case 'list_in': // List only incoming transactions
265         case 'list_out': // List only outgoing transactions
266                 // As you can see I put list_in and list_out together. I now do a switch() again on it for the right SQL command
267                 $nothingMessage = '';
268                 switch ($mode) {
269                         case 'list_in':
270                                 $sql = 'SELECT `trans_id`, `from_userid` AS party_userid, `points`, `reason`, `time_trans` FROM `{?_MYSQL_PREFIX?}_user_transfers_in` WHERE `userid`=%s ORDER BY `time_trans` DESC LIMIT {?transfer_max?}';
271                                 $nothingMessage     = '{--TRANSFER_NO_INCOMING_TRANSFERS--}';
272                                 $content['balance'] = '{--TRANSFER_TOTAL_INCOMING--}';
273                                 $content['title']   = '{--TRANSFER_LIST_INCOMING--}';
274                                 break;
275
276                         case 'list_out':
277                                 $sql = 'SELECT `trans_id`, `to_userid` AS party_userid, `points`, `reason`, `time_trans` FROM `{?_MYSQL_PREFIX?}_user_transfers_out` WHERE `userid`=%s ORDER BY `time_trans` DESC LIMIT {?transfer_max?}';
278                                 $nothingMessage     = '{--TRANSFER_NO_OUTGOING_TRANSFERS--}';
279                                 $content['balance'] = '{--TRANSFER_TOTAL_OUTGOING--}';
280                                 $content['title']   = '{--TRANSFER_LIST_OUTGOING--}';
281                                 break;
282                 } // END - switch
283
284                 // Run the SQL command and set total points to zero
285                 $totalPoints = '0';
286                 $result = SQL_QUERY_ESC($sql, array(getMemberId()), __FILE__, __LINE__);
287
288                 // Do we have entries?
289                 if (!SQL_HASZERONUMS($result)) {
290                         $OUT = '';
291                         while ($content = SQL_FETCHARRAY($result)) {
292                                 // Rewrite points, out is subtracted
293                                 if ($type == 'OUT') {
294                                         $content['points'] = $content['points'] * -1;
295                                 } // END - if
296
297                                 // Prepare content for template
298                                 $$content['time_trans'] = generateDateTime($content['time_trans'], 3);
299
300                                 // Load row template
301                                 $OUT .= loadTemplate('member_transfer_row2', true, $content);
302
303                                 // Add points and switch color
304                                 $totalPoints += $content['points'];
305                         } // END - while
306
307                         // Free memory
308                         SQL_FREERESULT($result);
309                 } else {
310                         // Nothing for in or out
311                         $OUT = '<tr>
312   <td colspan="5" align="center" class="bottom">
313     ' . displayMessage($nothingMessage, true) . '
314   </td>
315 </tr>';
316                 }
317
318                 // ... and add them to a constant for the template
319                 $content['rows'] = $OUT;
320
321                 // Remeber total amount
322                 $content['total_points'] = $totalPoints;
323
324                 // Load final template
325                 loadTemplate('member_transfer_list', false, $content);
326                 break;
327
328         case 'list_all': // List all transactions
329                 /*
330                  * Fill a temporary table with data from both tables. This is much
331                  * easier to code and unstandable by you as sub-SELECT queries. I know
332                  * this is not the fastest way but it shall be fine for now.
333                  */
334
335                 // First of all create the per-user temporary table
336                 $result = SQL_QUERY_ESC("CREATE TEMPORARY TABLE `{?_MYSQL_PREFIX?}_%s_transfers_tmp` (
337 `trans_id` VARCHAR(12) NOT NULL DEFAULT '',
338 `party_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
339 `points` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
340 `reason` VARCHAR(255) NOT NULL DEFAULT '',
341 `time_trans` VARCHAR(10) NOT NULL DEFAULT 0,
342 `trans_type` ENUM('IN','OUT') NOT NULL DEFAULT 'IN',
343 KEY (`party_userid`)
344 ) ENGINE = HEAP COMMENT = 'Temporary transfer table'", array(getMemberId()), __FILE__, __LINE__);
345
346                 // Let's begin with the incoming list
347                 $result = SQL_QUERY_ESC("SELECT `trans_id`, `from_userid`, `points`, `reason`, `time_trans` FROM `{?_MYSQL_PREFIX?}_user_transfers_in` WHERE `userid`=%s ORDER BY `id` ASC LIMIT {?transfer_max?}",
348                         array(getMemberId()), __FILE__, __LINE__);
349                 while ($DATA = SQL_FETCHROW($result)) {
350                         $DATA[] = 'IN';
351                         $DATA = implode("','", $DATA);
352                         $res_temp = SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_%s_transfers_tmp` (`trans_id`, `party_userid`, `points`, `reason`, `time_trans`, `trans_type`) VALUES ('" . $DATA . "')", array(getMemberId()), __FILE__, __LINE__);
353                 } // END - while
354
355                 // Free memory
356                 SQL_FREERESULT($result);
357
358                 // As the last table transfer data from outgoing table to temporary
359                 $result = SQL_QUERY_ESC("SELECT `trans_id`, `to_userid`, `points`, `reason`, `time_trans` FROM `{?_MYSQL_PREFIX?}_user_transfers_out` WHERE `userid`=%s ORDER BY `id` LIMIT {?transfer_max?}",
360                         array(getMemberId()), __FILE__, __LINE__);
361                 while ($DATA = SQL_FETCHROW($result)) {
362                         $DATA[] = 'OUT';
363                         $DATA = implode("','", $DATA);
364                         $res_temp = SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_%s_transfers_tmp` (`trans_id`, `party_userid`, `points`, `reason`, `time_trans`, `trans_type`) VALUES ('" . $DATA . "')", array(getMemberId()), __FILE__, __LINE__);
365                 } // END - while
366
367                 // Free memory
368                 SQL_FREERESULT($result);
369
370                 // Search for entries
371                 $result = SQL_QUERY_ESC("SELECT `party_userid`, `trans_id`, `points`, `reason`, `time_trans`, `trans_type` FROM `{?_MYSQL_PREFIX?}_%s_transfers_tmp` ORDER BY `time_trans` DESC",
372                         array(getMemberId()), __FILE__, __LINE__);
373
374                 $total = '0';
375                 if (!SQL_HASZERONUMS($result)) {
376                         // Output rows
377                         $OUT = '';
378                         while ($content = SQL_FETCHARRAY($result)) {
379                                 // Rewrite points if OUT
380                                 if ($content['trans_type'] == 'OUT') {
381                                         $content['points'] = $content['points'] * -1;
382                                 } // END - if
383
384                                 // Prepare content for template
385                                 $content['time']   = generateDateTime($content['time_trans'], 3);
386
387                                 // Load row template
388                                 $OUT .= loadTemplate('member_transfer_row', true, $content);
389
390                                 // Add points and switch color
391                                 $total += $content['points'];
392                         } // END - while
393                 } else {
394                         // Nothing for in and out
395                         $OUT = '<tr>
396   <td colspan="5" align="center" class="bottom">
397     ' . displayMessage('{--TRANSFER_NO_INOUT_TRANSFERS--}', true) . '
398   </td>
399 </tr>';
400                 }
401
402                 // Free memory
403                 SQL_FREERESULT($result);
404
405                 // ... and add them to a constant for the template
406                 $content['rows'] =  $OUT;
407
408                 // Remeber total amount
409                 $content['total_points'] = $total;
410
411                 // Set title
412                 $content['title'] = '{--TRANSFER_LIST_ALL--}';
413
414                 // Set "balance" word
415                 $content['balance'] = '{--TRANSFER_TOTAL_BALANCE--}';
416
417                 // At the end we don't need a temporary table in memory
418                 $result = SQL_QUERY_ESC("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_%s_transfers_tmp`", array(getMemberId()), __FILE__, __LINE__);
419
420                 // Load final template
421                 loadTemplate('member_transfer_list', false, $content);
422
423                 // Free some memory...
424                 SQL_FREERESULT($result);
425                 break;
426
427         default: // Overview page
428                 // Check incoming transfers
429                 $totalIn = countSumTotalData(getMemberId(), 'user_transfers_in', 'id', 'userid', true);
430                 $content['in_link'] = $totalIn;
431                 if ($totalIn > 0) {
432                         $content['in_link'] = '<a href="{%url=modules.php?module=login&amp;what=transfer&amp;mode=list_in%}">' . $totalIn . '</a>';
433                 } // END - if
434
435                 // Check outgoing transfers
436                 $totalOut = countSumTotalData(getMemberId(), 'user_transfers_out', 'id', 'userid', true);
437
438                 $content['out_link'] = $totalOut;
439                 if ($totalOut > 0) {
440                         $content['out_link'] = '<a href="{%url=modules.php?module=login&amp;what=transfer&amp;mode=list_out%}">' . $totalOut . '</a>';
441                 } // END - if
442
443                 // Add all to total amount
444                 $total = $totalIn + $totalOut;
445
446                 // Total transactions
447                 $content['all_link'] = $total;
448                 if ($total > 0) {
449                         $content['all_link'] = '<a href="{%url=modules.php?module=login&amp;what=transfer&amp;mode=list_all%}">{%pipe,translateComma=' . $total . '%}</a>';
450                 } // END - if
451
452                 if (isFormSent()) {
453                         // Save settings
454                         SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `opt_in`='%s' WHERE `userid`=%s LIMIT 1",
455                                 array(postRequestParameter('opt_in'), getMemberId()), __FILE__, __LINE__);
456
457                         // "Settings saved..."
458                         displayMessage('{--SETTINGS_SAVED--}');
459                 } // END - if
460
461                 // Init entries
462                 foreach (array('allow_y','allow_n') as $entry) {
463                         $content[$entry] = '';
464                 } // END - foreach
465
466                 // Set current selection
467                 $content['allow_' . strtolower(getUserData('opt_in'))] = ' checked="checked"';
468
469                 // Set 'new transfer' link according to above option
470                 switch (getUserData('opt_in')) {
471                         case 'Y':
472                                 $content['new_link'] = '<a href="{%url=modules.php?module=login&amp;what=transfer&amp;mode=new%}" title="{--TRANSFER_NOW_TITLE--}">{--TRANSFER_NOW_LINK--}</a>';
473                                 break;
474
475                         case 'N':
476                                 $content['new_link'] = '{--TRANSFER_PLEASE_ALLOW_OPT_IN--}';
477                                 break;
478                 } // END - switch
479
480                 // Check for latest out-transfers
481                 $result = SQL_QUERY_ESC("SELECT
482         `time_trans`
483 FROM
484         `{?_MYSQL_PREFIX?}_user_transfers_out`
485 WHERE
486         (UNIX_TIMESTAMP() - `time_trans`) >= {?transfer_timeout?} AND
487         `userid`=%s
488 ORDER BY
489         `time_trans` DESC
490 LIMIT 1",
491                         array(
492                                 getMemberId()
493                         ), __FILE__, __LINE__);
494
495                 // Do we have an entry?
496                 if (SQL_NUMROWS($result) == 1) {
497                         // Load newest transaction
498                         list($newest) = SQL_FETCHROW($result);
499                         $content['settings'] = '{%message,TRANSFER_LATEST_IS=' . generateDateTime($newest, '3') . '%}';
500                 } else {
501                         // Load template
502                         $content['settings'] = loadTemplate('member_transfer_settings', true, $content);
503                 }
504
505                 // Free result
506                 SQL_FREERESULT($result);
507
508                 // Load template
509                 loadTemplate('member_transfer_overview', false, $content);
510                 break;
511 } // END - switch
512
513 // [EOF]
514 ?>