#!/usr/bin/perl

use mysql2_1;
use mydate;
require('cgi-lib.pl');

&ReadParse;

$todate = &StringDate;
$noffset = $in{'nof'};
$coffset = $in{'cof'};
$index   = $in{'in'};
$cindex  = $in{'cin'};

$ndisplay = 1; # number of displayed network msgs
$cdisplay = 18; # number of displayed community msgs

$news = "network.txt";
$community = "community.txt";
$outlook = "outlook.txt";

$nofftemp = $noffset;
$cofftemp = $coffset;

$/ = "&break&";

print "Content-type: text/html\n\n";
print <<HTML_MSG;
<html>

<head>
<meta name="author" content="enrico agodilla">
<meta name="date" content="18feb2002">
<LINK REL="icon" HREF="favicon.png" TYPE="image/png">
<LINK REL="SHORTCUT ICON" HREF="favicon.ico">
<title>The UP Manila Intranet Website</title>
</head>

<body topmargin="0" leftmargin="0" link="#000080" vlink="#000080" alink="#008080">

<table border="0" width="100%" height="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td width="100%" valign="middle" align="center" bgcolor="#800000">&nbsp;<table border="0"
    width="96%" height="440" cellspacing="0" cellpadding="0">
      <tr>
        <td width="100%" bgcolor="#FFFFFF" align="center"><table border="0" width="96%" height="440"
        cellspacing="0" cellpadding="0">
          <tr>
            <td valign="top" height="180" align="center" width="238" bgcolor="#FFFFFF"><table
            border="0" width="100%" cellspacing="5" cellpadding="0">
              <tr>
                <td width="100%" align="center" valign="top" background="wimg/bg_portal.gif"><br>
                <img src="wimg/oblation.gif" width="200" height="222" alt="Oblation"></td>
              </tr>
            </table><br>
<!--<table border="0" width="85%" cellpadding="4">
  <tr>
    <td width="100%" bgcolor="#C0C0C0"><font face="Verdana" size="2" color="#000000"><strong>Today's
    Outlook:</strong></font></td>
  </tr>
  <tr>
    <td width="100%" bgcolor="#808080"><font face="Verdana" size="2" color="white">
HTML_MSG
#----------------------------------
# Today's Outlook, examples:
#
#    All services are up.<br>
#    Web access is normal.<br>
#    Email delivery is normal.
#

$format = "&0&<br>";
PrintFile($outlook, "&col&", "\n", $format);
#----------------------------------
print <<HTML_MSG;
  </font></td>
  </tr>
</table>-->
            <p align="left">
            <strong>&nbsp; <font face="Verdana" size="1" color="#004000">campus
            links:</font> <br>
            </strong>
HTML_MSG
#<!------------------------->

$format='   <font face="Verdana" size="2">
              &nbsp;&nbsp;
              <img src="wimg/home.gif">
              <a href="&1&" style="text-decoration:none">
                &0&
              </a><br>
            </font>'."\n";

PrintFile("campus.menu", "&col&", "\n", $format);

print '            <p align="left">'."\n";
print '            <strong>&nbsp; <font face="Verdana" size="1" '."\n";
print '            color="#004000">informative links:</font> <br> </strong>'."\n";

$format=~s/home/addressbook/g;
PrintFile("informative.menu", "&col&", "\n", $format);

print <<HTML_MSG;
            &nbsp;
<table border="0" width="100%">
              <tr>
                <td width="238" height="150" valign="top" bgcolor="#B4B4B4"><font size="-1"><form
                action="http://www.upm.edu.ph/cgi-bin/htsearch">
                  <p></font><font size="1" face="Verdana"><br>
                  &nbsp;&nbsp;&nbsp;&nbsp; Search upm.edu.ph for:</font><font size="-1"> <br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input size="13" name="words"> <input type="submit"
                  value="Search"> </font></p>
                  <p>&nbsp;</p>
                </form>
                <p><font size="1" face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp; Visitor's counter: </font><img
                src="/cgi-bin/wwwcount.cgi?ft=0|dd=D|df=web.main.dat" alt="counter "></td>
              </tr>


            </table>
            </td>
            <td width="485" rowspan="2" height="261" valign="top"><div align="right"><table border="0"
            width="443" height="58" cellspacing="0" cellpadding="0">
              <tr>
                <td width="340" align="right" height="52" valign="bottom"><p align="left"><font
                face="Verdana" size="2" color="#004040"><strong><br>
                Information Management Service</strong></font><font size="1" face="Verdana"><br>
                3/F Information Technology Complex, Science Hall, PGH<br>
                Tel. Number: 526-2265</font></p>
                <font face="Verdana" size="1" color="white" style="background-color: maroon">
                  <b>&nbsp;Today is <font color="white" style="background-color: rgb(0, 125, 0)">
                  &nbsp;$todate&nbsp;</font></b>
                </font>
                <hr>
                </td>
                <td width="98" align="center" height="2" valign="middle"><table
