X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_country.php;h=7977ca3ba018a8f6679264d1475cbe5ae3adf9dd;hb=2142149f3f72f1a2476f95a87937c044d63bbaf2;hp=4a54818168c290a170ae96803dc6e7248ceaa7e3;hpb=d0ab0382dd73638f0bc13a1a3d6f117ec11a203e;p=mailer.git
diff --git a/inc/modules/admin/what-list_country.php b/inc/modules/admin/what-list_country.php
index 4a54818168..7977ca3ba0 100644
--- a/inc/modules/admin/what-list_country.php
+++ b/inc/modules/admin/what-list_country.php
@@ -32,14 +32,13 @@
************************************************************************/
// Some security stuff...
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin()))
-{
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
}
// Add description as navigation point
-ADD_DESCR("admin", basename(__FILE__));
+ADD_DESCR("admin", __FILE__);
// Add new code?
if ((isset($_POST['add'])) && (!empty($_POST['code'])) && (!empty($_POST['descr'])))
@@ -50,8 +49,7 @@ if ((isset($_POST['add'])) && (!empty($_POST['code'])) && (!empty($_POST['descr'
if (SQL_NUMROWS($result) == 0)
{
// Save entry
- $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_countries (code, descr, is_active)
- VALUES('%s', '%s', '%s')",
+ $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_countries (code, descr, is_active) VALUES ('%s','%s','%s')",
array(strtoupper(substr($_POST['code'], 0, 2)), $_POST['descr'], $_POST['is_active']), __FILE__, __LINE__);
// Country added
@@ -68,7 +66,7 @@ if ((isset($_POST['add'])) && (!empty($_POST['code'])) && (!empty($_POST['descr'
// Display message
LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
- OUTPUT_HTML("
");
+ OUTPUT_HTML("
");
}
// Change status?
elseif ((isset($_POST['change'])) && (!empty($_POST['id'])))
@@ -104,10 +102,10 @@ if ((isset($_POST['add'])) && (!empty($_POST['code'])) && (!empty($_POST['descr'
// Edit all selected country codes
$OUT = ""; $SW = 2;
- foreach ($_POST['id'] as $id=>$status)
+ foreach ($_POST['id'] as $id => $status)
{
// Load data from DB
- $result = SQL_QUERY_ESC("SELECT code, descr FROM "._MYSQL_PREFIX."_countries WHERE id=%d LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT code, descr FROM "._MYSQL_PREFIX."_countries WHERE id=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1)
{
@@ -125,7 +123,7 @@ if ((isset($_POST['add'])) && (!empty($_POST['code'])) && (!empty($_POST['descr'
if ($post == "modify")
{
// Generate default selection in edit-mode
- $content['status'] = ADD_OPTION_LINES("/ARRAY/", array('Y', 'N'), array(YES, NO ), $status);
+ $content['status'] = ADD_OPTION_LINES("/ARRAY/", array("Y","N"), array(YES, NO ), $status);
}
else
{
@@ -154,7 +152,7 @@ if ((isset($_POST['add'])) && (!empty($_POST['code'])) && (!empty($_POST['descr'
if ((isset($_POST['modify'])) && (!empty($_POST['id'])))
{
// Modify
- foreach ($_POST['id'] as $id=>$sel)
+ foreach ($_POST['id'] as $id => $sel)
{
$SQLs[] = "UPDATE "._MYSQL_PREFIX."_countries SET code='".$_POST['code'][$id]."', descr='".$_POST['descr'][$id]."', is_active='".$_POST['is_active'][$id]."' WHERE id='".$id."' LIMIT 1";
}
@@ -182,7 +180,7 @@ if ((isset($_POST['add'])) && (!empty($_POST['code'])) && (!empty($_POST['descr'
// Display message
LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
- OUTPUT_HTML("
");
+ OUTPUT_HTML("
");
}
// Load currenty setup country codes to list