]> lifelog.hopto.org Git - LifeLog.git/commitdiff
Categories update.
authorMetabox <redacted>
Mon, 5 Aug 2019 08:37:09 +0000 (18:37 +1000)
committerMetabox <redacted>
Mon, 5 Aug 2019 08:37:09 +0000 (18:37 +1000)
dbLifeLog/main.cnf
htdocs/cgi-bin/config.cgi
htdocs/cgi-bin/main.cgi

index 2f3e801ad9a52c18e40d94eec7069ef410bdee20..a1435dc2d0870febefa5978568a646e7a3575f56 100644 (file)
@@ -21,7 +21,7 @@ Credential format:<<AUTO_LOGIN <{alias}/{password}> , must be enabled option.
 28|$THEME       = Standard`Theme to applay, Standard, Sun, Moon, Earth.
 <<CAT<3>
 01|Unspecified `For quick uncategorised entries.
-03|File System `Operating file system short log.
+03|File System `Operating file system/Application short log.
 06|System Log  `Operating system important log.
 09|Event       `Event that occurred, meeting, historically important.
 28|Personal    `Personal log of historical importance, diary type.
@@ -30,6 +30,9 @@ Credential format:<<AUTO_LOGIN <{alias}/{password}> , must be enabled option.
 40|Work        `Work related entry, worth monitoring.
 45|Food        `Quick reference to recipes, observations.
 50|Music       `Music reference of interest. Youtube embbed.
+52|Sport/Club  `Sport or Social related entry.
+55|Cars        `Car(s) related entry.
+60|Online      `Online purchases (ebay, or received/ordered from online source).
 <<MIG<>
 LOG<5>|ALTER TABLE LOG ADD RTF BOOL DEFAULT 0;' ver. 1.5
 NOTES|DROP TABLE NOTES;' ver. 1.5 fts4 virtual tables have been scratched as they require special SQLite compilation.
index 5315fa645f7574e4e2afab1e931dc2dc932ead48..1a665e99d458140faf723350fa7a7ee5f07149d9 100755 (executable)
@@ -91,6 +91,12 @@ $rv = $dbs->execute() or die or die "<p>Error->"& $DBI::errstri &"</p>";
 my $status = "Ready for change!";
 
 print $cgi->header(-expires=>"+6s", -charset=>"UTF-8");
+
+###############
+&processSubmit;
+###############
+
+
 print $cgi->start_html(-title => "Personal Log", -BGCOLOR=>"#c8fff8",
                -onload  => "loadedBody();",               
                    -style   => [
@@ -123,9 +129,7 @@ print $cgi->start_html(-title => "Personal Log", -BGCOLOR=>"#c8fff8",
       ],
                );
 
-###############
-&processSubmit;
-###############
+
 
 print qq(<div id="menu" title="To close this menu click on its heart, and wait.">
 <div class="hdr" style="marging=0;padding:0px;">
@@ -682,19 +686,19 @@ catch{
 }
 
 sub resetCategories {
-                               $dbs = $db->prepare("DELETE FROM CAT;");
-                               $dbs->execute();
-                               $dbs = $db->prepare("DROP TABLE CAT;");
-                               $dbs->execute();
-                               $LOGOUT = 1;
+       $dbs = $db->prepare("DELETE FROM CAT;");
+       $dbs->execute();
+       $dbs = $db->prepare("DROP TABLE CAT;");
+       $dbs->execute();
+       $LOGOUT = 1;
 }
 
 sub wipeSystemConfiguration {
-                               $dbs = $db->prepare("DELETE FROM CONFIG;");
-                               $dbs->execute();
-                               $dbs = $db->prepare("DROP TABLE CONFIG;");
-                               $dbs->execute();
-                               $LOGOUT = 1;
+       $dbs = $db->prepare("DELETE FROM CONFIG;");
+       $dbs->execute();
+       $dbs = $db->prepare("DROP TABLE CONFIG;");
+       $dbs->execute();
+       $LOGOUT = 1;
 }
 
 
index 713fdc30caa6253533e8655b07e409aadbfec37f..48c81f480bb5deb0a50502b81cf0519de583af6e 100755 (executable)
@@ -172,7 +172,7 @@ print $cgi->start_html(
 
 my $rv;
 my $st;
-my $stmtCat = "SELECT ID, NAME, DESCRIPTION FROM CAT;";
+my $stmtCat = "SELECT ID, NAME, DESCRIPTION FROM CAT ORDER BY ID;";
 my $stmt =
 "SELECT rowid, ID_CAT, DATE, LOG, AMMOUNT, RTF FROM LOG ORDER BY DATE DESC, rowid DESC;";
 
@@ -860,10 +860,10 @@ return $today;
             #What happened? We must check and delete, regardles. As data is renumerated and shuffled from perl in database. :(
                       $st = $db->prepare("SELECT LID FROM NOTES WHERE LID = '$lid[0]';");
                       $st->execute();  
-                      if($st->fetchrow_array()){
-                          print qq(<p>Warning deleted (possible old) NOTES.LID -> lid:$lid[0]</p>);
+                      if($st->fetchrow_array()){                          
                           $st = $db->prepare("DELETE FROM NOTES WHERE LID = '$lid[0]';");
                           $st->execute();  
+                          print qq(<p>Warning deleted (possible old) NOTES.LID[$lid[0]] -> lid:$lid[0]</p>);
                       }
                       $st = $db->prepare("INSERT INTO NOTES(LID, DOC) VALUES (?, ?);"); 
                      #