border="0" cellspacing="1" width="100%">
                  <tr>
                    <td width="100%">&nbsp; <img src="wimg/upm_logo.gif"></td>
                  </tr>
                </table>
                </td>
              </tr>
            </table>
            </div><table border="0" width="97.5%" height="80%" cellspacing="1" bgcolor="#FFFFFF">
              <tr>
                <td width="100%" valign="top" align="left">
                <table border="0" width="100%" cellspacing="5" cellpadding="5">
                  <tr>
                    <td height="1" bgcolor="#808000" align="center">
                    <font face="Arial" size="2" color="white">
                    <b>Network Announcements</b></font></td>
                  </tr>
                </table>
                <table border="0" width="100%" cellspacing="5"
                cellpadding="10">
HTML_MSG
#-------------------------
$format ='        <tr>
                    <td width="100%" bgcolor="#C9E4E4">
                       <font size="2" face="Verdana">
                       <b>&2&</b>
                       </font><br>
                       <font size="2" face="Verdana">&1&</font>
                       <p>
                       <font size="2" face="Verdana">
                       &3&
                       </font>
                    </td>
                  </tr>'."\n";
if($index ne "") {
  $ndisplay = 1;
  $noffset = &RecordCount($news) - $index;
}
PrintFileLimit($news, "&stop&", $/, $format, $ndisplay, $noffset);
#-------------------------
print <<HTML_MSG;
                  <tr>

                    <td width="87%" bgcolor="#C9E4E4">
                    <p align="left"><font size="1" face="Verdana">Current Network Usage</font>
                    <a href="http://mrtg.upm.edu.ph">

                    <img
src="http://mrtg.upm.edu.ph/antitoxin_4-day.png" width="400" height="108" alt="Click to
Enlarge" border="0"></a>


                    </td>
                  </tr>
                  <tr>
                    <td width="87%" bgcolor="#C9E4E4">
                    <a href="$ENV{'SCRIPT_NAME'}?nof=$noffset&cof=$cofftemp">
                    <font size="1" face="Verdana">(read the news archive)</a>
                    &nbsp;&nbsp;<a href="$ENV{'SCRIPT_NAME'}?nof=0&cof=$cofftemp
">(return home)</a>
                    </font></td>
                  </tr>
                </table>
                <table border="0" width="100%" cellspacing="5" cellpadding="5">
                  <tr>
                    <td height="1" bgcolor="#808080" align="center">
                    <a name="comm">
                    <font face="Arial" size="2" color="white"><b>Community Announcements</b>
                    </font></a></td>
                  </tr>
                </table>
                <table border="0" width="100%" cellspacing="5" cellpadding="10">
HTML_MSG
#-------------------------
$format =~ s/C9E4E4/E4E4E4/g;
if($cindex ne "") {
  $cdisplay = 1;
  $coffset = &RecordCount($community) - $cindex;
}
PrintFileLimit($community, "&stop&", $/, $format, $cdisplay, $coffset);
#-------------------------
print <<HTML_MSG;
                  <tr>
                    <td width="87%" bgcolor="#E4E4E4">
                    <a href="$ENV{'SCRIPT_NAME'}?cof=$coffset&nof=$nofftemp#comm">
                    <font size="2" face="Verdana">(read the news archive)</a>
                    &nbsp;&nbsp;<a href="$ENV{'SCRIPT_NAME'}?cof=0&nof=$nofftemp#comm">(return home
)</a>
                    </font></td>
                  </tr>
                </table>
                </td>
              </tr>
            </table>
            </td>
            <td width="17" rowspan="2" height="261" background="wimg/upm_banner.gif" bgcolor="#000080"></td>
            <td width="30" rowspan="2" height="261" valign="bottom" background="wimg/bg_portal.gif"><span
            style="background-color: rgb(48,97,137); color: rgb(255,255,255)"><small><small><small><font
            face="Verdana"><a
href=http://gubat.upm.edu.ph/~enrico>//rico</a></font></small></small></small></span></td>
          </tr>
        </table>
        </td>
      </tr>
    </table>
    <p align="right"><font face="Verdana" size="1" color="#FFFFFF">
    by enrico agodilla | upm-ims | 2001 | powered by the upm-network |
    best viewed in 800x600
    resolution</font></td>
  </tr>
</table>
</body>
</html>
HTML_MSG

