X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_country.php;h=cc29cd1b0ac5b464b5a77f8eabd97dd26df4f3b2;hb=e5527fd38a6585c8466dc28d013f12d21eb7c07a;hp=6d86d0bd1a3901c73f30ea94991867d7f77a19ac;hpb=8da353fa4bb729bb3299d247803c23833a52a327;p=mailer.git diff --git a/inc/modules/admin/what-list_country.php b/inc/modules/admin/what-list_country.php index 6d86d0bd1a..cc29cd1b0a 100644 --- a/inc/modules/admin/what-list_country.php +++ b/inc/modules/admin/what-list_country.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2012 by Mailer Developer Team * + * Copyright (c) 2009 - 2013 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -46,11 +46,11 @@ addYouAreHereLink('admin', __FILE__); // Add new code? if ((isFormSent('add')) && (isPostRequestElementSet('code')) && (isPostRequestElementSet('descr'))) { // Check if country code does already exist - $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_countries` WHERE `code`='%s' LIMIT 1", + $result = sqlQueryEscaped("SELECT `id` FROM `{?_MYSQL_PREFIX?}_countries` WHERE `code`='%s' LIMIT 1", array(strtoupper(postRequestElement('code'))), __FILE__, __LINE__); - if (SQL_HASZERONUMS($result)) { + if (ifSqlHasZeroNums($result)) { // Save entry - SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_countries` (`code`, `descr`, `is_active`) VALUES ('%s','%s','%s')", + sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_countries` (`code`, `descr`, `is_active`) VALUES ('%s','%s','%s')", array( strtoupper(substr(postRequestElement('code'), 0, 2)), postRequestElement('descr'), @@ -61,7 +61,7 @@ if ((isFormSent('add')) && (isPostRequestElementSet('code')) && (isPostRequestEl $message = '{%message,ADMIN_COUNTRY_ADDED=' . strtoupper(postRequestElement('descr')) . '%}'; } else { // Free memory - SQL_FREERESULT($result); + sqlFreeResult($result); // Does already exist $message = '{%message,ADMIN_COUNTRY_ALREADY=' . strtoupper(postRequestElement('code')) . '%}'; @@ -104,11 +104,11 @@ if ((isFormSent('add')) && (isPostRequestElementSet('code')) && (isPostRequestEl $OUT = ''; foreach (postRequestElement('id') as $id => $isActive) { // Load data from DB - $result = SQL_QUERY_ESC("SELECT `id`, `code`, `descr` FROM `{?_MYSQL_PREFIX?}_countries` WHERE `id`=%s LIMIT 1", + $result = sqlQueryEscaped("SELECT `id`, `code`, `descr` FROM `{?_MYSQL_PREFIX?}_countries` WHERE `id`=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); - if (SQL_NUMROWS($result) == 1) { + if (sqlNumRows($result) == 1) { // Load data - $content = SQL_FETCHARRAY($result); + $content = sqlFetchArray($result); // Add $isActive $content['is_active'] = $isActive; @@ -118,7 +118,7 @@ if ((isFormSent('add')) && (isPostRequestElementSet('code')) && (isPostRequestEl } // END - if // Free result - SQL_FREERESULT($result); + sqlFreeResult($result); } // END - foreach // Prepare content for template @@ -173,20 +173,20 @@ LIMIT 1"); } // END - if // Load currenty setup country codes to list - $result = SQL_QUERY('SELECT `id`, `code`, `descr`, `is_active` FROM `{?_MYSQL_PREFIX?}_countries` ORDER BY `code` ASC', + $result = sqlQuery('SELECT `id`, `code`, `descr`, `is_active` FROM `{?_MYSQL_PREFIX?}_countries` ORDER BY `code` ASC', __FILE__, __LINE__); // Are there entries? - if (!SQL_HASZERONUMS($result)) { + if (!ifSqlHasZeroNums($result)) { // List all countries $OUT = ''; - while ($content = SQL_FETCHARRAY($result)) { + while ($content = sqlFetchArray($result)) { // Load row template and switch colors $OUT .= loadTemplate('admin_list_country_row', TRUE, $content); } // END - while // Free memory - SQL_FREERESULT($result); + sqlFreeResult($result); } else { // No code setup so far (not possible by this software! 'DE' for 'Deutschland' is default $OUT = loadTemplate('admin_list_country_no_row', TRUE);