X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_country.php;h=35cb31746597b727eef8dba7671e790fe4e6ac5a;hb=b679042bd22371aa267e595db8d0e08941afc9eb;hp=946b758895917ebcae2632557d9e741c86a9e7d1;hpb=20741b93fd58620af677a7f1039ffd16ea6ec689;p=mailer.git diff --git a/inc/modules/admin/what-list_country.php b/inc/modules/admin/what-list_country.php index 946b758895..35cb317465 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 - 2011 by Mailer Developer Team * + * Copyright (c) 2009 - 2012 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -79,11 +79,13 @@ if ((isFormSent('add')) && (isPostRequestElementSet('code')) && (isPostRequestEl 'title' => '{--ADMIN_COUNTRY_ACTIVATION_NEXT_LINK--}' )); } elseif (((isFormSent('edit')) || (isPostRequestElementSet('delete'))) && (isPostRequestElementSet('id'))) { - if (count(postRequestElement('id')) > 0) { + // Do we have entries? + if (ifPostContainsSelections('id')) { + // Is the proper form sent? if (isFormSent('edit')) { // Edit template $row = 'admin_edit_country_row'; - $post = 'modify'; + $do = 'modify'; $class = 'form_submit'; $submit = '{--ADMIN_COUNTRY_EDIT_NOW--}'; $title = '{--ADMIN_COUNTRY_EDIT_TITLE--}'; @@ -91,7 +93,7 @@ if ((isFormSent('add')) && (isPostRequestElementSet('code')) && (isPostRequestEl } else { // Delete template $row = 'admin_delete_country_row'; - $post = 'remove'; + $do = 'remove'; $class = 'form_delete'; $submit = '{--ADMIN_COUNTRY_DELETE_NOW--}'; $title = '{--ADMIN_COUNTRY_DELETE_TITLE--}'; @@ -122,7 +124,7 @@ if ((isFormSent('add')) && (isPostRequestElementSet('code')) && (isPostRequestEl // Prepare content for template $content = array( 'rows' => $OUT, - 'mode' => $post, + 'do' => $do, 'class' => $class, 'title' => $title, 'submit' => $submit, @@ -139,7 +141,15 @@ if ((isFormSent('add')) && (isPostRequestElementSet('code')) && (isPostRequestEl if ((isPostRequestElementSet('modify')) && (isPostRequestElementSet('id'))) { // Modify foreach (postRequestElement('id') as $id => $sel) { - addSql("UPDATE `{?_MYSQL_PREFIX?}_countries` SET `code`='" . postRequestElement('code', $id) . "', `descr`='" . postRequestElement('descr', $id) . "', `is_active`='" . postRequestElement('is_active', $id) . "' WHERE `id`=" . bigintval($id) . " LIMIT 1"); + addSql("UPDATE + `{?_MYSQL_PREFIX?}_countries` +SET + `code`='" . postRequestElement('code', $id) . "', + `descr`='" . postRequestElement('descr', $id) . "', + `is_active`='" . postRequestElement('is_active', $id) . "' +WHERE + `id`=" . bigintval($id) . " +LIMIT 1"); } // END - foreach // Create message @@ -147,7 +157,7 @@ if ((isFormSent('add')) && (isPostRequestElementSet('code')) && (isPostRequestEl } elseif ((isFormSent('do_delete')) && (isPostRequestElementSet('id'))) { // Remove $IDs = implode(',', array_keys(postRequestElement('id'))); - addSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_countries` WHERE `id` IN (".$IDs.") LIMIT ".count(postRequestElement('id')).""); + addSql('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_countries` WHERE `id` IN (' . $IDs . ') LIMIT ' . countPostSelection('id') . ''); // Create message $message = '{--ADMIN_COUNTRIES_REMOVED--}';