#!/tools/ns/bin/perl5
#
##############################################################################
#
# The contents of this file are subject to the Netscape Public License Version
# 1.0 (the "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at http://www.mozilla.org/NPL/ 
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
# the specific language governing rights and limitations under the License. 
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are Copyright (C) 1998 Netscape
# Communications Corporation. All Rights Reserved.
#
##############################################################################
#
# stats.pl
#
# Create a simple web page with stats on it
#
#

$PATH   = "/u/sheneman/projects/cleanup/current/stats";
$EXFILE = "/u/sheneman/projects/cleanup/psoftsync_verbose.txt";

system("cp $PATH/stats.new $PATH/stats.old");
$result = `cat $EXFILE | grep Error | wc -l > $PATH/stats.new`;

open (OUT, ">/u/sheneman/projects/cleanup/current/stats/index.html");

print (OUT "<HTML>\n");
print (OUT "<BODY bgcolor=\"#ffffff\">\n");
print (OUT "<H1> <CENTER> Statistics </CENTER> </H1>\n");

print (OUT "<HR>\n\n");

$last_week = `cat $PATH/stats.old`;
print (OUT "<H2>\n");
print (OUT "Total Exceptions Found in the PeopleSoft->LDAP sync: <br> <br> <br>");
print (OUT "<CENTER>\n");
print (OUT "Exceptions Last Week: $last_week <br>");

$this_week = `cat $PATH/stats.new`;
print (OUT "Exceptions This Week: $this_week <br>");
print (OUT "</CENTER> </H2>\n");

print (OUT "</BODY>\n");
print (OUT "</HTML>\n");

close (OUT);

 



