]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-adminedit.php
Queries improved
[mailer.git] / inc / modules / admin / what-adminedit.php
index 18f9414b7710a9e35f26fe3c1b6970784f207590..d0014a7e57ebe4622cdece09bf2ce8afcddfc2cd 100644 (file)
@@ -52,18 +52,13 @@ if (!empty($_GET['sub']))
 $chk = 0;
 if (!empty($_POST['sel'])) $chk = SELECTION_COUNT($_POST['sel']);
 
-OPEN_TABLE("100%", "admin_content admin_content_align", "");
-
 // List all menu points and make them editable
-OUTPUT_HTML("<br /><br /></FONT>
-<DIV align=\"center\">");
-if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO()))
-{
+if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) {
        // Edit menu entries
        define('__SUB_VALUE', $SUB);
        define('__CHK_VALUE', $chk);
        $cnt = 0; $SW = 2;
-       foreach ($_POST['sel'] as $sel=>$confirm)
+       foreach ($_POST['sel'] as $sel => $confirm)
        {
                if ($confirm == 1)
                {
@@ -112,7 +107,7 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO()))
        define('__CHK_VALUE', $chk);
        // Del menu entries with or without confirmation
        $SW = 2; $cnt = 0; $OUT = "";
-       foreach ($_POST['sel'] as $sel=>$confirm)
+       foreach ($_POST['sel'] as $sel => $confirm)
        {
                if ($confirm == 1)
                {
@@ -158,7 +153,7 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO()))
        switch ($_POST['ok'])
        {
        case "edit": // Edit menu
-               foreach ($_POST['sel'] as $sel=>$menu)
+               foreach ($_POST['sel'] as $sel => $menu)
                {
                        // Secure ID
                        $sel = bigintval($sel);
@@ -182,7 +177,7 @@ WHERE ".$AND." AND id=%s LIMIT 1",
                break;
 
        case "del": // Delete menu
-               foreach ($_POST['sel'] as $sel=>$menu)
+               foreach ($_POST['sel'] as $sel => $menu)
                {
                        $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE ".$AND." AND id=%s LIMIT 1",
                         array(bigintval($sel)), __FILE__, __LINE__);
@@ -240,7 +235,7 @@ WHERE ".$AND." AND id=%s LIMIT 1",
        if (!empty($SUB))
        {
                // Sub menus of a main menu
-               $result = SQL_QUERY_ESC("SELECT id, action, what, title, sort FROM "._MYSQL_PREFIX."_admin_menu WHERE action='%s' AND what != '' ORDER BY sort ASC",
+               $result = SQL_QUERY_ESC("SELECT id, action, what, title, sort FROM "._MYSQL_PREFIX."_admin_menu WHERE action='%s' AND what != '' AND what IS NOT NULL ORDER BY sort ASC",
                 array($SUB), __FILE__, __LINE__);
        }
         else
@@ -302,7 +297,6 @@ WHERE ".$AND." AND id=%s LIMIT 1",
                LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NO_MENUS_FOUND);
        }
 }
-OUTPUT_HTML("</DIV>");
-CLOSE_TABLE();
+
 //
 ?>