diff admajax.php @ 1104:0a2117349f46

s/true/TRUE/g; s/false/FALSE/g;
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 14 May 2019 14:45:36 +0300
parents 95b74632cfe2
children 51f24cb35fc8
line wrap: on
line diff
--- a/admajax.php	Tue May 14 14:12:42 2019 +0300
+++ b/admajax.php	Tue May 14 14:45:36 2019 +0300
@@ -193,7 +193,7 @@
   $str = "<div class=\"editControl\"><span class=\"editControlTitle\">".chentities($title)."</span>\n";
 
   // Show currently selected / active file
-  if (($efile = stFetchSQL("SELECT * FROM files WHERE deleted=0 AND id=".$entry[$file_id])) !== false)
+  if (($efile = stFetchSQL("SELECT * FROM files WHERE deleted=0 AND id=".$entry[$file_id])) !== FALSE)
   {
     $str .=
       "<div>File: <b>".chentities($efile["filename"])."</b></div>\n".
@@ -252,7 +252,7 @@
   {
     echo
       "  <div class=\"entryRow ".($row % 2 == 1 ? "rodd" : "reven").
-      "\"".($mode == EEMODE_NORMAL ? " id=\"entry".$eid."\" onClick=\"activateEntry(".$eid.", false)\"" : "").">\n";
+      "\"".($mode == EEMODE_NORMAL ? " id=\"entry".$eid."\" onClick=\"activateEntry(".$eid.", FALSE)\"" : "").">\n";
   }
 
   // Only show show_id if this is a normal compo and we are not adding
@@ -474,7 +474,7 @@
     $sql = stPrepareSQL("SELECT * FROM entries WHERE show_id=%d AND compo_id=%d",
       $show_id, $compo_id);
 
-    if (($entry = stFetchSQL($sql)) !== false)
+    if (($entry = stFetchSQL($sql)) !== FALSE)
     {
       // Entry show#/title/author information
       $str =
@@ -485,7 +485,7 @@
         "</div>";
 
       // File information for quick reference
-      if (($efile = stFetchSQL("SELECT * FROM files WHERE deleted=0 AND id=".$entry["file_id"])) !== false)
+      if (($efile = stFetchSQL("SELECT * FROM files WHERE deleted=0 AND id=".$entry["file_id"])) !== FALSE)
       {
         foreach (array("S" => "filename", "O" => "origname") as $ftitle => $fid)
         {
@@ -516,7 +516,7 @@
   if ($compoID > 0)
   {
     $sql = stPrepareSQL("SELECT * FROM compos WHERE id=%d", $compoID);
-    if (($entry = stFetchSQL($sql)) !== false)
+    if (($entry = stFetchSQL($sql)) !== FALSE)
       $strCompo = chentities($entry["name"]);
 
     $strCurrEntry = stGetInfoEntryData(stGetDisplayVar("compoCurrEntry"), $compoID, TRUE);
@@ -544,7 +544,7 @@
 
   $str = stGetFormOptionListStart("ctrlEntryList", $indent, $outer);
 
-  if (($res = stExecSQL($sql)) !== false)
+  if (($res = stExecSQL($sql)) !== FALSE)
   {
     foreach ($res as $item)
     {
@@ -572,7 +572,7 @@
   $str = stGetFormOptionListStart("ctrlRotationLists", $indent, $outer);
   $currListID = stGetDisplayVar("rotateList");
 
-  if (($res = stExecSQL($sql)) !== false)
+  if (($res = stExecSQL($sql)) !== FALSE)
   {
     foreach ($res as $item)
     {
@@ -591,7 +591,7 @@
   $str = stGetFormOptionListStart("ctrlDisplaySlides", $indent, $outer);
 
   $sql = "SELECT * FROM display_slides ORDER BY id DESC";
-  if (($res = stExecSQL($sql)) !== false)
+  if (($res = stExecSQL($sql)) !== FALSE)
   {
     foreach ($res as $item)
       $str .= stGetFormOptionListItem($indent."  ", $item["id"], FALSE, $item["title"]);
@@ -604,7 +604,7 @@
 function stGetInfoRotationListEditFull($indent, $outer, $list_id)
 {
   $sql = stPrepareSQL("SELECT * FROM rot_list_data WHERE id=%d", $list_id);
-  if (($data = stFetchSQL($sql)) === false)
+  if (($data = stFetchSQL($sql)) === FALSE)
     return "<p>No such rotation list ID #".intval($list_id)."</p>";
   
   $str =
@@ -616,7 +616,7 @@
     stGetFormOptionListStart("ctrlEDDisplaySlides", $indent."  ", TRUE);
 
   $sql = "SELECT * FROM display_slides";
-  if (($res = stExecSQL($sql)) !== false)
+  if (($res = stExecSQL($sql)) !== FALSE)
   {
     foreach ($res as $item)
       $str .= stGetFormOptionListItem($indent."    ", $item["id"], FALSE, $item["title"]);
@@ -650,7 +650,7 @@
 
   $str = stGetFormOptionListStart("ctrlEDRotationList", $indent, $outer);
 
-  if (($res = stExecSQL($sql)) !== false)
+  if (($res = stExecSQL($sql)) !== FALSE)
   {
     foreach ($res as $item)
     {
@@ -670,7 +670,7 @@
   $str = $indent.($outer ? "<div id=\"ctrlActiveRotationList\">" : "").
     "<b>Active list:</b> ";
 
-  if (($slist = stFetchSQL($sql)) === false)
+  if (($slist = stFetchSQL($sql)) === FALSE)
     $str .= "-";
   else
     $str .= chentities(substr($slist["name"], 0, 40));
@@ -689,7 +689,7 @@
     $indent."    <div class=\"ctrlTitle\">Edit display slide</div>\n";
 
   $sql = stPrepareSQL("SELECT * FROM display_slides WHERE id=%d", $slide_id);
-  if (($slide = stFetchSQL($sql)) !== false)
+  if (($slide = stFetchSQL($sql)) !== FALSE)
   {
     $str .=
       "    ".stGetFormTextInput(40, SET_LEN_DISP_SLIDE_TITLE, "", "Title", $prefix, $slide["title"])."<br />\n".
@@ -760,7 +760,7 @@
     foreach ($final as $entry)
     {
       $sql = stPrepareSQL("UPDATE entries SET show_id=%d WHERE id=%d", $index, $entry);
-      if (stExecSQL($sql) === false)
+      if (stExecSQL($sql) === FALSE)
       {
         stError("Error updating entry show positions.");
         break;
@@ -889,7 +889,7 @@
     $nentries = $ncompos = 0;
     foreach (stExecSQL("SELECT * FROM compos WHERE ctype=".COMPO_NORMAL) as $compo)
     {
-      if (($ne = stFetchSQLColumn("SELECT COUNT(*) FROM entries WHERE compo_id=".$compo["id"])) !== false && $ne > 0)
+      if (($ne = stFetchSQLColumn("SELECT COUNT(*) FROM entries WHERE compo_id=".$compo["id"])) !== FALSE && $ne > 0)
       {
         $nentries += $ne;
         $ncompos++;
@@ -901,7 +901,7 @@
     $nentries = $ncompos = 0;
     foreach (stExecSQL("SELECT * FROM compos WHERE ctype <> ".COMPO_NORMAL) as $compo)
     {
-      if (($ne = stFetchSQLColumn("SELECT COUNT(*) FROM entries WHERE compo_id=".$compo["id"])) !== false && $ne > 0)
+      if (($ne = stFetchSQLColumn("SELECT COUNT(*) FROM entries WHERE compo_id=".$compo["id"])) !== FALSE && $ne > 0)
       {
         $nentries += $ne;
         $ncompos++;
@@ -953,7 +953,7 @@
       case "setCompoID":
         if (stChkRequestItem("id", $compo_id, array(CHK_TYPE, VT_INT, "Invalid data.")))
         {
-          if (stFetchSQL("SELECT id FROM compos WHERE id=".$compo_id) === false)
+          if (stFetchSQL("SELECT id FROM compos WHERE id=".$compo_id) === FALSE)
             stError("Invalid compo ID ".$compo_id);
           else
           {
@@ -1007,7 +1007,7 @@
             stChkRequestItem("duration", $slide_dur, array(CHK_RANGE, VT_INT, array(1, 60), "Invalid duration range, should be 1-60 min.")))
         {
           $sql = stPrepareSQL("SELECT * FROM display_slides WHERE id=%d", $slide_id);
-          if (($slide = stFetchSQL($sql)) !== false)
+          if (($slide = stFetchSQL($sql)) !== FALSE)
           {
             stSetDisplayVar("tempDuration", $slide_dur);
             stSetDisplayVar("tempSlide", $slide["id"]);
@@ -1032,12 +1032,12 @@
         if (stChkRequestItem("id", $slide_id, array(CHK_TYPE, VT_INT, "Invalid data.")))
         {
           $sql = stPrepareSQL("SELECT * FROM display_slides WHERE id=%d", $slide_id);
-          if (($slide = stFetchSQL($sql)) !== false)
+          if (($slide = stFetchSQL($sql)) !== FALSE)
           {
             $sql = stPrepareSQL("INSERT INTO display_slides (title,text) VALUES (%s,%s)",
               $slide["title"]." (copy)", $slide["text"]);
 
-            if (($new_id = stExecSQLInsert($sql)) !== false)
+            if (($new_id = stExecSQLInsert($sql)) !== FALSE)
               echo stGetInfoDisplaySlideEdit("", TRUE, $new_id);
             else
               stError("Could not insert slide.");
@@ -1049,7 +1049,7 @@
 
       case "newDisplaySlide":
         $sql = stPrepareSQL("INSERT INTO display_slides (title) VALUES (%s)", "New slide");
-        if (($slide_id = stExecSQLInsert($sql)) !== false)
+        if (($slide_id = stExecSQLInsert($sql)) !== FALSE)
           echo stGetInfoDisplaySlideEdit("", TRUE, $slide_id);
         break;
 
@@ -1070,7 +1070,7 @@
               "text" => "S",
             ));
 
-          if (stExecSQL($sql) !== false)
+          if (stExecSQL($sql) !== FALSE)
           {
             stSetStatus(200, "Slide updated.");
             stDisplayUpdated();
@@ -1092,12 +1092,12 @@
 
       case "newRotationList":
         $sql = stPrepareSQL("INSERT INTO rot_list_data (name) VALUES (%s)", "New list #");
-        if (($list_id = stExecSQLInsert($sql)) !== false)
+        if (($list_id = stExecSQLInsert($sql)) !== FALSE)
         {
           $sql = stPrepareSQL("UPDATE rot_list_data SET name=%s WHERE id=%d",
             "New list #".$list_id, $list_id);
 
-          if (stExecSQLCond($sql, "OK!") !== false)
+          if (stExecSQLCond($sql, "OK!") !== FALSE)
             echo stGetInfoRotationListEditFull("", TRUE, $list_id);
         }
         break;
@@ -1291,7 +1291,7 @@
           "ORDER BY compos.id DESC";
 
         $currCompoID = stGetDisplayVar("compoID");
-        if (($res = stExecSQL($sql)) !== false)
+        if (($res = stExecSQL($sql)) !== FALSE)
         {
           foreach ($res as $item)
           {
@@ -1446,9 +1446,9 @@
 
         while ($numVKeys <= $numUsers)
         {
-          if (($key = stGenerateUserKey()) !== false)
+          if (($key = stGenerateUserKey()) !== FALSE)
           {
-            if (stExecSQL(stPrepareSQL("INSERT INTO userkeys (key) VALUES (%s)", $key)) !== false)
+            if (stExecSQL(stPrepareSQL("INSERT INTO userkeys (key) VALUES (%s)", $key)) !== FALSE)
               $numVKeys++;
           }
         }
@@ -1629,19 +1629,19 @@
           if ($index++ > 0) echo ",";
           echo
             "\"".$compo["id"]."\":\"".chentities($compo["name"]).
-            (($ne !== false && $ne > 0) ? " <span class='cnotice'>(".$ne.")</span>" : "")."\"";
+            (($ne !== FALSE && $ne > 0) ? " <span class='cnotice'>(".$ne.")</span>" : "")."\"";
         }
         break;
 
       case "compovoting":
         $id = intval(stGetRequestItem("id", 0));
-        if (($compo = stFetchSQL("SELECT * FROM compos WHERE id=".$id)) !== false)
+        if (($compo = stFetchSQL("SELECT * FROM compos WHERE id=".$id)) !== FALSE)
           echo stGetCompoVoting($compo, FALSE);
         break;
 
       case "entries":
         $id = intval(stGetRequestItem("id", 0));
-        if (($compo = stFetchSQL("SELECT * FROM compos WHERE id=".$id)) !== false)
+        if (($compo = stFetchSQL("SELECT * FROM compos WHERE id=".$id)) !== FALSE)
         {
           $nentries = stFetchSQLColumn("SELECT COUNT(*) FROM entries WHERE compo_id=".$id);
           $prefix = "ne";
@@ -1713,7 +1713,7 @@
       {
         // Attendees require some more work
         $sql = stPrepareSQL("SELECT * FROM attendees WHERE id=%d", $id);
-        if (($attn = stFetchSQL($sql)) !== false)
+        if (($attn = stFetchSQL($sql)) !== FALSE)
         {
           $sql = stPrepareSQL("DELETE FROM attendees WHERE id=%d", $id);
           stExecSQLCond($sql, "OK, attendee ".$id." deleted.");
@@ -1869,7 +1869,7 @@
       if ($type == "compo")
       {
         // Check if compo ID exists
-        if (($compo = stFetchSQL("SELECT * FROM compos WHERE id=".$id)) === false)
+        if (($compo = stFetchSQL("SELECT * FROM compos WHERE id=".$id)) === FALSE)
           stError("No such compo ID.");
         else
         if (stValidateRequestCompoData(TRUE, $compo["ctype"]))
@@ -1955,12 +1955,12 @@
           // Check if already assigned to someone ..
           $key_id = intval(stGetRequestItem("key_id", 0));
           $sql = stPrepareSQL("SELECT * FROM userkeys WHERE id=%d", $key_id);
-          if (stFetchSQL($sql) === false)
+          if (stFetchSQL($sql) === FALSE)
             stError("Invalid key ID #.");
           else
           {
             $sql = stPrepareSQL("SELECT * FROM attendees WHERE key_id=%d", $key_id);
-            if (($attn = stFetchSQL($sql)) !== false && $attn["id"] != $id)
+            if (($attn = stFetchSQL($sql)) !== FALSE && $attn["id"] != $id)
               stError("That key has already been assigned to another attendee!");
             else
             {