X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=maps%2Fphp%2FMAPS.php;h=72e13904992d9f0da690577916966c52dc961fac;hb=8dc4fbdb6ca710c7667dda9f6b7b1acac663bbfc;hp=18b9abe9640da8532512c797a6bb69a70b9bef9f;hpb=020a4a5ea2be725b155cae3a2cadc9aba3911b9b;p=clearscm.git diff --git a/maps/php/MAPS.php b/maps/php/MAPS.php index 18b9abe..72e1390 100755 --- a/maps/php/MAPS.php +++ b/maps/php/MAPS.php @@ -37,18 +37,18 @@ $Types = array ( function DBError ($msg, $statement) { $errno = mysql_errno (); $errmsg = mysql_error (); - print "$msg\nError # $errno $errmsg"; - print "SQL Statement: $statement"; + print "$msg
Error # $errno $errmsg"; + print "
SQL Statement: $statement"; exit ($errno); } // DBError function OpenDB () { - $db = mysql_pconnect ("localhost", "mapsadmin", "mapsadmin") + $db = mysql_connect ("localhost", "mapsadmin", "mapsadmin") or DBError ("OpenDB: Unable to connect to database server", "Connect"); mysql_select_db ("MAPS") - or DBError ("OpenDB: Unable to select MAPS database", "MAPS"); + or DBError ("OpenDB: Unable to select MAPS database", "adefaria_maps"); } // OpenDB function SetContext ($new_userid) { @@ -144,7 +144,7 @@ function Today2SQLDatetime () { function countem ($table, $condition) { $statement = "select count(distinct sender) as count from $table where $condition"; - $result = mysql_query ($statement) + $result = mysql_query ($statement) or DBError ("countem: Unable to perform query: ", $statement); // How many rows are there? @@ -164,7 +164,7 @@ function countlog ($condition="") { } // countlog function SubtractDays ($date, $nbr_days) { - + } // SubtractDays function GetStats ($nbr_days, $date = "") { @@ -205,31 +205,31 @@ function displayquickstats () { $processed = $dates[$today]["processed"]; $returned = $dates[$today]["returned"]; - $returned_pct = $processed == 0 ? 0 : + $returned_pct = $processed == 0 ? 0 : number_format ($returned / $processed * 100, 1, ".", ""); $whitelist = $dates[$today]["whitelist"]; - $whitelist_pct = $processed == 0 ? 0 : + $whitelist_pct = $processed == 0 ? 0 : number_format ($whitelist / $processed * 100, 1, ".", ""); $blacklist = $dates[$today]["blacklist"]; - $blacklist_pct = $processed == 0 ? 0 : + $blacklist_pct = $processed == 0 ? 0 : number_format ($blacklist / $processed * 100, 1, ".", ""); $registered = $dates[$today]["registered"]; $mailloop = $dates[$today]["mailloop"]; $nulllist = $dates[$today]["nulllist"]; - $nulllist_pct = $processed == 0 ? 0 : + $nulllist_pct = $processed == 0 ? 0 : number_format ($nulllist / $processed * 100, 1, ".", ""); - $returned_link = $returned == 0 ? 0 : + $returned_link = $returned == 0 ? 0 : "$returned"; - $whitelist_link = $whitelist == 0 ? 0 : + $whitelist_link = $whitelist == 0 ? 0 : "$whitelist"; - $blacklist_link = $blacklist == 0 ? 0 : + $blacklist_link = $blacklist == 0 ? 0 : "$blacklist"; - $registered_link = $registered == 0 ? 0 : + $registered_link = $registered == 0 ? 0 : "$registered"; - $mailloop_link = $mailloop == 0 ? 0 : + $mailloop_link = $mailloop == 0 ? 0 : "$mailloop"; - $nulllist_link = $nulllist == 0 ? 0 : + $nulllist_link = $nulllist == 0 ? 0 : "$nulllist"; print <<
Search Sender/Subject -
@@ -399,7 +399,7 @@ function DisplayList ($type, $next, $lines) { $last_hit = substr ($last_hit, 5, 2) . "/" . substr ($last_hit, 8, 2) . "/" . substr ($last_hit, 0, 4); - $leftclass = ($i == $lines || $sequence == $total || $sequence == $last) ? + $leftclass = ($i == $lines || $sequence == $total || $sequence == $last) ? "tablebottomleft" : "tableleftdata"; $dataclass = ($i == $lines || $sequence == $total || $sequence == $last) ? "tablebottomdata" : "tabledata"; @@ -505,8 +505,8 @@ function Space () { or DBError ("Space: Unable to execute query: ", $statement); while ($row = mysql_fetch_array ($result)) { - $msg_space = - strlen ($row["userid"]) + + $msg_space = + strlen ($row["userid"]) + strlen ($row["sender"]) + strlen ($row["subject"]) + strlen ($row["timestamp"]) +