From: Metabox Date: Mon, 22 Apr 2019 18:50:31 +0000 (+1000) Subject: Added status message. X-Git-Url: https://lifelog.hopto.org/gitweb/?a=commitdiff_plain;h=728f1da8b67ba44c5c40610d9a719d0a589011c3;p=LifeLog.git Added status message. --- diff --git a/htdocs/cgi-bin/config.cgi b/htdocs/cgi-bin/config.cgi index f22c628..a450660 100755 --- a/htdocs/cgi-bin/config.cgi +++ b/htdocs/cgi-bin/config.cgi @@ -66,6 +66,8 @@ my $stmtCat = 'SELECT * FROM CAT ORDER BY ID;'; $dbs = $db->prepare( $stmtCat ); $rv = $dbs->execute() or die or die "

Error->"& $DBI::errstri &"

"; +my $status = "Ready for change!"; + ############### &processSubmit; ############### @@ -102,8 +104,8 @@ my $frm = qq(
WARNING! Removing and changing categories is permanent! Adding one must have unique ID.
- Blanking an category will seek and change LOG records to Unspecified!
- Also ONLY the category Unspecified You can't CHANGE!
If changing here things? + Blanking an category name will remove and seek change LOG records to Unspecified (id 1)!
+ Also ONLY the category Unspecified You can't REMOVE!
If changing here things? Make a backup! (copy existing db file)
@@ -155,6 +157,7 @@ print '
'; print "

Log Configuration In -> $dbname

"; print "\n
\n" . $frm ."\n
\n
"; print "\n
\n" . $frmVars."\n
\n
"; + print "\n
\nSTATUS:" .$status. "\n
\n
"; print '
Back to Main Log
'; print '
'; @@ -163,18 +166,6 @@ print $cgi->end_html; $db->disconnect(); exit; -#http://localhost:8080/cgi-bin/config.cgi? -#nm1=Unspecified&ds1=For+quick+uncategories+entries.& -#nm3=File+System&ds3=Operating+file+system+short+log.& -#nm6=System+Log&ds6=Operating+system+inportant+log.&nm9=Event -#&ds9=Event+that+occured%2C+meeting%2C+historical+important.& -#nm28=Personal&ds28=Personal+log+of+historical+importants%2C+diary+type.& -#nm32=Expense&ds32=Significant+yearly+expense.& -#nm35=Income&ds35=Significant+yearly+income.& -#nm40=Work&ds40=Work+related+entry%2C+worth+monitoring.&nm45=Food& -#ds45=Quick+reference+to+recepies%2C+observations.&caid=55& -#canm=check&cade= - sub processSubmit { my $change = $cgi->param("cchg"); @@ -186,20 +177,18 @@ try{ if ($change == 1){ - while(my @row = $dbs->fetchrow_array()) { my $cid = $row[0]; my $cnm = $row[1]; my $cds = $row[2]; - my $pnm = $cgi->param('nm'.$cid); my $pds = $cgi->param('ds'.$cid); - if($cid!=1 && $pnm ne $cnm || $pds ne $cds){ + if($pnm ne $cnm || $pds ne $cds){ - if($pnm eq ""){ + if($cid!=1 && $pnm eq ""){ $s = "SELECT rowid, ID_CAT FROM LOG WHERE ID_CAT =".$cid.";"; $d = $db->prepare($s); @@ -212,7 +201,7 @@ if ($change == 1){ } #Delete - $s = "DELETE FROM CAT WHERE ID=".$cid.";"; + $s = "DELETE FROM CAT WHERE ID=".$cid.";"; $d = $db->prepare($s); $d->execute(); @@ -222,11 +211,10 @@ if ($change == 1){ $s = "UPDATE CAT SET NAME='".$pnm."', DESCRIPTION='".$pds."' WHERE ID=".$cid.";"; $d = $db->prepare($s); $d->execute(); - } - - } - + } + } } + $status = "Upadated Categories!"; } if($change > 1){ @@ -246,23 +234,25 @@ if($change > 1){ if($cid==$caid || $cnm eq $canm){ $valid = 0; - last; + last; } - } + } if($valid){ $d = $db->prepare('INSERT INTO CAT VALUES (?,?,?)'); $d->execute($caid,$canm, $cade); + $status = "Added Category $canm!"; } else{ - print "

- Client Error: ID->".$caid." or -> Category->".$canm. - " is already assigned, these must be unique!

"; + $status = "ID->".$caid." or -> Category->".$canm." is already assigned, these must be unique!"; + print "

Client Error: $status

"; } + } if ($chgsys == 1){ - &changeSystemSettings; + &changeSystemSettings; + $status = "Changed System Settings!"; } #Re-select @@ -287,13 +277,11 @@ sub getConfiguration{ while (my @r=$dbs->fetchrow_array()){ switch ($r[1]) { - case "REC_LIMIT" {$REC_LIMIT=$r[2]} case "TIME_ZONE" {$TIME_ZONE=$r[2]} case "PRC_WIDTH" {$PRC_WIDTH=$r[2]} case "SESSN_EXPR" {$SESSN_EXPR=$r[2]} else {print "Unknow variable setting: ".$r[1]. " == ". $r[2]} - } } @@ -309,18 +297,15 @@ sub changeSystemSettings{ $dbs->execute(); while (my @r=$dbs->fetchrow_array()){ my $var = $cgi->param('var'.$r[0]); - if($var){ + if($var){ switch ($r[1]) { - case "REC_LIMIT" {$REC_LIMIT=$var; updConfSetting($r[0],$var);} case "TIME_ZONE" {$TIME_ZONE=$var; updConfSetting($r[0],$var);} case "PRC_WIDTH" {$PRC_WIDTH=$var; updConfSetting($r[0],$var);} case "SESSN_EXPR"{$SESSN_EXPR=$var; updConfSetting($r[0],$var);} - } } } - } catch{ print "SERVER ERROR->changeSystemSettings:".$_; diff --git a/htdocs/cgi-bin/login_ctr.cgi b/htdocs/cgi-bin/login_ctr.cgi index 8c2f779..41c0523 100755 --- a/htdocs/cgi-bin/login_ctr.cgi +++ b/htdocs/cgi-bin/login_ctr.cgi @@ -148,8 +148,8 @@ try{ $st = $db->prepare('INSERT INTO CAT VALUES (?,?,?)'); $st->execute(1,"Unspecified", "For quick uncategorised entries."); $st->execute(3,"File System", "Operating file system short log."); - $st->execute(6,"System Log", "Operating system inportant log."); - $st->execute(9,"Event", "Event that occured, meeting, historical important."); + $st->execute(6,"System Log", "Operating system important log."); + $st->execute(9,"Event", "Event that occured, meeting, historically important."); $st->execute(28,"Personal", "Personal log of historical importants, diary type."); $st->execute(32, "Expense", "Significant yearly expense."); $st->execute(35, "Income", "Significant yearly income.");