Esempio n. 1
0
     $display_mo = new Date();
 }
 //Set the date to the first day of the month.
 $display_mo->setDayMonthYear(1, $display_mo->getMonth(), $display_mo->getYear());
 // Get the previous day from the displayed month.
 $prevDay = $display_mo->getPrevDay();
 $prevDay->setDayMonthYear(1, $prevDay->getMonth(), $prevDay->getYear());
 // Get the next day in from the diplayed month.
 $display_mo->setDayMonthYear($display_mo->getDaysInMonth(), $display_mo->getMonth(), $display_mo->getYear());
 $nextDay = $display_mo->getNextDay();
 $template->setCurrentBlock("NAVIGATION");
 $template->setVariable("MONTH", "{$display_mo->getMonthName()} {$display_mo->getYear()}");
 $template->setVariable("PREVIOUS", $prevDay->format("%Y-%m-%d"));
 $template->setVariable("NEXT", $nextDay->format("%Y-%m-%d"));
 $template->setVariable("TYPE", $display);
 setSelectOption($display, $template);
 $template->parseCurrentBlock();
 $Month = new Calendar_Month_Weekdays($display_mo->getYear(), $display_mo->getMonth(), 1);
 $Month->build();
 $template->setCurrentBlock("WEEK");
 while ($Day = $Month->fetch()) {
     // Set the delete all button to off by default.
     $delAll = FALSE;
     if ($Day->isFirst()) {
         // Set the begining block area to {ONE}
         // and set the current block
         $currentDay = 1;
     }
     $curyear = strval($Day->thisYear());
     $curmonth = strval($Day->thisMonth());
     $curday = strval($Day->thisDay());
Esempio n. 2
0
// Get a connection to the database.
if (!($connection = @mysql_connect($hostName, $username, $password))) {
    die("Could not connect to database");
}
// Now that we are connected, select the correct database.
if (!mysql_select_db($databaseName, $connection)) {
    showerror();
}
$userID = getUserID($connection);
//See if we have an authenticated user, if so, setup the appropriate message.
if (isset($_SESSION["loggedinUserName"])) {
    $date = new Date();
    // Populate the navigation area.
    $template->setCurrentBlock("NAVIGATION");
    $template->setVariable("DATE", $date->format("%A %b %e, %Y"));
    setSelectOption($reportRequested, $template);
    $template->parseCurrentBlock();
    // Generate the requested report
    switch ($reportRequested) {
        case "VolbyYr":
            loadAnnualVolbyType($userID, $date, $template);
            $template->setCurrentBlock("REPORTAREA");
            $template->setVariable("FILENAME", "annualvolgraph.jpg");
            $template->setVariable("ALTNAME", "Volume by Year");
            $template->parseCurrentBlock();
            break;
        case "DistbyYr":
            loadAnnualDistbyYear($userID, $date, $template);
            $template->setCurrentBlock("REPORTAREA");
            $template->setVariable("FILENAME", "annualdistgraph.jpg");
            $template->setVariable("ALTNAME", "Distance by Year");