diff --git a/distfiles/admin.php b/distfiles/admin.php index 8d89dbe..a2373a4 100644 --- a/distfiles/admin.php +++ b/distfiles/admin.php @@ -764,17 +764,25 @@ switch ($table) { "; // pull current values from database $currentvalues = mysqli_fetch_assoc(mysqli_query($db, "select * from techs where techid=$id")); - $name = $currentvalues["techname"]; - $pass = $passconf = "password_is_unchanged"; - $shift = $currentvalues["shift"]; - if ($currentvalues["admin"] == 1) { - $admintag = ""; + if (!empty($currentvalues)) { + $name = $currentvalues["techname"]; + $pass = $passconf = "password_is_unchanged"; + $shift = $currentvalues["shift"]; + if ($currentvalues["admin"] == 1) { + $admintag = ""; + } else { + $admintag = ""; + } + if ($currentvalues["status"] == 1) { + $activetag = ""; + } else { + $activetag = ""; + } } else { + $name = NULL; + $pass = NULL; + $shift = NULL; $admintag = ""; - } - if ($currentvalues["status"] == 1) { - $activetag = ""; - } else { $activetag = ""; } } else { @@ -878,10 +886,15 @@ switch ($table) { "; // pull current values from database $currentvalues = mysqli_fetch_assoc(mysqli_query($db, "select * from shifts where shiftid=$id")); - $name = $currentvalues["shiftname"]; - if ($currentvalues["status"] == 1) { - $activetag = ""; + if (!empty($currentvalues)) { + $name = $currentvalues["shiftname"]; + if ($currentvalues["status"] == 1) { + $activetag = ""; + } else { + $activetag = ""; + } } else { + $name = NULL; $activetag = ""; } } else { @@ -952,10 +965,15 @@ switch ($table) { "; // pull current values from database $currentvalues = mysqli_fetch_assoc(mysqli_query($db, "select * from subjects where subjectid=$id")); - $name = $currentvalues["subjectname"]; - if ($currentvalues["status"] == 1) { - $activetag = ""; + if (!empty($currentvalues)) { + $name = $currentvalues["subjectname"]; + if ($currentvalues["status"] == 1) { + $activetag = ""; + } else { + $activetag = ""; + } } else { + $name = ""; $activetag = ""; } } else { @@ -1026,12 +1044,19 @@ switch ($table) { "; // pull current values from database $currentvalues = mysqli_fetch_assoc(mysqli_query($db, "select * from links where linkid=$id")); - $name = $currentvalues["displaytxt"]; - $priority = $currentvalues["linkpriority"]; - $url = $currentvalues["urltxt"]; - if ($currentvalues["status"] == 1) { - $activetag = ""; + if (!empty($currentvalues)) { + $name = $currentvalues["displaytxt"]; + $priority = $currentvalues["linkpriority"]; + $url = $currentvalues["urltxt"]; + if ($currentvalues["status"] == 1) { + $activetag = ""; + } else { + $activetag = ""; + } } else { + $name = NULL; + $priority = NULL; + $url = NULL; $activetag = ""; } // determine where we are in the priority stack @@ -1145,10 +1170,22 @@ switch ($table) { "; // pull current values from database $currentvalues = mysqli_fetch_assoc(mysqli_query($db, "select * from flags where flagid=$id")); - $name = $currentvalues["flagname"]; - $flagsym = $currentvalues["flagsym"]; - $flagcolor = $currentvalues["flagcolor"]; - $flagcoloropts = ""; + if (!empty($currentvalues)) { + $name = $currentvalues["flagname"]; + $flagsym = $currentvalues["flagsym"]; + $flagcolor = $currentvalues["flagcolor"]; + $flagcoloropts = ""; + if ($currentvalues["status"] == 1) { + $activetag = ""; + } else { + $activetag = ""; + } + } else { + $name = NULL; + $flagsym = NULL; + $flagcolor = NULL; + $activetag = ""; + } foreach ($basic_colors as $cname => $chex) { if ($chex == $flagcolor) { $flagcoloropts = $flagcoloropts . ""; @@ -1156,11 +1193,6 @@ switch ($table) { $flagcoloropts = $flagcoloropts . ""; } } - if ($currentvalues["status"] == 1) { - $activetag = ""; - } else { - $activetag = ""; - } } else { // set form options for add $sectiontitle = "Add New Flag

"; @@ -1246,10 +1278,15 @@ switch ($table) { "; // pull current values from database $currentvalues = mysqli_fetch_assoc(mysqli_query($db, "select * from logpartactions where lpactionid=$id")); - $name = $currentvalues["lpactionname"]; - if ($currentvalues["status"] == 1) { - $activetag = ""; + if (!empty($currentvalues)) { + $name = $currentvalues["lpactionname"]; + if ($currentvalues["status"] == 1) { + $activetag = ""; + } else { + $activetag = ""; + } } else { + $name = NULL; $activetag = ""; } } else { @@ -1320,9 +1357,15 @@ switch ($table) { "; // pull current values from database $currentvalues = mysqli_fetch_assoc(mysqli_query($db, "select * from banners where bannerid=$id")); - $name = $currentvalues["bannername"]; - $bnrcolor = $currentvalues["bannercolor"]; - $bnrtextcolor = $currentvalues["textcolor"]; + if (!empty($currentvalues)) { + $name = $currentvalues["bannername"]; + $bnrcolor = $currentvalues["bannercolor"]; + $bnrtextcolor = $currentvalues["textcolor"]; + } else { + $name = NULL; + $bnrcolor = NULL; + $bnrtextcolor = NULL; + } $bnrcoloropts = ""; foreach ($basic_colors as $cname => $chex) { if ($chex == $bnrcolor) {