X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-sponsor_reg.php;h=cb93271c33f44e364cf55f95666a1f69fd86c1fd;hp=f283557055cbdc8bf4ad9b57ee983bde41372370;hb=49acdb7a7adbcf25a8e8683b5581bfcec72b23bd;hpb=2df9f7a53f8b1dd5164f87824a324ccb3b6634cb diff --git a/inc/modules/guest/what-sponsor_reg.php b/inc/modules/guest/what-sponsor_reg.php index f283557055..cb93271c33 100644 --- a/inc/modules/guest/what-sponsor_reg.php +++ b/inc/modules/guest/what-sponsor_reg.php @@ -10,13 +10,8 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : Anmeldeformular fuer Sponsoren * * -------------------------------------------------------------------- * - * $Revision:: $ * - * $Date:: $ * - * $Tag:: 0.2.1-FINAL $ * - * $Author:: $ * - * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2012 by Mailer Developer Team * + * Copyright (c) 2009 - 2015 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -167,22 +162,22 @@ if (isFormSent()) { } // END - if // Did he enter his password twice? - if (((!isPostRequestElementSet('pass1')) || (!isPostRequestElementSet('pass2'))) || ((postRequestElement('pass1') != postRequestElement('pass2')) && (isPostRequestElementSet('pass1')) && (isPostRequestElementSet('pass2')))) { - if ((postRequestElement('pass1') != postRequestElement('pass2')) && (isPostRequestElementSet('pass1')) && (isPostRequestElementSet('pass2'))) { + if (((!isPostRequestElementSet('password1')) || (!isPostRequestElementSet('password2'))) || ((postRequestElement('password1') != postRequestElement('password2')) && (isPostRequestElementSet('password1')) && (isPostRequestElementSet('password2')))) { + if ((postRequestElement('password1') != postRequestElement('password2')) && (isPostRequestElementSet('password1')) && (isPostRequestElementSet('password2'))) { // Passwords missmatch array_push($formErrors, '{--SPONSOR_PASSWORDS_MISMATCH--}'); } else { - if (!isPostRequestElementSet('pass1')) { + if (!isPostRequestElementSet('password1')) { // Password 1 is empty array_push($formErrors, '{--SPONSOR_PASSWORD1_EMPTY--}'); } - if (!isPostRequestElementSet('pass2')) { + if (!isPostRequestElementSet('password2')) { // Password 2 is empty array_push($formErrors, '{--SPONSOR_PASSWORD2_EMPTY--}'); } } - } elseif (strlen(postRequestElement('pass1')) < getPassLen()) { + } elseif (strlen(postRequestElement('password1')) < getMinPasswordLength()) { // Password is to short! array_push($formErrors, '{--SPONSOR_PASSWORD_TOO_SHORT--}'); } @@ -194,10 +189,10 @@ if (isFormSent()) { } // END - if // If there is something wrong/missing stop registration - if (count($formErrors) > 0) unsetPostRequestElement('ok'); + if (isFilledArray($formErrors)) unsetPostRequestElement('ok'); } // END - if -if ((isFormSent()) && (count($formErrors) == 0)) { +if ((isFormSent()) && (!isFilledArray($formErrors))) { // Generate message array $messageArray = array( 'failed' => '{--SPONSOR_REGISTRATION_FAILED--}', @@ -205,7 +200,7 @@ if ((isFormSent()) && (count($formErrors) == 0)) { ); // Calulate points - $result = SQL_QUERY_ESC('SELECT + $result = sqlQueryEscaped('SELECT (`pay_rate` * `pay_min_count`) AS `points`, `pay_min_count`, `pay_currency` @@ -215,10 +210,10 @@ WHERE `id`=%s LIMIT 1', array(postRequestElement('pay_type')), __FILE__, __LINE__); - list($points, $pay, $curr) = SQL_FETCHROW($result); + list($points, $pay, $curr) = sqlFetchRow($result); // Free memory - SQL_FREERESULT($result); + sqlFreeResult($result); // Add points to array postRequestElement('points_amount', $points); @@ -233,7 +228,7 @@ LIMIT 1', displayMessage($message); } else { // Check for payment types - $result = SQL_QUERY('SELECT + $result = sqlQuery('SELECT `id`, `pay_name`, `pay_rate`, @@ -241,21 +236,22 @@ LIMIT 1', `pay_min_count` FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` -ORDER BY +ORDER BY `pay_name` ASC', __FILE__, __LINE__); - if (!SQL_HASZERONUMS($result)) { + + if (!ifSqlHasZeroNumRows($result)) { // Load all types... $OUT = ''; - while ($content = SQL_FETCHARRAY($result)) { + while ($content = sqlFetchArray($result)) { // Prepare content for output $content['res'] = translateComma($content['pay_rate'] * $content['pay_min_count']); // Load row template and switch color - $OUT .= loadTemplate('guest_sponsor_payment_row', true, $content); + $OUT .= loadTemplate('guest_sponsor_payment_row', TRUE, $content); } // END - while // Remember the list in table - $content['payment_list'] = loadTemplate('guest_sponsor_payment', true, $OUT); + $content['payment_list'] = loadTemplate('guest_sponsor_payment', TRUE, $OUT); // Init a lot array elements foreach (array('company','position','tax_ident','gender_m','gender_f','gender_c','surname','family','street_nr1','street_nr2','country','zip','city','phone','fax','cell','email','url','receive_warnings_y','receive_warnings_n','form_errors','refid') as $entry) { @@ -263,7 +259,7 @@ ORDER BY } // END - foreach // Check for invalid entries - if (count($formErrors) > 0) { + if (isFilledArray($formErrors)) { // Some found... :-( foreach (array('company','position','tax_ident','surname','family','street_nr1','street_nr2','country','zip','city','phone','fax','cell','email','url') as $entry) { $content[$entry] = postRequestElement($entry); @@ -278,8 +274,8 @@ ORDER BY $OUT = ''; // Errors found? - if (count($formErrors) > 0) { - $OUT = displayMessage('{--SPONSOR_REGISTER_SOMETHING_MISSING--}', true); + if (isFilledArray($formErrors)) { + $OUT = returnMessage('{--SPONSOR_REGISTER_SOMETHING_MISSING--}'); $OUT .= '
    '; foreach ($formErrors as $error) { $OUT .= '
  1. ' . $error . '
  2. '; @@ -291,24 +287,24 @@ ORDER BY $content['form_errors'] = $OUT; // @TODO Maybe a default referral id? - $content['refid'] = 0; + $content['refid'] = NULL; // Is the referral id valid? - if ((isPostRequestElementSet('refid')) && (isValidUserId(postRequestElement('refid')))) { + if ((isPostRequestElementSet('refid')) && (isValidId(postRequestElement('refid')))) { // Transfer referral id $content['refid'] = bigintval(postRequestElement('refid')); } // END - if } // END - if // Display registration form - loadTemplate('guest_sponsor_reg', false, $content); + loadTemplate('guest_sponsor_reg', FALSE, $content); } else { // Nothing added so far displayMessage('{--SPONSOR_PAYMENT_LIST_EMPTY--}'); } // Free memory - SQL_FREERESULT($result); + sqlFreeResult($result); } // [EOF]