Location: PHPKode > scripts > Prioritexter > Action.php
Announcement.php0000644007706000770600000000100610526173576014300 0ustar  wheeler8wheeler8<?php
class Announcement extends HtmlFragment {

  var $str, $id;

  function Announcement($str, $id) {
    $this->str = $str;
    $this->id = $id;
  }

  function toStr() {
    $s .= "<table class=message cellspacing=0 cellpadding=2 "
       . "width=". PAGE_WIDTH .">"
       . "<td class=message align=center width=". PAGE_WIDTH .">"
       . "<span id=blinker_" . $this->id . ">"
       . $this->str ."</span>"
       . "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>"
       . "</tr></table>";
    return $s;
  }

}
?>Announcements.php0000644007706000770600000000167610526173576014500 0ustar  wheeler8wheeler8<?php
class Announcements {

  var $announcement_array, $count;

  function Announcements() {
    $this->announcement_array = Array();
    $this->count = 0;
  }

  function addAnnouncement($str) {
    if (strlen($str) > 0) {
      $this->announcement_array[] = new Announcement($str, $count);
      $this->count++;
    }
  }

  function toStr() {
    $str ="";
    // as long as there are some actual announcements to show,
    if ($this->count>0) {
      // make a long string of ...
      foreach($this->announcement_array as $this_announcement) {
	// ... each announcement formatted for html!
	$str .= $this_announcement->toStr();
	$str .= Text::smallBreak(2);
      }

      
      // place that html in the page with proper surroundings!
      $str = new TextBox("",$str
	 . "<script language=JavaScript>blink(". $this->count
			 . ",". BLINK_TIMES .");</script>");
    }
    return ($str);
  }

  function display() {
    echo $this->toStr();
  }

}
?>Assert.php0000644007706000770600000000027210526173576013113 0ustar  wheeler8wheeler8<?php
class Assert {

  function assert($var, $explanation="No further information is available.") {
    if (!$var) {
      Error::showErr("Assert failed. $explanation");
    }
  }

}
?>BodyStart.php0000644007706000770600000000051410526173576013564 0ustar  wheeler8wheeler8<?php
class BodyStart extends HtmlFragment {

  function BodyStart() {
    $s = "</head>";
    $s .= "<body>";
    $s .= "\n\n<!-- // BEGIN PAGE CONTENT -->\n\n";
    $s .= "<table align=<?= PAGE_ALIGN ?> cellspacing=4 cellpadding=0 ";
    $s .= "border=0 width=<?= PAGE_WIDTH ?>>";
    $s .= "<tr><td>";
    $s .= "<?

    }


}
?>Categories.php0000644007706000770600000000056310526173576013742 0ustar  wheeler8wheeler8<?php
class Categories {

  var $categories;
 
  function Categories() {
    global $db;
    $cats = array();

    $result = $db->simpleSelect("category");
    while($myrow = mysql_fetch_array($result)) {
      if (array_search($myrow["category_name"],$cats)===FALSE)
	$cats[$myrow["category_id"]] = $myrow["category_name"];
    }
    $this->categories = $cats;
  }

}
?>Configurer.php0000644007706000770600000000070510526173576013756 0ustar  wheeler8wheeler8<?php
class Configurer {

  function Configurer() {
    $config_array = file(CONFIG_FILE) 
      OR Error::error("could not find config file.");

    $i=0;
    while (isset($config_array[$i]) {
      $line = $config_array[$i];
      if(ereg("define\(\".+\",\"(.*)\"\);.*//.*#a#\"?(.*)\"?#a#.*#b#\"?(.*)\"?#b#.*{#c#\"?(.*)\"?#c#.*}?"), $line, $regs) {
	echo "<p>value is $regs[0]; a is $regs[1]; a is $regs[1]; c is $regs[1].";
      }
    }

  }

}
>=?>Constants.php0000644007706000770600000000377510526173576013641 0ustar  wheeler8wheeler8<?php
class Constants {

  function loadConstants() {

// DB constants
define("DB_PROJECT_NAME","prioritizer");

    
    // frequently-changing constnats
    define(DEBUG, 0);

    define(NULL,FALSE);

    define(CONFIG_FILE,"config.php");

    // installation-specific constants

    // for admin login session variable management:
    // minutes since last page load before logged out; default 20
    define(ADMIN_LOGIN_MINUTES, 60); 
    // minutes since last page load before warned; default 16
    define(ADMIN_LOGIN_WARN_MINUTES, 50);
    // max minutes until logged out; default 30
    define(ADMIN_LOGIN_MAX_MINUTES, 80);
    // extra time so that page can load before 
    define(ADMIN_LOGIN_GRACE_MINUTES, .01);

    // no reason to change these
    define("ERR_TITLE","Error");    
    define("MAX_INT",1000000000);
    define("MIN_INT",-1000000000);
    define("MAX_UPLOAD_FILE_BYTES",10000000);
    define("MAX_UPLOAD_FILE_MB",MIN_UPLOAD_FILE_BYTES / 1000000);

    // Formatting
    define("MENU_WIDTH",160);
    // NOTE: is this one used anymore?
    define("CONTENT_WIDTH",PAGE_WIDTH-MENU_WIDTH);
    define("DEFAULT_ITEM_WIDTH",CONTENT_WIDTH);
    define("PAGE_TITLE_STYLE","page_title");
    define("TEXTBOX_TITLE_DEFAULT_STYLE","item_title");
    define("TEXTBOX_CONTENT_DEFAULT_STYLE","item_content");
    define("ITEM_BOX_STYLE","item_box");
    define("MENU_BOX_STYLE","menu_box");
    define("PAGE_TITLE_BOX_STYLE","page_title_box");
    define("ITEM_INTERNAL_TABLE_PADDING",2);
    // NOte: unused
    define("SPACING_BETWEEN_MENU_AND_ITEMS",5);

    define("HOME_PAGE_FILENAME","homepage");
    define("PAGE_CGI_VAR_NAME","page");
    define("OLD_PAGE_CGI_VAR_NAME","oldpage");

    define("NEWLINE_PREFIX",1);
    define("NEWLINE_POSTFIX",2);


  }
  
  // NOTE not used in basic platform
  function loadConstantsFromDb() {
    global $db;

    $result = $db->simpleSelect("constants");
    
    while($myrow = mysql_fetch_array($result))
      define($myrow["constant_name"], $myrow["constant_value"]);      
  }
}
?>Css.php0000644007706000770600000000425310526173576012405 0ustar  wheeler8wheeler8<?php
class Css extends HtmlFragment {

  // currently class is completely unused

  function Css() {
    $s = "<style>";
    $s .= "<!--\n\n";
    $s .= ".master_title,.common_title,.common_body,.page_title,td {";
    $s .= " font-family:  Arial, Trebuchet MS, verdana, arial;";
    $s .= "}";
    $s .= ".master_title, .page_title, .common_title, .small_header {";
    $s .= " font-weight: bold;";
    $s .= "}";
    $s .= "td,.common_title,.common_body {";
    $s .= " font-size: 11px;";
    $s .= " color: 444499;";
    $s .= "}";
    $s .= ".tiny_text {";
    $s .= " font-size: 9px;";
    $s .= "}";
    $s .= ".master_title, a.page_title {";
    $s .= " font-size: 16px;";
    $s .= "}";
    $s .= ".page_title {";
    $s .= " font-size: 14px;";
    $s .= "}";
    $s .= ".page_title, .small_header {";
    $s .= " color: 994444;";
    $s .= "}";
    $s .= "a {";
    $s .= " color: 449944;";
    $s .= " text-decoration: none;";
    $s .= "}";
    $s .= "a.hover, a.master_title:hover {";
    $s .= " border-bottom: 1px dotted 4444aa;";
    $s .= "}";
    $s .= "td.box_title {";
    $s .= "  /*/*/";
    $s .= "  filter: progid:DXImageTransform.Microsoft.Gradient(gradi";
    $s .= "entType=0,startColorStr=#ffeeeeff,endColorStr=#ffddddee);";
    $s .= "  /* hide the above from netscape 4.x */";
    $s .= "  background-color: #eeeeff;";
    $s .= "}";
    $s .= "td.box_body {";
    $s .= "  /*/*/";
    $s .= "  filter: progid:DXImageTransform.Microsoft.Gradient(gradi";
    $s .= "entType=0,startColorStr=#fff8f8ff,endColorStr=#fff0f0ff);";
    $s .= "  /* hide the above from netscape 4.x */";
    $s .= "  background-color: #f6f6ff;";
    $s .= "}";
    $s .= "td.message {";
    $s .= " background: #dd2222;";
    $s .= " color: ffffff;";
    $s .= " font-weight: bold;";
    $s .= " font-size: 11px;";
    $s .= " font-family: Verdana, Arial, Sans-serif;";
    $s .= " border: black solid 1px;";
    $s .= "  /*/*/";
    $s .= " filter: progid:DXImageTransform.Microsoft.Gradient(gradi";
    $s .= "entType=0,startColorStr=#ffee6655,endColorStr=#ffaa4444);";
    $s .= "  /* hide the above from netscape 4.x */";
    $s .= " }";
    $s .= "-->";
    $s .= "</style>";

    $this->html = $s;
  }
  
}
?>Date.php0000644007706000770600000000700210526173576012525 0ustar  wheeler8wheeler8<?php
class Date {

  // how far in the future is end from start? or... is it in the past!?
  function diffToEnglish($start, $end) {
    //    return ($end-$start);
    $days_diff = round(Date::toDays($end-$start));
    
    switch ($days_diff) {
    case 0:
      $diff_phrase = "today";
    break;
    case 1:
      $diff_phrase = "tomorrow";
    break;
    case -1:
      $diff_phrase = "yesterday";
    break;
    }

    if (($days_diff>=2) && ($days_diff<=6))
      $diff_phrase = date("l", $end);

    if (($days_diff>=7) && ($days_diff<=11))
      $diff_phrase = "next ". date("l", $end);

    if (($days_diff>=-11) && ($days_diff<=-2))
      $diff_phrase = -1*$days_diff ." days ago";

    if ((abs($days_diff)>=12) && (abs($days_diff)<=16))
      $diff_phrase = "2 weeks";

    if ((abs($days_diff)>=17) && (abs($days_diff)<=19))
      $diff_phrase = "2 &#189 weeks";

    if ((abs($days_diff)>=20) && (abs($days_diff)<=25))
      $diff_phrase = "3 weeks";

    if ((abs($days_diff)>=26) && (abs($days_diff)<=34))
      $diff_phrase = "1 month";
    
    if ((abs($days_diff)>=35) && (abs($days_diff)<=38))
      $diff_phrase = "5 weeks";

    if ((abs($days_diff)>=39) && (abs($days_diff)<=48))
      $diff_phrase = "6 weeks";

    if ((abs($days_diff)>=49) && (abs($days_diff)<=335))
      $diff_phrase = round(abs($days_diff)/30.44) ." months";

    if ((abs($days_diff)>=336) && (abs($days_diff)<456))
      $diff_phrase = "1 year";

    if ((abs($days_diff)>=457) && (abs($days_diff)<=639))
      $diff_phrase = "18 months";

    if (abs($days_diff)>=640)
      $diff_phrase = round(abs($days_diff)/365.25) ." years";

    if ($days_diff<=-12)
      $diff_phrase .= " ago";

    return $diff_phrase;
  }

  function toDays($time) {
    return ($time/86400);
  }
    
  function testEnglish() {
    for ($i=0; $i<20; $i++) {
      $offset = 86400 * rand(-50,50);
      $offset += 86400 * rand(-50,50);
      $end = time() + $offset;
      $diff_str = Date::diffToEnglish(time(), $end);
      echo "<p>end date: ". date("l F jS, Y",$end);
      echo "<br>phrase: <font color=\"". Date::diffToColor(time(), $end) ."\">$diff_str</font>";
    }    
  }

  function diffToColor($start, $end) {
    $days_diff = round(Date::toDays($end-$start));
      
    if ($days_diff>7) return "#777777";
    elseif ($days_diff>0) return "#5555bb";
    elseif ($days_diff==0) return "#00bb00";
    else return "#ee4444";
  }

  // remember, date needs to be interpreted as 3 or 4pm in the 
  // afternoon.
  function interpretDate($str) {
    $date = strtotime($str);
    $date += 3600*16;
    return $date;
  }

  function logicalTime($raw_time=0) {
    if ($raw_time==0) $raw_time = time();
    // first add the adjustment to bring time() from GMT to local;
    $hours_adjusted_time = $raw_time  +HOURS_ADJUSTMENT*3600;
    // pretend midnight to 4am is part of the previous day:
    // subtract 4 hours to get time within current gmt "day".
    $time_adjusted_for_extended_day = $hours_adjusted_time
       -3600*4;
    // get how far into today we are
    $time_into_today = bcmod($time_adjusted_for_extended_day, 86400);
    // get start of today (theoretically 12:01 am this prev morning)
    $start_of_today = $time_adjusted_for_extended_day-$time_into_today;
    // set logical current time to middle of adjusted day
    $logical_time = $start_of_today + 12*3600 + 4*3600 
       - HOURS_ADJUSTMENT*3600;
    Debug::debug("time $raw_time was adjusted to "
		 . $time_adjusted_for_extended_day
		 . " and interpreted as $logical_time logically.");
    return $logical_time;
  }


}
?>Db.php0000644007706000770600000001122310526173576012175 0ustar  wheeler8wheeler8<?php

// brought into line with phpplatform on 12/28/04
class Db {

  var $host, $db, $user, $pass, $link, $db_prefix;

  function Db() {
    // set this constant value
    $this->db_prefix = DB_PROJECT_NICKNAME . "_". DB_PROJECT_NAME ."_";
    $this->host = "localhost";
    $this->db = DB_DBNAME;
    $this->user = DB_USER;
    $this->pass = DB_PASS;
    $this->link = mysql_connect($this->host, $this->user, $this->pass);
    mysql_select_db($this->db) 
      or Error::dbErr("Could not select database.");
    register_shutdown_function(array( &$this, "close" ));
  }    

  function close() {
    mysql_close($this->link);
  }

  function testTable($table_name) {
    $query_str = "SELECT * FROM " . $this->db_prefix . $table_name;
    if(mysql_query( $query_str, $this->link )===FALSE) {
      return false;
    } else {
      return true;
    }
  }

  function query( $query_str ) {
    Debug::debug("<p>$query_str\r");
    $return = mysql_query( $query_str, $this->link ) OR 
       Error::dbErr( $query_str );
    return $return;
  }

  function insert($table_name, $column_values=array()) {
    Assert::assert(is_array($column_values),"not an array");
    $column_values = Text::cleanArray($column_values);
    $query_str = "INSERT INTO " . $this->db_prefix . $table_name ." (";
    foreach($column_values as $col=>$val)
      $query_str .=  $col .", ";
    $query_str = Text::removeLastChars($query_str,2);
    $query_str .= ") VALUES (";
    foreach($column_values as $val)
      $query_str .= "'". $val ."', ";
    $query_str = Text::removeLastChars($query_str,2);
    $query_str .= ")";    
    return $this->query( $query_str );
  }

  function update($table_name, $column_values=array(), $where_str) {
    Assert::assert(is_array($column_values),"not an array");
    $column_values = Text::cleanArray($column_values);
    $query_str = "UPDATE " . $this->db_prefix . $table_name ." SET ";
    foreach($column_values as $col=>$val)
      $query_str .= "$col = '". $val ."', ";
    $query_str = Text::removeLastChars($query_str,2);
    if ($where_str)
      $query_str .= " WHERE " . $where_str;
    return $this->query( $query_str );
  }

  function delete($table_name, $where_str) {
    if (strlen($where_str)<3) Error::error("Incorrect where string in delete");
    $query_str = "DELETE FROM " . $this->db_prefix . $table_name;
    $query_str .= " WHERE " . $where_str;
    return $this->query( $query_str );
  }

  function joinQuery($type_1, $type_2, $join_field, 
		     $where_str="", $order_str="") {
    $query_str = "SELECT * FROM " . $this->db_prefix . $type_1
       . "," . $this->db_prefix . $type_2 . " WHERE "
       . $this->db_prefix . $type_1 . "." . $join_field . "="
       . $this->db_prefix . $type_2 . "." . $join_field;
    if ($where_str)
      $query_str .= " AND " . $where_str;
    if ($order_str) 
      $query_str .= " ORDER BY " . $order_str;
    return $this->query( $query_str );
  }
  
  function simpleSelect($table_type, $where_str="", $order_str="") {
    $query_str = "SELECT * FROM " . $this->db_prefix . $table_type;
    if ($where_str)
      $query_str .= " WHERE " . $where_str;
    if ($order_str) 
      $query_str .= " ORDER BY " . $order_str;
    return $this->query( $query_str );
  }

  function getOneRecord($table_type, $where_str="", $order_str="") {
    $result = $this->simpleSelect($table_type, $where_str, $order_str);
    $myrow = mysql_fetch_array($result);
    if (sizeof($myrow) == 0) return false;
    else return $myrow;
  }

  // thanks to chrisshaffer at bellsouth dot net, copyright 2002
  function getEnumValues($table_name,$field_name) {
    $result = mysql_query("DESCRIBE ".$this->db_prefix . $table_name);
    
    // go through all the fields, which are returned by row:
    while($row = mysql_fetch_array($result)) {      
      // row is mysql type, in format "int(11) unsigned zerofill"
      // or "enum('cheese','salmon')" etc.

      // BUT... is it the RIGHT field? is it the one we were told to find?
      if ($row['Field']==$field_name) {
	ereg('^([^ (]+)(\((.+)\))?([ ](.+))?$',$row['Type'],$fieldTypeSplit);
	// split type up into array
	$fieldType = $fieldTypeSplit[1];// eg 'int' for integer.
	$fieldLen = $fieldTypeSplit[3]; // eg 'cheese','salmon' for enum.      

	if (($fieldType=='enum' || $fieldType=='set'))	{
	  $fieldOptions = split("','",substr($fieldLen,1,-1));
	  return $fieldOptions;
	}
      }
    }
    //if the funciton makes it this far, then it either
    //did not find an enum/set field type, or it
    //failed to find the the fieldname, so exit FALSE!
    return FALSE;
  }

  function lastInsertAutoIncId() {
    Debug::debug("last id inserted was ".  mysql_insert_id($this->link));
    return mysql_insert_id($this->link);
  }
}
?>Debug.php0000644007706000770600000000013510526173576012676 0ustar  wheeler8wheeler8<?php
class Debug {
  
  function debug($str) {
    if (DEBUG) echo "<br>" . $str;
  }


}
?>Encrypt.php0000644007706000770600000000313410526173576013276 0ustar  wheeler8wheeler8<?php
class Encrypt {

  function xcrypt($encrypt, $source) {
    // encrypt or decrypt a string $source
    // If $encrypt is 1, then we're encrypting; otherwise we're decrypting
    $universe = "tudLEBxcn1ehi2Ny8Q0sJKpHz7aAjvCfkb5P4I36oFG- 9qDgVwlmrT_RSMUO";
    $cryptkey = "23 21 04 07 49 22 48 30 60";
    
    // double universe length so that when encrypting from the left half or decrypting from the
	// right, we never have to wrap around
    $universe .= $universe;
    $result = "";
    $foundloc = 0;
    
    // encrypt goes to the right, decrypt goes to the left
    
    // encrypt
    if ($encrypt == 1) {
      for ($i = 0; $i < strlen($source); $i++) {
	$foundloc = strpos ( $universe, substr ( $source, $i , 1)) + intval(substr($cryptkey, ($i % 9) * 3, 2));
	if ($foundloc == FALSE) {
	  echo "Error: your user name or password contains characters other than letters, numbers, spaces, dashes, and underscores. Please use the Back button on your browser to back up and enter different values.";
	  return(FALSE);
	}
	$result .= substr($universe, $foundloc, 1) ;
      }
      // decrypt
    } else {
      for ($i = 0; $i < strlen($source); $i++) {
	$foundloc = strpos ( $universe, substr ( $source, $i , 1), 61) - intval(substr($cryptkey, ($i % 9) * 3, 2));
	if ($foundloc == FALSE) {
	  echo "Error: your user name or password contains characters other than letters, numbers, spaces, dashes, and underscores. Please use the Back button on your browser to back up and enter different values.";
	  return(FALSE);
	}
	$result .= substr($universe, $foundloc, 1);
      }
    }
    
    return ($result);
  }
}
?>Error.php0000644007706000770600000000214010526173576012737 0ustar  wheeler8wheeler8<?php

// set_error_handler("handleErr"); 

class Error {

  function dbErr($err_str) {
    Error::showErr("Database Error:<br>$err_str <br>" . mysql_error());
  }

  function handleErr($errno, $errstr, $errfile, $errline) {
    $s = $errstr;
    $s .= "<br>Error Number: $errno";
    $s .= "<br>File containing error: $errfile";
    $s .= "<br>Line containing error: $errline";
    Error::showErr($s);
  }

  // displays errors, whether PHP errors or errors thrown in
  // my code to notify of undersirable behaviour
  function showErr($err_str) {
    // trace functions out of error
    $cur_functions = debug_backtrace();
    $content = "I'm sorry, there was an error in the code for this page.";
    if ($err_str != "") 
      $content .= "<p>Text of error:<p>$err_str";
    $content .= "<p>Current functions: ";
    foreach ($cur_functions as $this_function) {
      $content .= "<br>";
      $content .= $this_function["function"];
    }
    
    $title="Error";
    $content=$content;
    $width=DEFAULT_ITEM_WIDTH;
    $errBox = new TextBox($title, $content, $width);
    $errBox->display();

    die;
  }


}
?>Header.php0000644007706000770600000000110410526173576013035 0ustar  wheeler8wheeler8<?php
class Header extends HtmlFragment {

  function Header() {
    $s = '<!DOCTYPE HTML PUBLIC ';
    $s .= '"-//W3C//DTD HTML 4.0 Transitional//EN">';
    $s .= '<html>';
    $s .= '<head>';
    $s .= '<META HTTP-EQUIV="cache-control" CONTENT="no-cache">';
    $s .= '<META HTTP-EQUIV="pragma" CONTENT="no-cache">';
    $s .= '<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 ';
    $s .= '08:21:57 GMT">';
    $s .= "<title>". PAGE_TITLE ."</title>";
    $s .= '<link rel="stylesheet" href="style.css" type="text/css">';
    $s .= '</head>';
    $this->html = $s;
  }
}
?>Html.php0000644007706000770600000001155210526173576012561 0ustar  wheeler8wheeler8<?php
class Html {
  
  // safe_html by Chris Snyder (hide@address.com) for http://pcoms.net
  //   - Huge thanks to James Wetterau for testing and feedback!
  
  /*
Copyright 2003 Chris Snyder. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

   1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 
following disclaimer.
   2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 
following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
  */
  
  /* 
set of functions for sanitizing user input:
    keeps "friendly" tags but strips javascript events and style attributes
    closes any open comment tags
    closes any open HTML tags - results may not be valid HTML, but
        at least they will keep the rest of the page from breaking

treats the following as malicious conditions and returns text stripped
of all html tags:
    any instances of ='javascript: 
    event or style attributes remaining after initial replacement
  */
  
  function strip_attributes ($html, $attrs) {
    if (!is_array($attrs)) {
      $array= array( "$attrs" );
      unset($attrs);
      $attrs= $array;
    }
    
    foreach ($attrs AS $attribute) {
      // once for ", once for ', s makes the dot match linebreaks, too.
      $search[]= "/".$attribute.'\s*=\s*".+"/Uis';
      $search[]= "/".$attribute."\s*=\s*'.+'/Uis";
      // and once more for unquoted attributes
      $search[]= "/".$attribute."\s*=\s*\S+/i";
    }
    $html= preg_replace($search, "", $html);
    
    // check for additional matches and strip all tags if found
    foreach ($search AS $pattern) {
      if (preg_match($pattern, $html)) {
	$html= strip_tags($html);
	break;
      }
    }
    
    return $html;
  }
  
  function safe_html ($html, $allowedtags="") {
    $version= "safe_html.php/0.4";
    
    // anything with ="javascript: is right out -- strip all tags and return if found
    $pattern= "/=\s*\S+script:\S+/Ui";
    if (preg_match($pattern, $html)) {
      $html= strip_tags($html);
      return $html;
    }
    
    // setup -- $allowedtags is an array of $tag=>$closeit pairs, where $tag is an HTML tag to allow and $closeit is 1 if the tag requires a matching, closing tag
    if ($allowedtags=="") {
      $allowedtags= array ( "p"=>1, "br"=>0, "a"=>1, "img"=>0, "li"=>1, "ol"=>1, "ul"=>1, "b"=>1, "i"=>1, "em"=>1, "strong"=>1, "del"=>1, "ins"=>1, "u"=>1, "blockquote"=>1, "pre"=>1, "hr"=>0);
    }
    elseif (!is_array($allowedtags)) {
      $array= array( "$allowedtags" );
      unset($allowedtags);
      $allowedtags= $array;
    }
    
    // there's some debate about this.. is strip_tags() better than rolling your own regex?
    // note: a bug in PHP 4.3.1 caused improper handling of ! in tag attributes when using strip_tags()
    $stripallowed= "";
    foreach ($allowedtags AS $tag=>$closeit) {
      $stripallowed.= "<$tag>";
    }
    
    //print "Stripallowed: $stripallowed -- ".print_r($allowedtags,1);
    $html= strip_tags($html, $stripallowed);
    
    // also, lets get rid of some pesky attributes that may be set on the remaining tags...
    $badattrs= array("on\w+", "style");
    $html= Html::strip_attributes($html, $badattrs);
    
    // close html tags if necessary -- note that this WON'T be graceful formatting-wise, it just has to fix any maliciousness
    foreach ($allowedtags AS $tag=>$closeit) {
      if (!$closeit) continue;
      $patternopen= "/<$tag\b[^>]*>/Ui";
      $patternclose= "/<\/$tag\b[^>]*>/Ui";
      $totalopen= preg_match_all ( $patternopen, $html, $matches );
      $totalclose= preg_match_all ( $patternclose, $html, $matches2 );
      if ($totalopen>$totalclose) {
	$html.= str_repeat("</$tag>", ($totalopen - $totalclose));
      }
    }
    
    // close any open <!--'s and identify version just in case
    // ACTUALLY--don't. I don't want to insert anything unnescessary.
    // ONLY if there was an open tag somewhere.
    $pattern= "/<!--/";
    if (preg_match($pattern, $html)) 
      $html.= "<!-- -->";
    
    return $html;
  }
  
}HtmlFragment.php0000644007706000770600000000022310526173576014236 0ustar  wheeler8wheeler8<?php
class HtmlFragment {

  var $html;

  function toStr() {
    return $this->html;
  }
  
  function display() {
    echo $this->html;
  }
}
?>Http.php0000644007706000770600000001444010526173576012573 0ustar  wheeler8wheeler8<?php
class Http {

  function baseUrl() {
    return $_SERVER['SCRIPT_NAME'];
  }

  function fullUrl() {
    return "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['SCRIPT_NAME'];
  }

  function noCacheStr($delimiter="&") {
    return $delimiter . "noCache=" . rand();
  }

  function noCacheUrl() {
    return Http::baseUrl() . Http::noCacheStr("?");
  }

  function formUrl($params=array()) {
    return Http::urlWithParams($params);
  }

  function urlWithParams($params=array()) {
    // this line is a bit controversial... if no default page asked for,
    // just go back to THIS same page.
    Http::ensureBaseParams($params);
    $url = Http::baseUrl() . "?";
    $i=0;
    foreach($params as $key => $value) {
      if ($i>0) $url .= "&";
      $url .= $key ."=$value";
      $i++;
    }
    $url .= "&noCache=" . rand();
    return $url;
  }

  function linkWithParams($link_text="", $params=array(), $class="", 
			  $img_func="", $alt="") {
    $link = "";
    if ($class) $link .= "<font class=\"$class\">";
    $link .= "<a class=\"$class\" href=\""
       . Http::urlWithParams($params)
       . "\">"
       . $link_text;
    if (($img_func) && (is_callable(array("Image",$img_func)))) 
      $link .= call_user_func(Array("Image",$img_func),$alt,2);
    $link .= "</a>";
    if (strlen($class)>0) $link .= "</font>";

    return $link;
  }

  function imageLink($image_func="", $params=array(), $alt="") {
    return Http::linkWithParams("", $params, "", $image_func, $alt);
  }

  function linkInternal($link_text="", $page=HOME_PAGE_FILENAME,
			$class="") {
    $params[PAGE_CGI_VAR_NAME]=$page;
    return Http::linkWithParams($link_text, $params, $class);
  }

  function ensureBaseParams(&$params) {
    // make sure page is in there somewhere!
    if (!isset($params[PAGE_CGI_VAR_NAME])) {
      $page = Http::getCgiVar(PAGE_CGI_VAR_NAME);
      if ($page === FALSE)
	$params[PAGE_CGI_VAR_NAME] = HOME_PAGE_FILENAME;
      else
	$params[PAGE_CGI_VAR_NAME] = $page;	
    }
    // same with old page!
    if (!isset($params[OLD_PAGE_CGI_VAR_NAME])) {
      $oldpage = Http::getCgiVar(PAGE_CGI_VAR_NAME);
      if ($oldpage === FALSE)
	$params[OLD_PAGE_CGI_VAR_NAME] = HOME_PAGE_FILENAME;
      else
	$params[OLD_PAGE_CGI_VAR_NAME] = $oldpage;	
    }
  }

  function openForm($params=array(), $name="default", 
		    $onSubmit="", $is_file=false) {
    Http::ensureBaseParams($params);
    $s = "<form name=form_$name id=form_$name action=\"" 
       . Http::noCacheUrl()
       . "\" method=POST";
    if ($is_file)
      $s .= " enctype=\"multipart/form-data\"";
    if ($onSubmit)
      $s .= " onSubmit=\"". $onSubmit ."\"";
    $s .= ">";
    foreach($params as $key => $value) {
      $s .= "<input type=hidden name=\"". $key ."\" value=\""
	 . $value ."\">";
    }
    return $s;
  }

  function form($params=array(), $name="default",
		$onSubmit="", $is_file=false) {
    $s = Http::openForm($params, $name, $onSubmit, $is_file)
       . "</form>";
    return $s;
  }
  
  function submitFormHtml($name="") {
    return ("document.form_". $name .".submit();");
  }

  function submitFormLink($link_text, $name, $class="bold_text",
			  $img_func="goArrow") {
    $link = "";
    if (strlen($class)>0) $link .= "<font class=\"$class\">";
    $link .= "<a href=\""
       . "javascript: ". Http::submitFormHtml($name)
       . "\">"
       . $link_text
       . call_user_func(Array("Image",$img_func),2)
       . "</a>";
    if (strlen($class)>0) $link .= "</font>";

    return $link;
  }

  function selfContainedSubmit($text="", $params=array()) {
    $s = Http::openForm($params)
       . "<input type=submit class=item_content value=\"$text\">"
       . "</form>";
    return $s;
  }

  function send() {
    global $name, $from, $subject, $message, $mail_dest;
    
    $mail_content = "[This message was received from an online user of ";
    $mail_content .= $_SERVER['SERVER_NAME'] . baseUrl();
    $mail_content .= " ]\n\nFrom:\n $name\n $from\nSubject:\n $subject\n\n";
    $mail_content .= "Message:\n $message";
    
    if (mail($mail_dest, "Email from " . $_SERVER['SERVER_NAME'], $mail_content)) {
      bannerMessage("Your message has been sent.");
    } else {
      bannerMessage("Sorry, your message could not be sent.<br>Please try again.");
    }
  }

  function baseScriptRedirect($GET_params="") {
    $new_loc = "Location: http://" . $_SERVER['SERVER_NAME'] . 
	   $_SERVER['SCRIPT_NAME'];
    if ($GET_params) $new_loc .= "?$GET_params";
    header($new_loc);
  }

  function iHateMagic() {
    if (get_magic_quotes_gpc())
      $_POST = Text::restore($_POST);
  }

  function getCgiVar($var_name="") {
    $val = Http::getPostVar($var_name);
    if ($val === FALSE)
      $val = Http::getGetVar($var_name);
    return $val;
  }

  function getPostVar($post_var_name="") {
    if(sizeof($_POST)>0) {
      foreach($_POST as $key => $this_POST_VAR) {
	if ($key == $post_var_name) {
	  // this restore line had to be put in because it seems that
	  // when POST communicates a value from a previous page to the new
	  // page, it adds escape characters itself... I appreciate it, but
	  // it's annoying because often the string appears with those
	  // escapes showing!!! chimina simina!
	return Text::restore($this_POST_VAR);
	}
      }
    }
    return FALSE;
  }

  function getGetVar($get_var_name="") {
    Debug::debug("looking for get var called $get_var_name...");
    // NOTE: these functs need to be rewritten with array_find or 
    // whatever that's called!
    if(sizeof($_GET)>0) {
      foreach($_GET as $key => $this_GET_VAR) {
	if ($key == $get_var_name) {
	  // needed for same reason given in getPostVar
	  Debug::debug("found $this_GET_VAR");
	  return Text::restore($this_GET_VAR);
	}
      }
    }
    Debug::debug("didn't find $get_var_name...");
    return FALSE;
  }

  // gets all attributes passed called FIELD_anything=value
  // and returns array of them, minus that FIELD_ part.
  function getPostAttributes() {
    $attributes = Array();
    foreach($_POST as $FIELD_key => $val) {
      Debug::debug("post : $FIELD_key is $val");
      if (substr($FIELD_key,0,10) == "FIELD_") {
	$attribute_title = substr($FIELD_key,10);
	$attributes[$attribute_title] = $val;
	Debug::debug("$FIELD_key is valid");
      }
    }
    return $attributes;
  }

  function submitButton($text) {
    $s = "<input type=submit value=\"$text\">";
    return $s;
  }

}Image.php0000644007706000770600000000312210526173576012671 0ustar  wheeler8wheeler8<?php
class Image {

  function image($file_name, $alt="", $hspace=0, $vspace=0,
		 $width="", $height="") {
    $s = "<img src=\"images/". $file_name ."\" border=0 "
       . "hspace=$hspace vspace=$vspace alt=\"$alt\" "
       . "title=\"$alt\"";
    if ($width)
      $s .= " width=$width";
    if ($height)
      $s .= " height=$height";
    $s .=">";
    return $s;
  }

  function sub_arr() {
    return Image::image("sub_arrow.gif","","",10,12);
  }

  function icon($type, $alt="", $hspace=2, $vspace=0) {
    return Image::image($type .".gif", $alt, $hspace, $vspace, 12, 12);
  }

  function diamond($alt="", $hspace=0, $vspace=0) {
    return Image::image("smallaquadiamond.gif", $alt, $hspace, $vspace,7,8);
  }

  function editSymbol($alt="", $hspace=0, $vspace=0) {
    return Image::image("editbutton.gif",$alt, $hspace,$vspace,46,12);
  }

  function goArrow($alt="", $hspace=0, $vspace=0) {
    return Image::image("gradientarrowgo.gif",$alt, $hspace,$vspace,25,13);
  }

  function spacer($width=1,$height=1) {
    return Image::image("spacer.gif","",0,0,$width,$height);
  }

  function checkIcon($alt="", $hspace=2, $vspace=0) {
    return Image::image("checkmark.gif", $alt, $hspace, $vspace, 11, 10);
  }

  function alarmIcon($alt="", $hspace=2, $vspace=0) {
    return Image::image("alarm.gif", $alt, $hspace, $vspace, 10, 10);
  }

  function deleteIcon($alt="", $hspace=2, $vspace=0) {
    return Image::image("delete.gif", $alt, $hspace, $vspace, 10, 13);
  }

  function editIcon($alt="", $hspace=2, $vspace=0) {
    return Image::image("edit.gif", $alt, $hspace, $vspace, 12, 15);
  }
}
?>Indenter.php0000644007706000770600000000255110526173576013424 0ustar  wheeler8wheeler8<?php
class Indenter {

  var $count, $step_size;

  // can be activated in php5... but for now unused
  function Indenter() {
    $this->count = 0;    
  }

  // static workaround!
  function indent($str="", $action=NULL) {
    static $count=0;

    // do action if --; this should affect all INCLUDING THIS ONE
    if ($action=="--") $count--;

    // were we passed a string? if so, indent it and echo it.
    if ($str) {
      $spaces = "";
      for ($i=0; $i<$count; $i++) 
	$spaces .= " ";
      return ($spaces . $str);
    }

    // do action if ++; this should affect all LATER
    if ($action=="++") $count++;
  }

  // can be activated in php5... but for now unused
  function setStepSize($step_size) {
    $this->step_size = round($step_size);
  }

  // can be activated in php5... but for now unused
  function increase($step_size = 1) {
    $this->count += $step_size;
  }

  // can be activated in php5... but for now unused
  function decrease($step_size = 1) {
    $this->count -= $step_size;
  }

  // can be activated in php5... but for now unused
  function indentTEMP($str, $flag=NEWLINE_PREFIX) {
    $spaces = "";
    for ($i=0; $i<$this->count; $i++) 
      $spaces .= " ";

    switch ($flag) {
    case NEWLINE_PREFIX:
      $str = "\n".$str;
    break;
    case NEWLINE_POSTFIX:
      $str = $str ."\n";
    break;
    }

    return $spaces . $str;
  }
}
?>Javascript.php0000644007706000770600000002400110526173576013754 0ustar  wheeler8wheeler8<?php
class Javascript {

  function initialize() {
    Javascript::browserDetect();
    Javascript::showFunctions();
  }

  function encapsulate($script) {
    return "<script>$script</script>";
  }

  function browserDetect() {
  ?>
    <script language="JavaScript">
    
         dom = document.getElementById;
         ie  = document.all;
         ie4 = ie && !dom;
         ie5 = dom && ie;
         ns4 = document.layers;
         ns6 = dom && !ie; 
    
         if (ie5 || ns6)
           new_browser = true;
         else
           new_browser = false;
    
    
         // works; os holds the os.
         var detect = navigator.userAgent.toLowerCase();
         if (detect.indexOf('mac')+1) os = "mac";
         if (detect.indexOf('win')+1) os = "win";
         if ((detect.indexOf('linux')+1) || 
    	 (detect.indexOf('linux')+1)) os = "unix";
    </script>
    
    <?
      }
    
      function showFunctions() {
      ?>
    <script language="JavaScript">
    
    function menuHilite(index, mode) {
    
      if (document.getElementById("menu_selector_" + index)) {
        document.getElementById("menu_selector_" + index).className=("menu_selector_"+mode);
        for(var i=0; i<<?= sizeof($menu_items) ?>; i++) {
          if (index != i) {
            document.getElementById('menu_selector_' + i).className='menu_selector_off';
          }
        }
      }
    
      if (document.getElementById("menu_border_" + index)) {
        document.getElementById("menu_border_" + index).className=("menu_border_"+mode);
        for(var i=0; i<<?= sizeof($menu_borders) ?>; i++) {
          if (index != i) {
            document.getElementById('menu_border_' + i).className='menu_border_off';
          }
        }
      }
    }
    
    function toggleExpand(index) {
        var el = document.getElementById('submenu_' + index);
    
        if((el.style.display != "block") && (new_browser)){ 
          el.style.display = "block";
        }else{
          el.style.display = "none";
        }
        // get rid of that annoying boundary created when you click moust over
        // a link... whose idea was that!?
        var menu_el = document.getElementById('menu_item_' + index);
        menu_el.blur();
    }
    
    function getById(theId) {
      if (document.all)
        return ("document.all." + theId);
      else if (document.getElementById)  
        return ("document.getElementById('" + theId + "')");
    }
    
    function blink(numBlinkers, numBlinksEach) {
      var html="";
    
        for (i=0; i<numBlinkers; i++) {
        var blinkId = "blinker_" + i;
        // get ready to switch the visibility... note: at first visibility == ""
        if (!eval(getById(blinkId) + ".style.visibility == 'hidden'")) {
          html = getById(blinkId) + ".style.visibility = 'hidden';";
        }
        else {
          html = getById(blinkId) + ".style.visibility = 'visible';";
        }
        
        // make it visible or invisible!
        eval(html);
        }
    
      // keep calling blink() hile decrememting counter of number of times to blink
      // Stop at 0 blinks left; then make sure it's visible!
      if (numBlinksEach>0) 
        window.setTimeout( "blink("+ numBlinkers + "," + (numBlinksEach-1) +")", 500 );
      else 
        eval(getById(blinkId) + ".style.visibility = 'visible';");
    }
    
     function refuseVal(str_1, str_2) {
      if (str_1 == str_2) {
        alert("Sorry, you must enter a new value before you can continue.");
        return false;
      } else
        return true;
     }
     
     function erase(obj) {
       obj.value = "";
     } 
    
    </script>
    
    <?
  }

  function stringForBrowser($new_ver, $old_ver) {
    // (probably unnescessary line)
    $new_ver = Text::cleanStr($new_ver);
    $old_ver = Text::cleanStr($old_ver);
    $s_out = "<script language=\"Javascript\">"
       . "if (new_browser) {"
       . " document.write('". $new_ver ."');"
       . "} else {"
       . " document.write('". $old_ver ."');"
       . "}"
       . "</script>";
    return $s_out;
  }

  // display the javascript function "textToHtml" (happens, for convenience,
  // to have same name as this PHP function), which accepts a form text
  // element (textarea), and replaces its text using a series of reg exp's.
  // basically, it's all about quietly getting pasted in text, with
  // visual (but not html) line breaks, to show up as desired
  // in html. hard part is not fucking up perfectly fine html and such
  // that already exists... (see \\r\\n{2,}<p> and \\r\\n{2,}<br>
  // replacements, which detect many lines leading up to a <p>
  // or whatever and protect it from being interpreted as desired
  // whitespace)
  // also, note that a newline is \r and then \n . pain in the ass...
  // i need to double-escape those values (like \\r ) because the
  // javascript is INSIDE php string, so php lets \\ be treated like \
  // and javascript sees plain old \r as two characters.
  function textToHtml() {
    $s = "function textToHtml(element) {"
       .  "var re = new RegExp('\\r\\n ', 'gi');"
       .  "element.value = element.value.replace(re, '\\n\\n<p>');"
       .  "var re = new RegExp('\\r\\n{2,}<p>', 'gi');"
       .  "element.value = element.value.replace(re, '\\n<p>');"
       .  "var re = new RegExp('\\r\\n{2,}<br>', 'gi');"
       .  "element.value = element.value.replace(re, '\\n<br>');"
       .  "var re = new RegExp('\\r\\n\\r\\n\\r\\n', 'gi');"
       .  "element.value = element.value.replace(re, '\\n<p>&nbsp;<br>');"
       .  "var re = new RegExp('\\r\\n\\r\\n', 'gi');"
       .  "element.value = element.value.replace(re, '\\n\\n<p>');"
       . "}";

    return $s;
  }

   function disableMoveButtons() {
    $s = "function disableMoveButtons(selected_value,"
       .      "first_value, last_value, button_elements) {"
       . "if (first_value==selected_value)"
       .   "button_elements[0].disabled=true;"
       . "else button_elements[0].disabled=false;"
       . "if (last_value==selected_value)"
       .   "button_elements[1].disabled=true;"
       . "else button_elements[1].disabled=false;"
       . "}";

    return $s;
  }

   function redirect($href) {
     $s = "location.href=\"$href\";";
     return $s;
   }

   function wysiwygFunctions() {
     $s ="  var viewMode = 1; // WYSIWYG"
	. ""
	. "  function Init()"
	. "  {"
	. "    iView.document.designMode = 'On';"
	. "  }"
	. "  "
	. "  function selOn(ctrl)"
	. "  {"
	. "	ctrl.style.borderColor = '#000000';"
	. "	ctrl.style.backgroundColor = '#B5BED6';"
	. "	ctrl.style.cursor = 'hand';	"
	. "  }"
	. "  "
	. "  function selOff(ctrl)"
	. "  {"
	. "	ctrl.style.borderColor = '#D6D3CE';  "
	. "	ctrl.style.backgroundColor = '#D6D3CE';"
	. "  }"
	. "  "
	. "  function selDown(ctrl)"
	. "  {"
	. "	ctrl.style.backgroundColor = '#8492B5';"
	. "  }"
	. "  "
	. "  function selUp(ctrl)"
	. "  {"
	. "    ctrl.style.backgroundColor = '#B5BED6';"
	. "  }"
	. "    "
	. "  function doBold()"
	. "  {"
	. "	iView.document.execCommand('bold', false, null);"
	. "  }"
	. ""
	. "  function doItalic()"
	. "  {"
	. "	iView.document.execCommand('italic', false, null);"
	. "  }"
	. ""
	. "  function doUnderline()"
	. "  {"
	. "	iView.document.execCommand('underline', false, null);"
	. "  }"
	. "  "
	. "  function doLeft()"
	. "  {"
	. "    iView.document.execCommand('justifyleft', false, null);"
	. "  }"
	. ""
	. "  function doCenter()"
	. "  {"
	. "    iView.document.execCommand('justifycenter', false, null);"
	. "  }"
	. ""
	. "  function doRight()"
	. "  {"
	. "    iView.document.execCommand('justifyright', false, null);"
	. "  }"
	. ""
	. "  function doOrdList()"
	. "  {"
	. "    iView.document.execCommand('insertorderedlist', false, null);"
	. "  }"
	. ""
	. "  function doBulList()"
	. "  {"
	. "    iView.document.execCommand('insertunorderedlist', false, null);"
	. "  }"
	. "  "
	. "  function doForeCol()"
	. "  {"
	. "    var fCol = prompt('Enter foreground color', '');"
	. "    "
	. "    if(fCol != null)"
	. "      iView.document.execCommand('forecolor', false, fCol);"
	. "  }"
	. ""
	. "  function doBackCol()"
	. "  {"
	. "    var bCol = prompt('Enter background color', '');"
	. "    "
	. "    if(bCol != null)"
	. "      iView.document.execCommand('backcolor', false, bCol);"
	. "  }"
	. ""
	. "  function doLink()"
	. "  {"
	. "    iView.document.execCommand('createlink');"
	. "  }"
	. "  "
	. "  function doImage()"
	. "  {"
	. "    var imgSrc = prompt('Enter image location', '');"
	. "    "
	. "    if(imgSrc != null)    "
	. "     iView.document.execCommand('insertimage', false, imgSrc);"
	. "  }"
	. "  "
	. "  function doRule()"
	. "  {"
	. "  iView.document.execCommand('inserthorizontalrule', false, null);"
	. "  }"
	. "  "
	. "  function doFont(fName)"
	. "  {"
	. "    if(fName != '')"
	. "      iView.document.execCommand('fontname', false, fName);"
	. "  }"
	. "  "
	. "  function doSize(fSize)"
	. "  {"
	. "    if(fSize != '')"
	. "      iView.document.execCommand('fontsize', false, fSize);"
	. "  }"
	. "  "
	. "  function doHead(hType)"
	. "  {"
	. "    if(hType != '')"
	. "    {"
	. "      iView.document.execCommand('formatblock', false, hType);  "
	. "      doFont(selFont.options[selFont.selectedIndex].value);"
	. "    }"
	. "  }"
	. "  "
	. "  function doToggleView()"
	. "  {  "
	. "    if(viewMode == 1)"
	. "    {"
	. "      iHTML = iView.document.body.innerHTML;"
	. "      iView.document.body.innerText = iHTML;"
	. "      "
	. "      // Hide all controls"
	. "      tblCtrls.style.display = 'none';"
	. "      selFont.style.display = 'none';"
	. "      selSize.style.display = 'none';"
	. "      selHeading.style.display = 'none';"
	. "      iView.focus();"
	. "      "
	. "      viewMode = 2; // Code"
	. "    }"
	. "    else"
	. "    {"
	. "      iText = iView.document.body.innerText;"
	. "      iView.document.body.innerHTML = iText;"
	. "      "
	. "      // Show all controls"
	. "      tblCtrls.style.display = 'block';"
	. "      selFont.style.display = 'inline';"
	. "      selSize.style.display = 'inline';"
	. "      selHeading.style.display = 'inline';"
	. "      iView.focus();"
	. "      "
	. "      viewMode = 1; // WYSIWYG"
	. "    }"
	. "  }";


   }

}Menu.php0000644007706000770600000000156710526173576012566 0ustar  wheeler8wheeler8<?php
class Menu extends HtmlFragment {

  function Menu() {
    $s = $this->sectionTitle("Views:");
    $s .= $this->menuItem("All tasks","");
    $s .= $this->menuItem("Tasks by category","bycategory");
    $s .= $this->menuItem("Completed tasks","finished");
    $s .= $this->menuItem("Enter new task","newtask");
    $this->html = $s;
  }

  function sectionTitle($title) {
    $s = "<p><font class=\"menu_section\">";
    $s .= $title;
    $s .= "</font>";
    $s .= Text::smallBreak(2);
    return $s;
  }

  function menuItem($name,$page) {
    $s = "<font class=\"menu_item\">"
       . "&nbsp;&nbsp;"
       . Http::linkInternal($name,$page)
       . "</font>"
       . Text::smallBreak(2);
    return $s;
  }

  // NOTE: currently unused
  function adminLink() {
    $params["admin_stage"]="start";
    $s = Http::linkWithParams("Admin login", $params);
    return $s;
  }
}
?>MimeFile.php0000644007706000770600000000113110526173576013334 0ustar  wheeler8wheeler8<?
class MimeFile {

  var $record;

  function MimeFile($file_id) {
    global $db;

    if (!isset($file_id) || $file_id <0) {
      Error::showErr("Could not output image: invalid file id");
    } else {
      $this->record = $db->getOneRecord("item","item_id=$file_id") 
	 or Error::showErr("Can't find file to output");  
    }
  } // end of constructor

  function display() {
    // Output the MIME header 
        header("Content-Type: {$this->record["item_mime"]}"); 

	//echo "MUGI";

    // Output the file or image 
        echo Text::restoreStr($this->record["item_content"]); 

  }

}
?>P_CreateTable.php0000644007706000770600000000513010526173576014302 0ustar  wheeler8wheeler8<?php
class P_CreateTable {

  function createTables() {
    global $db;

    Debug::debug("creating tables");

    $q[] = "CREATE TABLE ". DB_PROJECT_NICKNAME ."_prioritizer_task ("
       . "task_id mediumint(9) NOT NULL auto_increment,"
       . "name varchar(255) NOT NULL default 'Unnamed task',"
       . "notes tinytext,"
       . "priority tinyint(4) NOT NULL default '5',"
       . "created bigint(20) default NULL,"
       . "due bigint(20) default NULL,"
       . "adjustment int(11) NOT NULL default '0',"
       . "type enum('task','project','dream') NOT NULL default 'task',"
       . "active tinyint(1) NOT NULL default '1',"
       . "finished bigint(20) default NULL,"
       . "PRIMARY KEY(task_id)"
       . ") TYPE=MyISAM";
       
    $q[] = "CREATE TABLE ". DB_PROJECT_NICKNAME ."_prioritizer_task_category ("
       . " task_category_id int(11) NOT NULL auto_increment,"
       . " task_id int(11) default NULL,"
       . " category_id int(11) default NULL,"
       . " PRIMARY KEY(task_category_id),"
       . " KEY task_id (task_id,category_id)"
       . " ) TYPE=MyISAM";

    $q[] = "CREATE TABLE ". DB_PROJECT_NICKNAME ."_prioritizer_category ("
       . "category_id int(11) NOT NULL auto_increment,"
       . "category_name tinytext,"
       . "PRIMARY KEY(category_id)"
       . ") TYPE=MyISAM";

    $q[] = "INSERT INTO ". DB_PROJECT_NICKNAME
       . "_prioritizer_category VALUES (1, 'Misc')";
    $q[] = "INSERT INTO ". DB_PROJECT_NICKNAME
       . "_prioritizer_category VALUES (2, 'Office')";
    $q[] = "INSERT INTO ". DB_PROJECT_NICKNAME
       . "_prioritizer_category VALUES (3, 'Home')";
    $q[] = "INSERT INTO ". DB_PROJECT_NICKNAME
       . "_prioritizer_category VALUES (4, 'Call')";
    $q[] = "INSERT INTO ". DB_PROJECT_NICKNAME
       . "_prioritizer_category VALUES (5, 'Errand')";
    $q[] = "INSERT INTO ". DB_PROJECT_NICKNAME
       . "_prioritizer_category VALUES (6, 'Social')";
    $q[] = "INSERT INTO ". DB_PROJECT_NICKNAME
       . "_prioritizer_task VALUES (1, 'Welcome to "
       . "Prioritizer Beta! Please delete this message after reading it. "
       . "The icons at the right of each item will tell you what they "
       . "represent if you move the mouse pointer onto them.', '', 1, "
       . "1106064000, 1421424000, 0, 'task', 1, NULL)";
    $q[] = "INSERT INTO ". DB_PROJECT_NICKNAME
       . "_prioritizer_task_category VALUES (1, 1, 1)";

    foreach($q as $query_str) 
      $result = $db->query($query_str);
  }

  function createIfDontExist() {
    global $db;

    Debug::debug("testing tables");
    if (!$db->testTable("task")) P_CreateTable::createTables();
  }

}
?>Page.php0000644007706000770600000000744610526173576012540 0ustar  wheeler8wheeler8<?php
class Page {

  var $page_file, $header, $menu, $bodyStart, $title, $anouncements;
  
  function Page() {
    $this->header = new Header();
    $this->announcements = new Announcements();
    $this->menu = new Menu();
    $this->page_file = new PageFile();
  }

  function startPage() {
    $this->header->display();
    Javascript::initialize(); 
    $this->showBodyStart();
  }

  function standardContent() {
    $this->showTitle();
    $this->announcements->display();
    $this->openMainTable();
    $this->menu();
  }

  function showBodyStart() {
    echo "\n\n<!-- begin body -->\n\n<body bgcolor=\"#f6f6ff\" ";
    //    echo 'background="'. BACKGROUND_IMAGE;
    echo "marginheight=0 marginwidth=0 topmargin=0 leftmargin=0>\n";

    // ************ open master table *************
    // initial space
    echo "\n\n";
    echo Indenter::indent('<table align='. PAGE_ALIGNMENT);
    echo ' cellspacing=4 cellpadding=0 ';
    echo "border=0 width=". PAGE_WIDTH . ">\n";
  }

  function showTitle() {
    // ************ cell for title bar(s)/graphic *************
    echo Indenter::indent("<tr>\n","++");
    echo Indenter::indent("<td>\n","++");
    // ************ Banner graphic (optional) *************
    if (SHOW_BANNER) {
      $banner_content = "<a href=\"index.php\"><img src=\""
	 . BANNER_IMAGE ."\" hspace=0 border=0></a>";
      $banner_box = new TextBox("", $banner_content, PAGE_WIDTH);
      $banner_box->padding = 0;
      $banner_box->show_bottom_padding = false;
      $banner_box->content_align="center";
      $banner_box->display();
      echo Text::smallBreak(1);
    }
    // ************ Page Title Bar(optional) *************
    if (SHOW_PAGE_TITLE) {
      $title_str = Http::linkInternal(PAGE_TITLE, HOME_PAGE_FILENAME,
				      PAGE_TITLE_STYLE);
      $title_bar_box =
	 new TextBox($title_str, PAGE_SUBTITLE, PAGE_WIDTH);
      // NOTE: why is this line commented out?
      $title_bar_box->content_style="emphasized";
      $title_bar_box->box_style=PAGE_TITLE_BOX_STYLE;
      $title_bar_box->display();
    }
    // ************ close title cell
    echo Indenter::indent("</td>\n","--"); 
    echo Indenter::indent("</tr>\n\n","--");
    // ************ open cell for whole rest of page
        echo Indenter::indent("<tr>\n","++");
    echo Indenter::indent("<td>\n","++");
  }

  function openMainTable() {
    echo "\n";
    echo Indenter::indent("<table width=". PAGE_WIDTH ." ","++");
    echo "border=0 cellspacing=0 cellpadding=";
    echo ITEM_INTERNAL_TABLE_PADDING .">\n";
    echo Indenter::indent("<tr>\n","++");
    echo Indenter::indent("<td valign=top>\n","++");
    // at this point it's ready for the menu
  }

  function menu() {
    $menu_box = new TextBox("",$this->menu->toStr(),MENU_WIDTH);
    $menu_box->box(MENU_BOX_STYLE);
    $menu_box->display();
  }

  function endPage() {
    
    // close table holding menu and content
    echo Indenter::indent("</td>\n","--");
    echo Indenter::indent("</tr>\n","--");
    echo Indenter::indent("</table>\n","--");
    // close big cell holding everything but title bars
    echo Indenter::indent("</td>\n","--");
    echo Indenter::indent("</tr>\n","--");
    // close table of entire page
    echo Indenter::indent("</table>\n","--");

    echo "</body>\n";
    echo "</html>\n";
  }

    /*
  function divideMenuFromContent() {
    echo Indenter::indent("</td>\n\n","--");
    //    echo Indenter::indent("<td><img src=\"". SPACER_SRC ."\" height=1 ","++");
    //echo "width=". SPACING_BETWEEN_MENU_AND_ITEMS ."></td>";
    echo Indenter::indent("<td valign=top","++");
    echo " align=left>";
  }
    */

  function addAnnouncement($str) {
    $this->announcements->addAnnouncement($str);
  }

  function showAnnouncements() {
    echo $this->announcements->toStr();
  }

  function includePage() {
    include($this->page_file->page_loc);
  }

}
?>PageFile.php0000644007706000770600000000145510526173576013332 0ustar  wheeler8wheeler8<?php
class PageFile {

  var $page_loc;

  function PageFile($page = NULL) {
    // if called without a page name to get, 
    if ($page == NULL) 
      // look in the cgi vars for a name to use.
      $page = Http::getCgiVar(PAGE_CGI_VAR_NAME);

    Debug::debug("Including page: $page <br>");

    // at this point we have the page... or there was no cgi var telling
    // us which page.
    $page_loc = PageFile::getLocalLoc($page);

    // if page cgi var can't be found, OR the page requested doesn't
    // exist, use the Home Page instead!
    if (($page == FAILURE_CODE) || !file_exists($page_loc))
      // use the homepage.
      $page_loc = PageFile::getLocalLoc(HOME_PAGE_FILENAME);

    $this->page_loc = $page_loc;
  }

  function getLocalLoc($page) {
    return "pages/". $page .".php";
  }

}
?>README0000755007706000770600000000606410530445507012020 0ustar  wheeler8wheeler8
Prioritexter 0.1
by Ben Wheeler, 2006
released under Open Software License,
http://www.opensource.org/licenses/osl-3.0.php

=============================================================

Prioritexter is a web-based todo list app.

The basic concept of Prioritexter is that todo items are
given priorities, and reorder themselves according to a combination
of due date, priority, and a random element. Thus a large list of 
items can be handled, with assurance that no items will be permanently
stuck at the bottom of the queue.

=============================================================

thanks for trying this! please email hide@address.com with comments.

this is ALPHA  so bear with any bugs
and please let me know about them!

I wouldn't be letting you know about this program if i didn't think
it can save you time, as it has my friends already.

requirements:

 php 4+
 mysql 3+
 any *nix flavor

it's pretty self-explanatory.. all you have to do is

 UNZIP the thing. (erm, you already did this)
 EDIT config.php and SET YOUR DB's name, username and password.
 view index.php with a browser. this will set up the tables and the
  rest is gravy.

i've taken reasonable precautions to protect your security (pword, etc)
but it's pretty crude; please note that my security is at least as good
as movable type's, and many others, which also leave your pword lying 
around in a world-readable php file! hopefully apache can handle it
without incorrectly letting someone view the source (this has been known
to happen in the past with OTHER programs on other servers, so beware...
of this and of most web/db apps which don't require server reconfig!)

=======================================================

Justification for project on SourceForge:

Prioritexter is a web-based todo list app. The basic concept of
Prioritexter is that todo items are given priorities, and reorder
themselves according to a combination of due date, priority, and a
random element. Thus a large list of
items can be handled, with assurance that no items will be permanently
stuck at the bottom of the queue.

The todo list field is crowded, but Prioritexter fills an unmet
need. Unlike existing todo-list applications, it 1) is web-based, and
therefore portable and permanently synced; 2) allows custom weighting
of different aspects of a task--priority, due date, and a random
element--so that the user's desired blend of these items can be used
to customize the workflow; 3) allows quick creation, editing and
deleting of items; and 4) allows categorization of items. 

Item #2 is the most unusual aspect of Prioritexter, because it means
that the interface is essentially date-agnostic; instead of items
being wedded to their corresponding due date, items of various due
dates are listed together. This reflects the reality that tasks often
must be done in a general timeframe, rather than on a specific date.

To date, no todo list application exists that serves this
function. For workers whose workflow involves many dozens of items
jockeying for attention at one time, it provides a novel approach to
task management.
Security.php0000644007706000770600000001312510526173576013462 0ustar  wheeler8wheeler8<?php
class Security {


function requireLogin($pass_in) {
  global $this_page;

  $pass_real = Encrypt::xcrypt(0,PASSWORD_HASH);  

  $this_page->echoAtEnd("here we go");
  $this_page->echoAtEnd("cookie is: " . $_COOKIE["admin_logged_in"]);

  // if logged in cookie is NOT set...
  //  if (Encrypt::xcrypt(0,$_COOKIE[Encrypt::xcrypt(1,'admin_logged_in')]) != "true") {
  if ($_COOKIE["admin_logged_in"] != "true") {
    $this_page->echoAtEnd("no session");
    //     $this_page->echoAtEnd(Encrypt::xcrypt(1, $pass_in));

    // then check if they have just submitted a working password...
    if ($pass_in==$pass_real) {

      $this_page->echoAtEnd("setting session");

      // if the password works, set session
      //          setcookie (Encrypt::xcrypt(1,'admin_logged_in'), Encrypt::xcrypt(1,"true"), time()+VERY_BIG_NUMBER);
      setcookie ("admin_logged_in", "true", time()+VERY_BIG_NUMBER);
      setcookie (Encrypt::xcrypt(1,"login_time"), Encrypt::xcrypt(1,time()), time()+VERY_BIG_NUMBER);

      return true;

    } else {
      // there was no cookie set before, and password was not valid...

      //redirect the bastards now!
      //      echo "<script language='javascript'>";

      // if they weren't trying to login, just show them the form with no comments
      if ($pass_in=="") {
	header("Location: " . Http::fullUrl() . "?action=showLogin&page=" . SEC_SUB_ID);
	echo "Location: " . Http::fullUrl() . "?action=showLogin&page=" . SEC_SUB_ID;
      }
      //	echo 'location.href="'. Http::baseUrl() .'?action=showLogin";';
      else // otherwise, give 'em shit for it!
	//	echo 'location.href="'. Http::baseUrl() .'?action=badPass";';
	header("Location: " . Http::baseUrl() . "?action=badPass&page=" . SEC_SUB_ID);

      echo '</script>';
    }
  // now if the logged in cooke WAS set,
  // let 'em in, but first check that session isn't too old (or fraudulent)
  } else {
   $this_page->echoAtEnd("yes session");

   // how long has it been since they logged in?
   // diff is measured in seconds.
   $diff = time() - 
      Encrypt::xcrypt(0,$_COOKIE[Encrypt::xcrypt(1,'login_time')]);

   $this_page->echoAtEnd("time: " . time());
   $this_page->echoAtEnd("login time cookie: " 
      . Encrypt::xcrypt(0,$_COOKIE[Encrypt::xcrypt(1,'login_time')]));
   $this_page->echoAtEnd("diff: " . $diff);

   // if it's been too long,
   if (($diff > (ADMIN_LOGIN_MAX_MINUTES * 60)) || ($diff < 0)) {

     // johnny come-latelies! get out!
     Security::killCookies();
     $this_page->echoAtEnd("you are being evicted.");

     // if you're late, and you're REALLY late, like 2 hours later late,
     // you won't expect to be recognized anyway... so just show login 
     // screen.
     //  this happens whenever someone was logged in yesterday, and
     // click edit mode today... you've got the cookie, but it's ancient.
     //  if cookie was from recently, but you're too late, explain what
     // happened.
     $s = "Sorry, your login has expired.<br>"
	. "Your work has been saved. Please log in again.";
     if ($diff > ADMIN_LOGIN_MAX_MINUTES * 120) {
       global $action;
       $action = "showLogin";
     } else 
       $this_page->addBanner($s);

     //redirect the bastards now!

   } else
     return true;
  }
  // done with checking up on them.

  return false;
}

 
function showLogin() {
  global $this_page;

  $login_form="";

  $login_form .= "<p align=right>";
  $login_form .= "<table border=0 cellspacing=0 cellpadding=0>";
  $login_form .= "<tr>";

  $login_form .= "<form id=login name=login ";
  $login_form .= "action=\"" . Http::baseUrl() . "?mode=edit&";
  $login_form .= "page=" . SEC_SUB_ID . "\" method=POST>";
  $login_form .= "<input type=hidden name=mode value=edit>";
  $login_form .= "<input type=hidden name=show_content value=0>";
  $login_form .= "<input type=hidden name=stage value=start>";
  $login_form .= "<td colspan=1 class=plain align=left valign=bottom>";
  $login_form .= "Please enter your password:&nbsp;</td>";
  $login_form .= "<td colspan=3 class=plain><input class=plain type=password size=10 ";
  $login_form .= "id=POST_password name=POST_password>";
  $login_form .= "</td>";
  $login_form .= "<td align=right class=plain>&nbsp;";
  $login_form .= Output::submitButton("log in &rarr;");
  $login_form .= "</td></form>";

  $login_form .= "</tr></table>";

  $this_page->login_form = $login_form;
}


 function setWarnings() {

   $s="";
   // this stuff sets timers to log them out if they stay on the same page
   // for too long.
   $s .= 'function warn_session() {';
   $s .=  'alert("Warning!\n\nYour login session will expire soon\n';
   $s .=  'unless you load a new page soon.\n\nIf you are entering ';
   $s .=  'information,\nplease save what you have\nand finish promptly. ';
   $s .=  'You\ncan always go back and edit\nor add more later.");';
   $s .= '}';
   $s .= 'function end_session() {';
   $s .=  'location.href="' . Http::baseUrl() . '?action=forceLogout&page=';
   $s .=   SEC_SUB_ID . '";';
   $s .= '}';
   $s .= 'window.setTimeout( "warn_session()", ';
   $s .=  (ADMIN_LOGIN_WARN_MINUTES * 60000) . ');';
   $s .= 'window.setTimeout( "end_session()", ';
   $s .=  (ADMIN_LOGIN_MINUTES * 60000) . ');';
   return $s;
 }

 function killCookies() {
    setcookie ("admin_logged_in", "", time()-VERY_BIG_NUMBER);
    setcookie (Encrypt::xcrypt(1,"login_time"), "", time()-VERY_BIG_NUMBER);
 }

 function referrerIsInternal() {
   $referer = getenv("HTTP_REFERER");
   //   echo "ref: ". $referer ."<br>";
   //echo "sub: ". substr($referer,0,strlen(SITE_BASE_ADDR)) ."<br>";
   if (substr($referer,0,strlen(SITE_BASE_ADDR)) == SITE_BASE_ADDR) 
     return true;
   else
     return false;
 }


} 
?>Sort.php0000644007706000770600000000111310526173576012574 0ustar  wheeler8wheeler8<?php
class Sort {

  function keyWithMaxMinValue($arr,$direction="max") {
    if ($direction=="max") {
	  $maxMinValue = MIN_INT;
    } else {
	  $maxMinValue = MAX_INT;
    }

    foreach($arr as $key => $value) {
      if ($direction=="max") {
	if($value > $maxMinValue) {
	  $maxMinValue = $value;
	  $maxMinKey = $key;
	}
      } else {
	if($value < $maxMinValue) {
	  $maxMinValue = $value;
	  $maxMinKey = $key;
	}
      }
    }
    return ($maxMinKey);
  }

  function maxMinValue($arr,$direction="max") {
    return ($arr[Sort::keyWithMaxMinValue($arr,$direction)]);
  }



}
?>Task.php0000644007706000770600000000714710526173576012564 0ustar  wheeler8wheeler8<?php
class Task {

  var $task_id, $urgency, $name, 
    $notes, $priority, $created, $due, $adjustment,
    $type, $categories, $active, $finished;

  function Task ($task_id, $urgency="", $name="", $priority="",
		 $created="", $due="", $adjustment="", $notes="",
		 $type="", $active="", $finished="", $categories=array()) {
    global $db, $task_categories;

    if (strlen($name)>0) {
      $this->task_id = $task_id;
      $this->urgency = $urgency;
      $this->name = $name;
      $this->priority = $priority;
      $this->created = $created;
      $this->due = $due;
      $this->adjustment = $adjustment;
      $this->notes = $notes;
      $this->type = $type;
      $this->active = $active;
      $this->finished = $finished;

      if(!is_array($categories)) Debug::debug("Categories NOT array in Task");
      $this->categories = $categories;
    } else { // if basically ONLY the task_id was given... we need to 
      // query the database for the info!
      $myrow = $db->getOneRecord("task", "task_id=$task_id");
      Assert::assert(sizeof($myrow),"task id was invalid for "
		     ."finding existing task");
      
     
      $this->task_id = $task_id;
      $this->name = $myrow["name"];
      $this->priority = $myrow["priority"];
      $this->created = $myrow["created"];
      $this->due = $myrow["due"];
      $this->adjustment = $myrow["adjustment"];
      $this->notes = $myrow["notes"];
      $this->type = $myrow["type"];
      $this->active = $myrow["active"];
      $this->finished = $myrow["finished"];

      $this->categories = $task_categories->task_categories[$task_id];
    }
  }

  function postponeAdjustment($created, $due, $old_adj) {
    Debug::debug("ready to postpone. created is $created ; due is $due;"
		 . " old adjustment is $old_adj ; time is ".time());

    // we need to know old adjusted period -- created date to
    // adjusted due date -- to know how much we should be increasing
    // the adjustment by!
    $old_total = $old_adj + $due - $created;
    // editing task can put its due date BEFORE its creation date,
    // resulting in NEGATIVE total start-end period! sto pthis nonsense.
    if ($old_total < 0) $old_total=0;

    // had to redo this logic because of problem scenario --
    // what if user waited until long after due date to hit postpone?
    // with old logic, adjustment would be a few days bigger-- but
    // that might still not bring new adjusted due date up to the present!
    // it doesn't make much sense to hit postpone and then have the task
    // still be overdue...

    $time_past_due = (time()-$due-$old_adj);
    if ($time_past_due>0) {
      $catch_up_time = $time_past_due+$old_adj;
      Debug::debug("adjusted time is past due");
    }
    else {
      $catch_up_time = $old_adj;
      Debug::debug("adjusted time is NOT past due.");
    }

    // so at this point catch_up_time is at LEAST big enough to bring
    // the adjustment to the current day.

    // take 5% of old total time
    $portion_of_old_total = $old_total*.1;

    // a few constant days to add, in case % of prev period is very small
    $constant_time = .5*86400; 

    // new adjustment is 150% of old one, plus a standard 10% of period
    // and a day or two constant.
    Debug::debug("new adj is $catch_up_time + "
		 . " $portion_of_old_total + $constant_time .");
    $new_adj = $catch_up_time+$old_adj*.35+
       $portion_of_old_total+$constant_time;
    Debug::debug("almost done postponing. new adj is $new_adj");
    // round new_adj to nearest whole day amount
    //    $new_adj = round($new_adj/86400)*86400;

    Debug::debug("done postponing. new adj is $new_adj");
    return $new_adj;
  }

}
?>TaskCategories.php0000644007706000770600000000175710526173576014573 0ustar  wheeler8wheeler8<?php
// dependencies:
// $db global must be declared
// db structure must be correct for tables task_category and category
class TaskCategories {

  var $task_categories;

  function TaskCategories() {
    global $db;
    $cats = array();

    $result = $db->joinQuery("task_category","category","category_id");
    while($myrow = mysql_fetch_array($result)) {
      if (!isset($task_cat[$myrow["task_id"]])) 
	$task_cat[$myrow["task_id"]] = array();
      array_push($task_cat[$myrow["task_id"]],$myrow["category_name"]);
    }
    $this->task_categories = $task_cat;
  }

  function insertTaskCategories($cats, $task_id) {
    global $db, $categories;

    foreach ($cats as $this_category) {
      $values = array();
      $values["task_id"] = $task_id;
      $values["category_id"] = array_search($this_category,
					    $categories->categories);
      Assert::assert(($values["category_id"] !== FALSE),
		     "Invalid category submitted");
      $db->insert("task_category", $values);
    }
  }
}
?>TaskForm.php0000644007706000770600000002276210526173576013410 0ustar  wheeler8wheeler8<?
class TaskForm extends HtmlFragment {

  function TaskForm($title="Enter new task", $task=NULL) {
    global $categories;

    $params[PAGE_CGI_VAR_NAME] = Http::getCgiVar(PAGE_CGI_VAR_NAME);
    $form = Indenter::indent(Http::openForm($params),"++");

    // IF we know the task id ALREADY for this task, we must prepare
    // to have it be a form for EDITING the task, not entering a new one.
    if (isset($task)) {

      // EDIT TASK:
      $form .= Indenter::indent("\n<input type=hidden name=task_id ")
	 . "value=". $task->task_id .">"
	 . Indenter::indent("\n<input type=hidden name=action ")
	 . "value=updateTask>"
	 . Indenter::indent("\n<input type=hidden name=page ")
	 . "value=". Http::getCgiVar(OLD_PAGE_CGI_VAR_NAME) .">";
    } else { // NEW TASK:
      $form .= Indenter::indent("\n<input type=hidden name=action ")
	 . "value=newTask>";
    }

    $form .= Indenter::indent("\n\n<table border=0 ","++")
       . "cellspacing=0 cellpadding=2>"
       . Indenter::indent("\n<tr>","++")
       . Indenter::indent("\n<td>name:</td>")
       . Indenter::indent("\n<td><input type=text name=name size=14");
    // IF we know the name, put it in here!
    if (isset($task))
      $form .= " value=\"". Text::htmlContentClean($task->name) ."\"";
    $form .= "></td>"
       . Indenter::indent("\n</tr>","--")
       . Indenter::indent("\n<tr>","++")
       . Indenter::indent("\n<td>priority:</td>")
       . Indenter::indent("\n<td><select name=priority>","++");
    for ($i=1; $i<=10; $i++) {
      $form .= Indenter::indent("\n<option value=$i");
      if ($i == $task->priority) $form .= " selected";
      $form .= ">$i</option>";
    }
  
    $form .= Indenter::indent("\n</select>")
       . Indenter::indent("\n</td>","--")
       . Indenter::indent("\n</tr>","--")
       . Indenter::indent("\n<tr>","++");

    // PROBLEM: how to take existing due date, and translate that
    // into setting this thing dynamically?
    // SOLUTION: forget all the following crap. if the date is already
    // set, let's use traditional date methods! this is no time to
    // be concerned with rapid entry.
    // DEPRECATED, then:
    // the following values are each about twice as big as the last.
    // so if the due date is, say, 40 days, how do we have it match up
    // with 1 month, vs. 60 days, which should be 80?
    // simply waiting until the day count is too big, then selecting the
    // previous unit, would work for 40 but not for 60.
    // but we COULD do this is we make the actual # of days bigger or
    // smaller first! since it would be nice if we could just pick the
    // first one that is bigger than the # of days, let's make it
    // smaller -- we can actually divide it by 2. eg: 8 days: 1 week
    // is first one bigger than 4. 9 months: 6 months is first one
    // bigger than 140. BUT NO-- this won't work for 300 days, 
    // or for 6 days. how about -- divide by 1.5?
    // orig #      orig/1.5        category
    // 5           3.3             1 week
    // 10          6.8             1 week
    // 20          13.3            few weeks
    // 40          26.7            1 month
    // 80          53              few months
    // 160         106             6 months
    // 320         213             1 year
    // pretty nice!
    if (isset($task)) {
      $form .= Indenter::indent("\n<td>due:</td>")
	 . Indenter::indent("\n<td><select name=due_month>","++");
      $date_at_jan_15th_of_this_year = time()-bcmod(time(),(365.25*86400))
	 + 15*86400;
      $adjusted_due = $task->due + $task->adjustment;
      for($i=0; $i<12; $i++) {
	$month_date = $date_at_jan_15th_of_this_year + $i*30.4*86400;
	$month_name = date("M", $month_date);
	$form .= Indenter::indent("\n<option value=$month_name");
	if ($month_name == date("M", $adjusted_due))
	  $form .= " selected";
	$form .= ">$month_name</option>";
      }
      $form .= Indenter::indent("\n</select>")
	 . Indenter::indent("\n<select name=due_day>");
      for($i=1; $i<=31; $i++) {
	$form .= Indenter::indent("\n<option value=$i");
	if ($i == date("j", $adjusted_due))
	  $form .= " selected";
	$form .= ">$i</option>";
      }	
      $form .= Indenter::indent("\n</select>")
	 . Indenter::indent("\n<select name=due_year>");
      for($i=0; $i<=10; $i++) {
	$year = date("Y", $date_at_jan_15th_of_this_year+$i*365.25*86400);
	$form .= Indenter::indent("\n<option value=$year");
	if ($year == date("Y", $adjusted_due))
	  $form .= " selected";
	$form .= ">". $year ."</option>";
      }	
      $form .= Indenter::indent("\n</select>")
	 . Indenter::indent("\n</td>","--");
    
    } else { // NEW MODE:
      $form .= Indenter::indent("\n<td>timeframe:</td>")
	. Indenter::indent("\n<td><select name=due>","++")
	. Indenter::indent("\n<option value=0>today</option>")
	. Indenter::indent("\n<option value=1>tomorrow</option> ")
	. Indenter::indent("\n<option value=3>a few days</option>")
	. Indenter::indent("\n<option value=7>1 week</option>")
	. Indenter::indent("\n<option value=19>a few weeks</option>")
	. Indenter::indent("\n<option value=30.44>1 month</option>")
	. Indenter::indent("\n<option value=80>a few months</option>")
	. Indenter::indent("\n<option value=182.7>6 months</option>")
	. Indenter::indent("\n<option value=365.25>1 year</option>")
	. Indenter::indent("\n<option value=900>a few years</option>")
	. Indenter::indent("\n</select>")
	. Indenter::indent("\n</td>","--");
    }

    $form .= Indenter::indent("\n</tr>","--")
       . Indenter::indent("\n<tr>","++")
       . Indenter::indent("\n<td>type:</td>")
       . Indenter::indent("\n<td><select name=type>","++")
       . Indenter::indent("\n<option value=task");
    
    if ($type == "task")
      $form .= " selected";
    $form .= ">Task</option>";
  
    $form .= Indenter::indent("\n<option value=project");
    if ($type == "project")
      $form .= " selected";
    $form .= ">Project</option>";
    
    $form .= Indenter::indent("\n<option value=dream");
    if ($type == "dream")
      $form .= " selected";
    $form .= ">Dream</option>";
    
    $form .= Indenter::indent("\n</select>")
       . Indenter::indent("\n</td>","--")
       . Indenter::indent("\n</tr>","--")
       . Indenter::indent("\n<tr>","++")
       . Indenter::indent("\n<td>category:</td>")
       . Indenter::indent("\n<td><select multiple size=4 ","++")
       . "name=\"categories[]\">";

    $first_flag = true;
    foreach($categories->categories as $category) {
      $form .= Indenter::indent("\n<option value=\"")
	 . $category ."\"";
      if (isset($task)) {
	if (array_search($category,$task->categories) !== FALSE)
	  $form .= " selected";
      } elseif ($first_flag) // if nothing else, at least
	  // select the first category.
	  $form .= " selected";	
      $form .= ">". Text::capitalizeFirstChar($category)
	 . "</option>";
      $first_flag = false;
    }

    $form .= Indenter::indent("\n</select>")
       . Indenter::indent("\n</td>","--")
       . Indenter::indent("\n</tr>","--");

    // at first i set this so it would only show the completed choice
    // if the oldpage was finished, meaning, if you are editing a completed
    // task. but that's too confusing -- user doesn't know where that
    // choice went, if editing normal task! So just keep it everywhere.
    //    $oldpage = Http::getCgiVar("oldpage");
    if (isset($task)) {
      $form .= Indenter::indent("\n<tr>","++")
	 . Indenter::indent("\n<td valign=top>completed:</td>")
	 . Indenter::indent("\n<td><select name=active>","++");

      // select the correct option according to active-ness of task
      $form .= Indenter::indent("\n<option value=1");
      if ($task->active) $form .= " selected";
      $form .= ">No</option>";
      $form .= Indenter::indent("\n<option value=0");
      if (!$task->active) $form .= " selected";
      $form .= ">Yes</option>";

      $form .= Indenter::indent("\n</select>")
	 . Indenter::indent("\n</td>","--")
	 . Indenter::indent("\n</tr>","--");
    }


    $form .= Indenter::indent("\n<tr>","++")
       . Indenter::indent("\n<td valign=top>notes:</td>")
       . Indenter::indent("\n<td><textarea name=notes rows=4 cols=11>");
    if (isset($task))
      $form .= Text::htmlContentClean($task->notes);
    $form .= "</textarea></td>"
       . Indenter::indent("\n</tr>","--")
       . Indenter::indent("\n<tr>","++")
       . Indenter::indent("\n<td></td>")
       . Indenter::indent("\n<td><input type=submit value=Submit>","++")
       . "</input></td>"
       . Indenter::indent("\n</tr>","--")
       . Indenter::indent("\n</table>","--")
       . Indenter::indent("\n</form>","--");

    $task_form = new TextBox($title,$form, 175);
    $task_form->box();
    // NOTE: once textbox is concat-versioned, replace display with
    // line making this->html - box->tostr
    $task_form->display();
  }

  function getCgiValues() {
    $values["name"] = Http::getCgiVar("name");
    $values["priority"] = Http::getCgiVar("priority");
    $values["type"] = Http::getCgiVar("type");
    $values["notes"] = Http::getCgiVar("notes");
    $active = Http::getCgiVar("active");
    if ($active !== FALSE)
      $values["active"] = $active;

    // make sure when task entered, the create time is set to whatever 
    // 4pm was on the current day, and due is added to that, not just 
    // added outright. 
    $values["created"] = Date::logicalTime(time());

    $values["due"] = Date::logicalTime($values["created"]+ 
       Http::getCgiVar("due") * 86400);

    // as for other values...
    // active defaults to 1, finished defaults to null...
    // user wouldn't want to set these to anything on creating new task,
    // so no need to set these.

    return $values;
  }
}
?>Tasks.php0000644007706000770600000001331510526173576012741 0ustar  wheeler8wheeler8<?php
class Tasks {

  var $tasks, $show_active;

  function Tasks() {
    global $db, $task_categories;

    $this->show_active=TRUE;

    // init urgency in case no values assigned
    $urgency = Array();

    // seed random number generator with the current hour
    $this->seedRand();

    // NOTE: wait, only where type is task!? what about project,
    // at least!?
    $result = $db->simpleSelect("task", "type='task'");
    while($myrow = mysql_fetch_array($result)) {
      $adjusted_due = Date::logicalTime($myrow["due"]+$myrow["adjustment"]);
      $time_left = $adjusted_due - Date::logicalTime();
      $days_left = $time_left/86400;
      $urgency[$myrow["task_id"]] = 
	 $this->urgency($myrow["priority"],$days_left);
      $task_by_id[$myrow["task_id"]] = new Task(
	$myrow["task_id"], $urgency[$myrow["task_id"]], 
	Html::safe_html($myrow["name"]),
	$myrow["priority"], 
	$myrow["created"], $myrow["due"], $myrow["adjustment"], 
	Html::safe_html($myrow["notes"]), $myrow["type"], 
	$myrow["active"], $myrow["finished"],
	$task_categories->task_categories[$myrow["task_id"]]);
    }
    arsort($urgency);
    reset($urgency);
    // make sure it's an array, even if empty
    $this->tasks = array();
    foreach ($urgency as $key=>$value) {
      $this->tasks[] = $task_by_id[$key];
    }
  }

  function toStr($types=array(),$cats=array()) {
    $str = "";
    $table_content = "";

    // about continue: remember that it means break!!!
    foreach($this->tasks as $task) {
      //echo $task->type;
      // only show ACTIVE tasks (or, if flag is set, only show 
      // INACTIVE tasks
      if ($task->active != $this->show_active) continue;
      // if the array of acceptable types isn't blank,
      //  and the types in it do NOT include THIS task's type, 
      //  then go to the next task...
      if ((sizeof($types)!=0) && 
	  (array_search($task->type,$types) === FALSE)) continue;
      // ... ditto for cats...
      if ((sizeof($cats)!=0) && 
	  (sizeof(array_intersect($task->categories,
				  $cats))==0))
	continue;

      //      echo "adding content";
      //     echo $task->type;
      
      // if we got here, the type and category check out OK...
      // so add the task row to the output string.
      $adjusted_due = $task->due + $task->adjustment;
      $table_content .= Indenter::indent("<tr><td>$task->name</td>","++")
	 . Indenter::indent("<td>$task->priority</td>")
	 . Indenter::indent("<td><font color=\"")
	 . Date::diffToColor(Date::logicalTime(),$adjusted_due)
	 . "\">"
	 . Date::diffToEnglish(Date::logicalTime(),$adjusted_due)
	 . "</font></td>";
      $params = Array();
      $params["action"]="doneTask";
      $params["task_id"]=$task->task_id;
      $table_content .= Indenter::indent("<td>")
	 . Http::imageLink("checkIcon", $params, "Mark as done")
	 . "</td>";
      $params["action"]="postponeTask";
      $table_content .= Indenter::indent("<td>")
	 . Http::imageLink("alarmIcon", $params, "Give me more time")
	 . "</td>";
      unset($params["action"]);
      $params["page"]="confirmdelete";
      $table_content .= Indenter::indent("<td>")
	 . Http::imageLink("deleteIcon", $params, "Delete task")
	 . "</td>";
      unset($params["action"]);
      $params["page"]="edittask";
      $table_content .= Indenter::indent("<td>")
	 . Http::imageLink("editIcon", $params, "Edit task")
	 . "</td>";
      $table_content .= Indenter::indent("</tr>","--");
    }
    
    if (strlen($table_content)>0) {
      $str .= Indenter::indent("<table border=0 cellspacing=0 ","++")
	 . "cellpadding=3>"
	 . Indenter::indent("<tr>","++")
	 . Indenter::indent("<td class=emphasized width=200>","++");
      $str .= "Tasks: ";
      if (sizeof($types)>0) {
	foreach ($cats as $category)
	  $str .= Text::capitalizeFirstChar($category).", "; 
	$str = substr($str,0,strlen($str)-2);
      } 
      $str .= Indenter::indent("</td>","--")
	 . Indenter::indent("<td class=emphasized>Priority</td>")
	 . Indenter::indent("<td class=emphasized>Due date</td>")
	 . Indenter::indent("<td class=emphasized></td>")
	 . Indenter::indent("<td class=emphasized></td>")
	 . Indenter::indent("<td class=emphasized></td>")
	 . Indenter::indent("<td class=emphasized></td>")
	 . Indenter::indent("</tr>","--");
      $str .= $table_content;
      $str .= Indenter::indent("</table>","--");  
    }
    else { // if there was NO content, return false.
      //      echo "here";
      return FALSE;
    }

    return $str;
  }
  
  function eachCatToStr($types=array()) {
    global $categories;
    $hr = "\n<br><hr><p>\n";

    foreach($categories->categories as $category) {
      $this_cat = $this->toStr(array("task","project"),array($category));
      if ($this_cat !== FALSE)
	$str .= $this_cat . $hr;
    }

    if (strlen($str)>0) $str=substr($str,0,strlen($str)-strlen($hr));
    return $str;
  }


  function display($types=array(),$categories=array()) {
    echo $this->toStr($types,$categories);
  }

  function displayType($type) {
    echo $this->toStr(array($type));
  }

  function urgency($priority,$days_left) {
    $days_left = floor($days_left);
    // .015 be 2???
    $priority_urgency = pow(1+PRIORITY_IMPORTANCE*.02,$priority-10)*10;
    // NOTE: this may be WRONG approach to due date importance ...
    // why do i want to make 5 days so little more potent thatn 6 months?
    $due_date_urgency = pow(1+DUE_DATE_IMPORTANCE*.04,-1*($days_left+2))
       + 2 - DUE_DATE_IMPORTANCE*.2;
    $rand = rand(1,10);
    $log = log(.505-(.05*$rand),10);
      $random_urgency = -1*$log*pow(RANDOMNESS,2)/6;
    //    echo "$rand $log $random_urgency <p>";
    $urgency = ($priority_urgency+5) * $due_date_urgency + $random_urgency;

    return (round($urgency*100)/100);
 }

  // seed rand depending on hour of day
  function seedRand() {
    srand(floor(time()/3600));
  }
  
}
?>Text.php0000644007706000770600000000764310526173576012607 0ustar  wheeler8wheeler8<?php
class Text {

  // NOTE: do to clean what I did below to restore, and rename it...
  function cleanStr($orig) {
    //    if (!get_magic_quotes_gpc())
    $slashed = addslashes($orig);

    //    Debug::debug("Text: before: $orig after: $slashed");

    return $slashed;
  }

  function cleanArray($dirtyArray) {
    if ($dirtyArray) {
      foreach($dirtyArray as $key => $value)
	$cleanArray[$key] = Text::cleanStr($value);
      return $cleanArray;
    } else 
      return Array();
  }

  // right now the only character i think needs replacing is the double-quote;
  // and it only needs replacing when added by backend php as a value="value"
  // string.
  function htmlContentClean($str) {
    $problem_chars = array("\"");
    $fixed_chars = array("&quot;");
    $str = str_replace($problem_chars,$fixed_chars,$str);
    return Html::safe_html($str);
  }

  // WHEW! I hunted this one for a while. long after i introduced
  // the policy of taking care of magic quotes et al myself as a 
  // preparation for handling post and get data, i introduced 
  // an html form with input type select multiple... this gives
  // post not a key-string pair but a key-ARRAY pair, and here
  // i was treating all the values from keys as strings! no
  // wonder it didn't work... now i handle either situation
  // appriopriately, though there is no emergency check for
  // infinite recursion (NOTE)
  function restore($slashedArrayOrStr) {
    if (is_array($slashedArrayOrStr)) {
      foreach($slashedArrayOrStr as $key => $value)
	$restoreArray[$key] = Text::restore($value); 
      return $restoreArray;  
    } else { // ok, it's a string for sure now, so let's clean it!
      $restored = stripslashes($slashedArrayOrStr);
      //Debug::debug("restoring: before: $value after: $restored");
	return $restored;
    }
  }

  function capitalizeFirstChar($str) {
    return (strtoupper(substr($str,0,1)) . substr($str,1));
  }

  function insertSemicolon($str) {
    $len = strlen($str);
    if (substr($str, $len-1, $len) != ";")
      $str .= ";";
    return $str;
  }

  function pluralize($str) {
    $len = strlen($str);
    if (substr($str, $len-1, $len) != "s")
      $str .= "s";
    return $str;
  }

  // finds ideal form field size given a pixel measurement
  function numCols($width) {
    return (floor($width / 6)-6);
  }

  function insertStringInKeys($str, $arr) {
    foreach($arr as $key => $value)
      $new_arr[$str . $key] = $value;

    return $new_arr;
  }

 function smallBreak($num_breaks) {
    $break_text = "<font style=\"font-size: 3px\"><br>";
    for ($i=0; $i<$num_breaks-1; $i++)
      $break_text .= "&nbsp;<br>";
    $break_text .= "</font>";
    $old_browser_break_text = "<br>" . $break_text;
    return Javascript::stringForBrowser($break_text,$old_browser_break_text);
  }

  function truncate($str, $length=15, $trailing='...') {
    if (strlen($str) > $length) {
      // string exceeded length, truncate and add trailing dots
      return substr($str,0,$length-3).$trailing;
    } else {
      // string was already short enough, return the string
      return $str;
    }
  }

  function removeLastChar($str) {
    return (substr($str, 0, strlen($str)-1));
  }

  function removeLastChars($str, $num_to_remove) {
    return (substr($str, 0, strlen($str)-$num_to_remove));
  }

  // receives a pixel width for the menu box, and returns the number of
  // characters to say each menu item has.
  function menuCharsWide($width) {
    return (floor($width / 5.6)-10);
  }

  function menuCharsPadding($width, $name) {
    $menu_chars_wide = Text::menuCharsWide($width);
    return ($menu_chars_wide-strlen($name))*1.4;
  }

  function aOrAnd($str) {
    $first_char = substr($str, 0, 1);
    switch($first_char) {
    case "a":
    case "A":
    case "e":
    case "E":
    case "i":
    case "I":
    case "o":
    case "O":
    case "u":
    case "U":
      return("an $str");
      break;
    default:
      return("a $str");
      break;
    }
  }

}
?>TextBox.php0000644007706000770600000000513710526173576013254 0ustar  wheeler8wheeler8<?php
class TextBox {

  var $width, $title_style, $content_style, $box_style,
    $show_title, $show_content, 
    $content, $title, $padding, $show_bottom_padding, 
    $title_align, $content_align;

  function TextBox($title, $content, $width=DEFAULT_ITEM_WIDTH) {
    $this->title=$title;
    $this->content=$content;
    $this->width=$width;
    $this->show_title = (strlen($title)>0);
    $this->show_content = (strlen($content)>0);
    $this->padding = ITEM_INTERNAL_TABLE_PADDING;
    $this->show_bottom_padding = true;
    $this->title_style=TEXTBOX_TITLE_DEFAULT_STYLE;
    $this->content_style=TEXTBOX_CONTENT_DEFAULT_STYLE;
    $this->title_align=left;
    $this->content_align=left;
  }

  function box($box_style = ITEM_BOX_STYLE) {
    $this->box_style = $box_style;
  }

  function startBox($width) {
    // NOTE: ALL these echos, and all echos in project, will need
    // to be changed to string concats, so that toStr is universal.
    // don't get stuck echo'ing!
    echo "\n\n";
    echo Indenter::indent("<table cellspacing=0 cellpadding=1 ","++");
    //    if (isset($this->border_color)) 
    //  echo "bgcolor=\"$this->border_color\" "; 
    if (isset($this->box_style)) 
      echo "class=\"$this->box_style\" "; 
    echo "align=center width=\"". $this->width ."\">\n";
    echo Indenter::indent("<tr>\n","++");
    echo Indenter::indent("<td width='100%'>\n","++");
    
    echo Indenter::indent('<table cellspacing=1 cellpadding=',"++");
    echo $this->padding .' border="0" width="100%">';
  }

  function endBox() {
    echo Indenter::indent("</table>","--");

    echo Image::spacer($this->width-2*$this->padding-2);
    echo "</td>\n";
    echo Indenter::indent("","--");
    echo Indenter::indent("</tr>\n","--");
    echo Indenter::indent("</table>\n","--");
  }

  function displayTitle() {
    if ($this->show_title) {
      echo "\n";
      echo Indenter::indent("<tr><td class=$this->title_style","++");
      echo " align=$this->title_align>";
      echo $this->title;
      echo "</td>\n";
      echo Indenter::indent("</tr>\n","--");
    }
  }

  function displayContent() {
    if ($this->show_content) {
      echo "\n";
      echo Indenter::indent("<!-- content cell -->\n");
      echo Indenter::indent("<tr><td class=$this->content_style","++");
      echo " align=$this->content_align>";
      echo $this->content;
      if ($this->show_bottom_padding)
	echo Text::smallBreak(2);
      echo "</td>\n";
      echo Indenter::indent("</tr>\n","--");
    }
  }

  function display() {
    $this->startBox($this->width);
    $this->displayTitle(); 
    $this->displayContent();
    $this->endBox();
  }

}
?>Utilities.php0000644007706000770600000000114710526173576013627 0ustar  wheeler8wheeler8<?php
class Utilities {

  function showFunctions() {
    $cur_functions = debug_backtrace();
    foreach ($cur_functions as $this_function) {
      $content .= "<br>";
      $content .= $this_function["function"];
    }
    echo $content;
  }

  function boolZeroProtect($return_str) {
    if ($return_str=="0")
      return "zero";
    elseif ($return_str=="")
      return "null";
    else
      return $return_str;
  }

  function boolZeroRelease($returned_str) {
    if ($returned_str=="zero")
      return "0";
    elseif ($returned_str=="null")
      return "";
    else
      return $returned_str;
  }

}
?>config.php0000644007706000770600000000224210526174115013104 0ustar  wheeler8wheeler8<?php

// nickname is so that you can run several different installations
// of the same app on the same database... and each will have different
// prefix to its table names!
define("DB_PROJECT_NICKNAME","demo");

// these must be set to give access to your db.
define("DB_DBNAME","PUT_YOUR_DB_NAME_HERE");
define("DB_USER","PUT_YOUR_DB_USERNAME_HERE");
define("DB_PASS","PUT_YOUR_DB_PASSWORD_HERE");
// do NOT include a last / slash!!!
define("SITE_BASE_ADDR", "PUT_YOUR_SITE_BASE_URL_HERE");

//supplanted by style.css? or is it better here?
// BACKGROUND IMAGE
//define("BACKGROUND_IMAGE","images/bg_zigzag.gif");

// PAGE TITLE
define("SHOW_PAGE_TITLE",true);
define("PAGE_TITLE","Prioritexter");
define("PAGE_SUBTITLE","Universal Manager for Tasks, Projects, Dreams");

// BANNER
define("SHOW_BANNER",false);
define("BANNER_IMAGE","images/banner_762_112.gif");

// PAGE WIDTH
define("PAGE_WIDTH",762);

// PAGE ALIGNMENT
define("PAGE_ALIGNMENT","center");

// these are 1-10 based on your preference
define("PRIORITY_IMPORTANCE",5);
define("DUE_DATE_IMPORTANCE",5);
define("RANDOMNESS",5);

// hours relative to gmt (eg, -5 is eastern standard)
define("HOURS_ADJUSTMENT",-5);


?>images/0000755007706000770600000000000010526173631012375 5ustar  wheeler8wheeler8images/checkmark.gif0000755007706000770600000000010710526173631015015 0ustar  wheeler8wheeler8GIF89a
‘-~V¿2vãQÿÿÿ!ù,
œo€+¡;ZpP>qg¦í©U!Qäà;images/bg_zigzag.gif0000755007706000770600000000031410526173631015030 0ustar  wheeler8wheeler8GIF89a<€ÿÿÿÙÙÙ,<@«„¦€ëy‚ŒRéÞjçVÛIÐEŽžXu܆>eûÁí:½Xnæ
¯xæc¡&Â0¥ë•hÌ\0ôô=‘šä!cz¤Á&µ+Ü.q\‡è´š3á“ìŠ=b¦
tœ
oÒ¾lU¿Þfåu‡Ä¢öeóF8S”0Åhw7h5ÉöÒiRi±Ã£ÃYƒ˜¢èèb´¸é4’ø÷yr֓õˆ'Ȫˈ–é¶Ç£ÕWªP;images/delete.gif0000755007706000770600000000015010526173631014325 0ustar  wheeler8wheeler8GIF89a

¢ÞÝÖîí餢ÖÔϼº¶Ù×Ógfdÿÿÿ!ù,

-xzf»-„¦¢!ÄLÛú6E(R]é0ƒFZeëuÊCšUB›æø•ñŒ¦ó(-;images/banner_762_112.gif0000755007706000770600000002774510526173631015334 0ustar  wheeler8wheeler8GIF89aúp³ûûý
%(3LOZŽ‘œÁÄÏ£§²=AKX\f~‚Œ´¸ÂÐÔÞÿÿÿ,úp@ÿ°…I«½8ëÍ»ÿ`(Ždižhª®lë¾p,ÏtmßdÓ|ïÿƒ ð÷SÂäЧŸ<%0‰¨Vجõšíz±Û°x¼e˜Ïè3 
Þð´yÍ £k²~K_ãé{aujrƒu}l…Švr~xsfnp„‡w~–Œ‚†j—…vˆ ™wš¥ƒ›‰‹^’““Gµ¶·¸
»»J¼¿¼¹GÄÄÇÇÅÊËÌÆÈÀJÏÔMT| ¨©s³§Š¯¥¡•¬­†ç™Ž‹á¢íèÛî–lk:×÷M·S÷P=Rþ”„ùB°àž‚XâÅÓî”ÃO•´y*`–·0ˆ.ªò®G…éÿ<;Óiâ9‘‰Z²ÈòÍÆ2¯Ø¹ºô§,—zZ¾éHÂ/­D:tY‚£H“& Ö¬SeJfUkJµé¬/1!BìsS@ 9ŽÖ½+ŠÑI“`©"k2Ý(³ftø›K·@(ø‚̍:i`ºwŸüô¢°'9x[	©‡*(‚ºéΒJ"´…gšŒR%âx]»rFSrm9wW½ÌÕgë‡E£J*^X'/¢¸wU˛ÆË´gUƒ/6ëVن|ã»,u–ˆhÅÒ3Wv›:R`%·ý4½z;˜à‹%	y8­^æåVŸÞšÚ$½ýI¨<;&_`Ù¬Àv%á\ÿ—QÉbðm†_8MÄC‹ußY¦‰Z	vÖN}päea\é1Ý&
u•[s“q–%¶ÌbTRÃ
Ç[v†a7?AÓ0-NBØ<(Íö`Z®¸
×1R‡ÈY^¸'†%ìe1×OR"p`MÞ-RàC£°•eíÁ_pœçãîd‚^;ED‡cñ¡aQtªñM$R"fÊè]0R˜	èh|¾ä‘ŒQË,:
H‹-_–“0/Âã2ya(eà¸cn³ü†¨£òR\-ð 'wù­ñ?蠚·âZåUb!ªb¦f$mqß±öÉö'™‡èàÿ<¥‘¥{ì@hˆc*ÙÇ,6†r$8vŠ²˜Ò'i0¡aÁãÛמкºVPtNB¹„{"ꦣ˜¯_ü9lC¨&q‘âE¤ø@ú‹6h¾qâÅg<”“ÿ˜§k•ҁ¥_ZlÁæ[qˆ¬N_ëÇ´õêвd)VHÒ¨Ø|ßeeݧcU´à!RV¸Å³¬{t	V¬¼,ÁL†'ن™G¿vIJ4iýR©>äeU_ãiZÁÊáÚ$·ý’›ô<póbª#<mEÒN¿ó 喢M$÷Z²!Ö`«ýjh‰E¬Õ"É]œèaŠ'd˜ÿœZYx w’UimR#°²Ê,]>÷+{µµzWBJë‘÷$HëTCìb´î÷׺W†-MäÞR§¼‚¼­N–'aÁ_ÚrLNÆíÁSàXíU$.’:¾@ ^stR»"¦Ã.½UÔ­ñûDUy-ƒæ‡
…ÈÊoŸ¾ü·Ž½ï‘ÿ®aPØC	z—½	„AT¤•'ø}p@¿C÷0˜Ò°%%hBUð5=Pè¡KŠÆé)]°bŸA€Ôaª*OŽÜRç1	êï õEA(%l_O`˃Ä¢P'ªaߤH(@ȃ‰Zµ+ÿ6qFt¢ÉC»)¦)2|ˀÑJG(cŒuÁ"Ç	Ú§VPA³øJª%'Z5Ò8…M¢ÏPåwBF>‰j"ÿ¸º•
QˆGÔy)ž&ÖˆCÜOù%µ;ú#…£Le)©ò	l$£à—±!΅c©„ä+Ÿ¸º÷ý‡’aÆ ‘õƀèҎ`ó!0Ï4À½1™IĜ1ïñË~ÀQŽéyhi·]¢±À–{øc&oö ŒÚ“¦9wYÍq3—ÒX^p¹N¼,±.œ„Ì->(€¹´î¨kä2ýqA|€˜JB;pJuò•ö”ä=WéP€v‘ÿœ]¤#,ÙhÂiöYØ|C<ßé6…ÕÒ¤$ŘñŽåJp´‹eó¸éƓރ¤ôd¦'=JÄ1ʯƒR³ÞK»´ŽË<_jÜ*•²ô™fKçc|ÒfÔjÉÁBÝúґže `=Õõ“‰b(ÏlÕj¡ÙBäÖz‹‘î‚­¸PJ…C&”ï¥]d¼J'1‰N3õÎà$ØÏa¦<;M:rÚÉK 5<ÌD]ªÃõJª…MIGÆ›X‰¥¯¨OǝVhs„aâ8/­ LHÐYDh3X©îÄð{®°Y/d¨¾zv?A˜“Ò](å¸s&"“¡Œa81ÿÚ!VK“6ÅdJÔ5fuVؑ$6Vö“*7ÖL讬É$C¹ÓŽ)4ƒ’å^§•3®&hfw˜-?‘õ¬¾æ	CK’	ÍNRÄډe]<PËV„T9`‹<í¶ìë=œÙ¥Ãar—{Œ;È` &NE¥dÛ0×J’[V¡[ûyÆ;ã€*…][(®Œu¯5!s̆¦V=–õ•3…p.%¥D>søg_c6ˆRÇt«¨ É DËÆFFUg‚‘±u21¶C¶Š%5j‹ˆ`­H“ 2,-.k;ÜjÈ×K±Ú ¡ªrÜãmpãÄ8;€²¹3Ê`ÿZUÖÁ2
Àšm\°s–´Âã²Ùx*š\	¦J⟈€&Þúîì:àµÏw ˆBf¡j‚Ãt}Ö¬˜Ð†Ž¾LWV„ž4—Ák|Ïl¬Ö-m(':)ØÍl2µ dm€Ä
•@,5èù†~®
o±²SˆÊЅ.é{[‹˜Ðº¯\2öV?÷ÝûvIH›²³Y%/È"¶‘Ký³}GË¥n¤ÓO{ÌbvO
ÏE3¦jæ5ÀVtÂïü²ÒQ-£¯s LŒônë~"Ž‡¬*÷÷Ic9¶¸ï†'9 ÛÌ÷D½Z'4u~ƒ©.¡Þp«jÀ”öÿKt8äX‚öîÁ]
äçô—P( Ä©pzsT䥱µÔâÝÞ&Ž!Ìj²È…ڝ¨„ÙW™Àì-š¬í€È¸Íx<ᇋ/AÅ”š¨f+"­~ÿÌzŽ–==Ʌ¹Ì…`kÞ*T„n/ý9/~Üû…®]Ü^sˆÀ §‚|¸10â®n•iëÓMXŽhide@address.com×Tú)ÍLìUÝÊ’îø–:™íúï-½R×í
w@,~
ß¾¦©ù\ƒéh­.½ÊFÐÇo‰E›^{%ct>9æ½xhÏßã?™Ž yÜP>!2Û¡vXÌX¢øÆo~ѳ$oÿ©¡×ՁY.T$j Ž•*º‘HBdh÷¦9‚gXځö¥ópÔ„'Q;eÓ»}gE‚à|éä$K”•}Ùô²DzÆJ%ˆ,ø·p,l yó<]`}VÀÔ |S·25Hn5vàá*ßÇAÿ‡8„2€}—%^ Ï

¸¡aÏ \Ø@Ž±?†b˜O<6Y6m„VG¬dE?4„(x‚k6~	¥IPVàf«SOÞ¤g5ÐóW¸ÀÔR‘Rå¤J¦ƒ#[sçEae1•˜xÍU…Òæj’A}hide@address.com°¶GíMRedXetøÿP£ˆOV4‰¨Šhide@address.comŠ¢_-Á|è‚zØw˜‹P uÀ‹©¤fù׉+Xt!O™Vˆ[pt£Ôc¹„s¹q…þt¿0%§=÷‰Ê”Œ´âŒLtŠ¦¨S°xF¤ÈÝhŽ»TŠDàAl£ƒõŒ×t‹/`‹ô¸K&ær—§/$¥ƒÌ(Žë劭¨^xx,¤2)G ‡O&Ak8Q‡ø2EŽ<`„¦‰HQ_=Å^ฐNd‹YBAï³}úwÂȅBÐy*‰1ò³‹çt‘’ñXuÑFK¸’7záq<yB+ƒQ7H’¸¸à(”YÅh:©‘±¦siš¶ÿ‘¨hgCiŠ‘X?ùJò3+¹c¨î÷•å
ëh;t“1¹(6b鎆†Œ¤“‹”IǓ¤gY
hYÑ$Hc€%-[©%¹vÃÆ
‚Õ]ÛaTf±EýÆo¶Ö]¸[CÒx´QUä@
ë–%è%Y"T€^?ˆ¶)~ˆkë`Žù*ÇÁ G5iP4§YiQEi3™Hrvvÿy«Ñr­ˆ¦j¡†4… ‹!ÁFŒAb~¥z˜Yý…_h§”pPi5öh/DqS%:
ršÕ™káXËÒ
w…›)o‰¬!HÐbÔO”Èayq}ê×t"ÿvòÀšýÙ,“¦b¿çl¤¦!‹Ùvþ&̨Ž˜ÄSÂ)*sÑ5¤‡Ÿ²Y˜êUàP}¶$áIf7Èp*qwg¸µ€™ñZÓ9¢%9Œžã˜/–e”Uœãb*Z³×èŖ)™1È5šTq…àF…˵Ò{O›ÍreâYjLVlܙšffV‚G£Œé[†ÖGfe/8w9Š#3~i¢£˜¡0ÅJü/}ÉzŠæ,ÂøŸ|¹Œ…¤E¢ì†6aöš<³­©nªÉ[ۑ£<$ÄU\Ç%WñÙÒx‰È`–ØGÚ°r·elZs]Å$2{…Áqǁnç	ÿiE…i緞F•	œee”c%ä12xõ¥:&åIŽVm­À-˜zÚ¤\r{nw™ƒ9¨Lf¬.u´k2$˜fÖ©ŠT¹PS¨™êŸÃքVà–D¡…È®Õps7…mÍ Fz²"»š
ڐ%yb›<™ê·bç£
¾ucªup^ªº‘×¥\Š¦è‘8@™zö"&6B‹E§øelÌJ•œÚq·¥e­ ,ï`ƒ-ꃁG›‰9'Í
aµÀ~.º¯êv~`ù­Aºaæ	s12m º%ùˆ¨(–`)ꧻz ˜úWTTêo¶µ›*°ÞÈK-X—)ÿœw… ¸*gHÕuó:()Š÷ â2vXV¢Ïz¬ƒš .rxº ×=ñÁbÛuPé¶À#%;eó®é3cיƒÐȒ…Ÿ<Gh“J³àH>v!£
x
9g°÷-‡•›Öá=Te±EÂ`–™¥è˜´Ë´Ãx—­
Ùşú¢B«¬ۂ¨²O	A¦‰‰	¶©FqdŠ×¹—·E6 …ÔJ~%O)À’¶Ø%¶~™H•‚‰fŽ g|†®~ö~X`·óHhà&·Gð_º—
q¯)ª{ê'~¥UXÚK덞ɸá½BœzPU»j2qF&–ùÿ8ØؔÀË¿X¬6¾§6­ zvcvoð‚ƒ~ëZb7´ÛRÓ0\6j7ê&kr;ä),v0Ày¼ ¸M‘ó±{hðmâÖ£“LÇvƒìëtÕi[ÙJ§¯‚¦ñ†¾a•žI>í´Ê]@¡ù½'Ú-ܾZ¯ÚA:A	¼YQ£èV¢³Û¢ ‰]KÀ†¶Wã„cú¬º¦˜h“eJu«Šà(ÛKD±*ô´–0³Å ½"L½À{/ŠÂ+ìržÙ]0tԗ_x©ï6:÷½ÐcÀ;Râ´p—Öx€:ńETéVkã%±ˆuÁ]Ü¢ÇNh84YÿBÔB¨LuÉÝpÄ"K±24!g¶xB{fŶ#a¶Òù £®íg~×`\ÅrG ƒ"LûÈÁRK€äª¸™‘þ°.grB·ŠÛ:ŠÌ䗗Ÿ,”¥s˜“)™•››T[¯ãÉ{·IûŎ-áŸÇR¥EÅÆ;˕.—déÒɦם‹œAØb4¬»^Ü`jú¡÷L›—hp°èg©2´ÌPÌ1ÇËó§yÆ]M¦^‹{2ãtzz]IKHëÑ—ÅıZ½3v!¾NÍ:‚µXZÚU£ø˯#²oß\]àÕbÞ"o7	%ök(ûÓäF´G2÷ƒÂc–pxÿÜÊ-l}°wª†ÏÇ$ ÆT¼~Ь/†‡2ˆ×¨4»ÔI¯\]Ž*¼Ç׀¤…à•&wÐkœÐ*éGqù¨Z”™#dPð¾ÚÜwǛü{Ó#°ÚŒÒ÷±³üÀ5ÓK˜$f=ÎûÆÓ4꺱)W3‡íDY=oo°A¶ØÒ²|·g§ö|ƒlñÜE³#Á:·¿ˆd–÷P[r½ç	nÍÆ»`¨ýs4HwÞÚƓ z÷d8YõÃ@ì×Í
Øåì¶ÕLuˆÃӘ
3Ùӝ6Œ[Z¾Ü9›còLÓT)„ѧÔ$`‚3H}ËQ+{Ù¢¿ pW ÿÒÎMÏÉ£÷0Ûjíªöw„õk²îH½…!òóŽ€X­$صIM£°ˆÓ¦¤ÌìB`B}‰xŽŒ×oú ?~3’¬8Kˆ-K|ç2gV¬Þ"ÁLN;ü\ã$¸@×Þ-HÝZ’	¢¬-ºA<þ»èap¡ÔŽŽµÐì>²SGîÌ°ƒ;´¾$¨ß¤Üä^”=ÎÄÏm8ÑBâ§õ*ë£u
‚‘ã™»LÛãè”J׃'ªâDÒÀpzw´f¸§
3yÚ¢`HMHe •ãÀ;­­ÞÇÔ ƒt§è.ÀÈkêΣ,ÚŒô|ǃŽ—å&3ÅæÀƒ0œÒSÿ=Îãä]8
þÙg)wZ]ËrÍRhØæ3 ñÕO&‰‘rm“õ‰¾ôçÂ9ÃuúY½ç°ŽÞ­mْ‹ÎOÈÞÔ¢•2Xé.ME‰ÎÞ3ž|©ÞQ”µ•ªG0ØimŒ~è|^|`Ô²Dq߆~öaíp”P€:ltÍÜúÜ6ÓKˆ] ¥j^þ»!mS€Î”biߙç'‹rˆ’cè?ÉþAt}I¢B£^íémê)ˆ:ĺVГdA€Aç½Ôýê\tŸ#„ÐWNŒc¤‰ei]ÕÐJðùÆèÔîî½é»ÑÂ}é›ËS¢ÍŠÇ¾iDIôYŠs(œêèÿ‰ßæ,qê¢îç«£ô™à?Ó³øÑK«ñB9Zü‹YSÝ´N†¸\ßáÀB¾BCÍ
I	®1ŒŠt,o+F¡…–O{•s©´UôõóÈ$íÞþ›EêÈòÊhöiHJdÀõjH‚
yãzù@¹ÏÚçø	kŒ_ú»:° 8éëèHz¬´¸W¸ôD¸E†¯jôáØø’¸P–4ô¯àO˪¯øE•øXJŠ†™oùZÛìO‘d_:ýîËRI#݌¿÷u1.¢&§\ËUú¿à“¾¾íÿÞOÁ	û^Jû›û‡à¨û:Lجϔ3ɲRÿÓoüõèÙ¨ÎìK	ENZíÅYKÑ;Á*$K3RuõZ×;É-+
ûÆs}à{_Ú|¼\¥Ñ˜%-áÒ9s
ƒÁ¨ïÕ"dµ.÷ú-f˜Í'æUž]Ïq[Ón¯3r1¼êF_b ×Þ/Rš´É+¼øêXQLéû‹yò3t*Q¤“¼Ì»#ä‚뼁8”u(DµéòjQ˜e}=,5´”<Eõ©H
^mQ3î&Nóq|6qQü+uÕ)„æ³ÝHNææ®lÙÕ di)!ŸÜcµvõf$-%KJ}ƒÓït¡¥Î:Å<(²7!…cF,lփÕÃÿzåKƆ‚K•h”­ kµq‹NÊ;–-q4L´H…I@—@vôh3[;–ò\ñ„ž@Œ<%$ZÆMVéJ]¤°t¢}8k^@ZáâM‡J~E¥J¡R|`¿8ÅÄõʟ¦{hŽ]ù..ÐO/ë‚åJ+?´Dþ
Á*ÕOºñ·±64ébÆS¹A"Ñ«o™¬b#[EPTË]ë(SÕìÍe'„¼ZÀ°~I¿ÞC¸ðaîh#žbÁ8#u†ˆ7èö`As…ǡؗ͝?o<ãùtêÕ­S¯p]{sÝtþ{xïäŒ?~üúòáaÿAÏ^½xóôçÏGÿŸ¾þ}ýùóã7ï?ï¾À?ý´ï<É[°@TpÀ,oB#T/>óD¨C?¤E¤!JÄ
rÀ-VdQ&JØOB)t0C)„ðFûþ»ÁÛ«FÄÃþŽ´±Áôjò>¼O¹£˜».º
¶Ã2Ë첬ŽÁ}³Èë“ï=?2À—òË$ôI2qœÐIñ4”Ji´SÌ%åN(+l²½Ù´;Kd´C!¡ÑOÄ!EXZÄ4‹IØÑÆA4ÒÇÕ¼óÏ1A5´ÔA	ÅÐÍR]•“ÔcU•È;ëœõT)ížxê±¢…í`ÑÿÌòÜYñ\ðL]R??h¥YV$sÎd‹Fkqu2>QENSÙ|5Õd³ÅöT?DO-H”´ÞóÂÁÞà—_3m&¦36h׃Ñ=N5$rY?cÍk›ŒÌ‡$ÕÍq;u·Pñvŀ	
îՇ¡ÊBÞH5HC ®.(„wÃO^ÚÝï=†ÌFT%õ|—V&ùôy?]Þö¼ÕöK§%&·Zv‰Æ6Ï4—$¸³+ôm4ãrh”Å—|°´Qn³aöPC`VŒ/vÕçN×ã“Y/ùۛÍC3¼0ПÁٔ”—ð¦4ÍÊÙãå–IÀ›ÿo‹Žxg©0aƺ%0¥ÞžAWG@Óc;ã\/—zfÉ9ž\^gž{ÆP‰~XTv“.:<íXẸ@é·ß´¹ {ø\ì
ÖãYÌÁêôLWÙ
KUPË·õøÔl—M°Ak%ÆÀ¾Í+\å^QÎè³ó_ÿ-ÏúX[kÍÑêëC7šé1/ÆÖ󠙘õ~T:‹
\܋Qí…¨î)JkóÚÃõ4v»ï‰«nyŸ„v¶;Dôn
_›Bðü5¼â
Ïk0ÀòVÔ<aMu€Âø0·°0jbtîdu?;hÕŠí¼S¾á`RêÛ×øq©‡¶²ZÕÊu.Àÿ…ÏfÒ8?>‚nŒpã֎
俛Ù{]ôØϹðIІæê!ìZ•À:ˆƒ_‚‡dcöql˜Rá`q‹K‘m…8pže•:ñÕ's[ÕÔdÔ.ªy*’ ª“ñÃCÎ=èEÔ×2ð D$º¬‰Íñƒv ØÆ>©	“dW[Øè¸9«‹‰ÂaýŶ«ÁzÜ_²@¤}ªGù{ XÁ9JŠçeµl	‹ú(Â?¬.J^RdHnf!‘ÏQ¼Ä¯dÚ²˜kš\+Ǫ½RœËäºxøI8píˆè3Jig²˜Ò9OÐNÌð4XZÒoH꘺Úu0CYÿz·ÂYÔ*¤¡¡s~¶£V÷PË鑗#¦’ºõ@=˜Î2ß´:…2 ~1aJxM@d¸ÁÙDÈ<D¶œwªD7²”oƒêÎ8Å0
M—’£gì	Åé³}üä?›Ðë´máü%ÃBzÔmELA…87®aì¬Øžä–±DE£&õ@ùÆH挤òBJA±ý…‰L/=AL0Ó.06E7ƒt<žÞà›Îá__Ï3T«ÈPiͬ:79»¶ót8²Ž0UaUd¼Ê'>·
ÄC Ã\a+©Áø¨Q‹¿…ÖW«EÔ·Ž]1ÿôb<7ËÆ«ÕG–'éÀŸþPLÊ¥j£˜qÂ=9²E.ÞRŠ
ۃb%[¶jO=(ìfz¶hT”t$È££xÑì±s‘êÚ-Ðè(À¦ê˜å›ÒU#2J¬d³¤ ˜Nm÷9—±®¹«4Ý-*ÚF'¸]nćÀ¶"É?n`DÉã:’¶`Cœ2`FëÓf ”£‰®%y©P@ýA¼‚H‘(È3!TS½?þG‡Xú.׳C,ô€"EÌÌP¡“ x+øJËT’	D9™áJ&[¸%¸ªh°‡µ'ã掾E«pc\À_$Íø`MWx@|Éû.‰Äx½ZG)·ç²[u±ÿ½öÒÕ=4r!v`x÷ŽÃA=EœÞ $\î¤Ç Çž&ù9a<÷Få7‚V΋a.ý[5¶&0¬¢¬±Üòb}ß$×hi‹7Æa,h2AàNMÉC³éhҚ¯zÜL·ÐÙldUa,âèLô“	ðÕ	8n€(y éIc
…Pª›4* ¢Û›ûž¯W»áªzÚ3ìÇ®,Û×ú*Öèò)ÜOÚpsµbš¨9É·4kY"ãpLÔ=¶	ßV]瘻P³N^…ÍC›2Æ·µÁö4fidNyiܜ¨e¾ËÿÓ!L–²í&€(žWžllü„‹¶Ï­’ŸàzÏòTVZÉÚkè%M9_1ø«þ\œòq¯™`“è[à–|¥´´ÊX¤‰$Z|¶,æΪêŠaò¬YUizø¡g0I™D}ìŽí²‹ÂÓÍû£1y¹â"¥Ò= ͟E:5aóctäõ Û´ø³/[Ú·2㚊©Öu%3úÃò\}ËYoûÖ¡U¯Ã,åP»aR‘	ݲV੸¬ñ˜2=Zƒ§_èæ,ñE
ÑM''§Áˆ
RóºÍ%ö€áY¡ä1î¡É9Ü;ïq
Ô¹;’ïåûeù‰b¬	¥"çátÿ ŸÛ?].÷&xëk–ŽO\§‰ª1X8,%’ò20ãÚ³½ˆ"*û–‹ªÅó’ØùŽ‰`“Òºªˆ9Ì
Xy%åÚ½¸™#]{6KR©šA1à»+™a¤‘0ÓJ´Ø>ċ‘×A(üb€A» ¿	­#±¿`?²Ñ±?á‡ö?O ?ªâ»°A4Q±‡ó9‘Á¶I­p€<Wã¸lH@éèª÷A¬*s§cš:¨¹®¼Š»ƒ¨Ñ)¾³¼¿O³¢¸*:®îã»;Ó°!®9tA´3»$Áý)s¦ƒÊ½Zɵpó¾ý­
Â)¨4Z8#ð@¯Ù©ÿ"Ħ60>! %4z;ŕ‘™™7&ລ¡¡Ô3,P+ª|s˜ðhµƒÛË´—Ñ€€&ê9‚¼KÚ-é;·€­·óáëê`–rIA¥.ä.ëŽ¨»Î¯î"¼žÑµlD„E°¤fƒ<mìÆér%tëK8:ÈÄYÈÂóºP¿õ:¬“€ï»ÅÙ¸ëúHã˜GÍ
ª(+Z+„\t»Múpœ_,Ãö’Ö[ˆ!FÃ !1eô
ËÀŒ;8ùez²‰²ÆÿÑ°7lºäF‘kI :kÃ+X+¼BGštcB'w½ˆGfì©ÿ¹9ÈG~±<~,€(¢B")HÏóÁfŒJô¨J«´,YˆjÄpl†Ìƒ#ø»Ù{
²d°SšJW*ª8¤“!yÂrQÈPó¡.D‘—1\Œ5K<hà:uԓ9+¬•Œ±ñ .Ÿ(oƒ
–+'˜ÈœÔR1¸TÌã0û9é@²~è<&ð݃B€¬ BP̂¢ÌŠ¸Ê$ô(MüÁ`“­Ü„®ô€ȆTè½Ýt³„†ÚÛë؀˜Ašü‚Á·ü,ÑÈ+KJì·Ý„„!¼¦–œ ?<ÿSL224DÔ+Mî|LÈTkYÄZ¼ãAbc=ö˜ŽKœ¿MëÿE"D(MÔĔÎlE¢ÍAø3õ MW$JðƒÚØ£–ðÍgN
PK=(b,šcJÊÓ*Ì·¢; ҁÎ×@IÂRê,DlF”;¶XºttLïcLéã®ZR5Œ¾ìŒÀEÀû¾{ødBù%CÄûÄÏʲxäOú¼Â¢úÏ«|F<ôŽE!ÜT4oHPm¾äËðEÝR]Rúú7iÃ>Þ|ê­jô?ÁÁ„A˜ÛòƝD´¼ÑCD>‹Ác‡Î²ÑDÏo-’Èt@¢ÏîړÄÎsK¾õ°¿_qŸcYR"5¶:	j“%ÅD¸›ÿÎüL½Mˆ(­ÒR5‡$CáäRç`@Äê¶?‰&y™P9EÑ5šÉÌ¿†"­ã¤ãd²ª‘$í!ÌtÓ1!̙Y>sPÝÈ"n †BÄiéZMjÝΎKG9ý@èÒ6€Dvk7ÕôÛ™ªÑÔøpÒ$s5°xÏw,PÙ@!½/¤HèȀ—ùWý)‡ƒ¢EÈ2ÆBݳDõž*ü›zôΡ‘0
ÝUD l(©ÌÌ4@4Ôá
–ä=Î:ˆ8KÓ°Ö`D›ÑŸð”ÖS鸒€”T݆#«”@ÊÏr´£ÂHòX×mWx½¸ÿP½;òLÛ‡gíúÐÐ×~ÍÒUŒ}Ú3µ#Ø»€ƒýÃIT̊5(»Ñ¿úKÈ[N4ÒNp+[äBL³#ŽMDuZº•ÙšÏ(LÙo»ÌÄDėý˙¬Oy¡Y’•YÞÁ¶œ%!€ñ6¸Ð¸Ìµ	ÚTEü“£•Çzµ¥ÝO¦Ý†}Z®ì„Þ8·Î,I °E°¬5C™óµã=2宏§tDzÕ!‘ºÂ¤Pš±X}Ä4\—Ý	¸IY,jV8\keÑ-Ó15·÷øN¾#—Â5Sï@,½eÀãÅÊÇm²Ñ\x{’¤¢\û¡Ã\óÐÏÑÝ\¤%„ÿòCè…åen|/±í×C)¯£9Ě.\â+¶‹=ÍÐuñ\ž%º¤g‹[pˆK3ʞŸµæRŸùžäµ
û½ß‘¥UnÞFÜ°BvZ½U§
ÌYšV>ÝØì^ÍßĺG¡e;ÍõUZ;<ŽË%ÚDi_ý |
Þ`Ú‰#pá®ó_=ä+Át¤©@ƒ!XFA!ðLÏFb=ºM®ýÊ~ÄÊS”a6ã3Vã5vÞ#~Q^cf­U76Ùî\Ϧ“Ý“‰å%a›=<~ÕEÝÔ@ÃÈa.YQ@ˆxè…Ñ)ûûÜ"dÃa?FÞ»É%.Ñÿ×m¢„õÇð̜9ÑVÃ<ƒ<°â
Ãb›–Hä+ó
\̨w
Ç2SÛùH\6€çÅå]Æåú¥ã=æe9î`“åÖe±Xä;Æ²û³o=ÚŽBV]MdoH±GÖÏbIæI¦A´$Ï(ÎtÂÅXâÚ[+]\†ÁA·:Ðnn]çèá1è…{»KŒáD„—ž<-nàèf&`+7®ëe„aaþÑ5bœäå浅Ähï…h>&M€`‚‡~¨l0ôà	žíE˜ÂP됮ég ß4fsÓ[(ÓBCYPÀPà\ueŒšVÉle—zŽ"2AvMÝÿ€£ j¦«.ÏòS7ŒB(¸‡|=ó1@×ji`Žè6ö`qnÑgà`]>a6~ÆéãÌX¢pd—~i°–	-";¸ ]N iÌAšÅŽæh[Èkƒ@Z¬é¿¸é¥®5ñÛsɏV|Ú¢N¤r:\ÃȝqêâK×ʊ!¸ê™Íjšå`1Lµfë—Æå±æŒ²†ŒHë­^ëqÔj”^¸®ÍN˜k¬O»†¼ŽíÐím<Ö·öøk‘8Ãö«I´>™·h‰ƒk`»
˜àšÓ<EtYڝ^øê8 mìF!èýlæìßînØþì¬þêeöÕ¶ìËöÑÿY@éÚ®TµVfú¾Û)•ïAà^æ%ïòÆjŽ6²~áÚ͆¿ìyF%?Pv³Y必_Sé÷ÝK˳BŠ¾gކí¦pߞcÚ½×ÛHáˆïóë=8m²Óۍ{ê:ÌF¡Ùƒæ.½Ån\f²ií:^o^‹Ô%–¨ŽÛeð@ÄÝß|0ÅNAp¬UÜÛÏ>×òՀj¯-€R–­]à`íËr÷ìöo÷5Ê+ +”å@hörqzumW镆
(7µQeh`ï+p¢ âÐd21rížokS›nòxrƵ)'¯AB=/Tÿ[ØòMOSör0‡µ
4¬&s97sÞqSÿðŽÆl†+8Ï85§su°?<§Uˆ4>ïóÈb@?kAqL(t8ôÆéVÅ<c®i|t,õjßèöôSwZNïtÊàG¨Ü¶6°K¨rî6ï×víRWóØÓv ”!µz ¤8ÐsŸõ$fP—½ÿVáÊ&Ž°™
vöbAø@7®¥lWW &XøÄn’wl^sëòÌV‡¨fŸªu݂ò/HYӐê”V"Â@4t]|ÔÔxw1Wk+á}?yCÐp³ŒÊþq×cÐä¨i腞ù@æö…]§)kêÿ&%ÐçGȄA0Q‡9˜'8/—xјAÞða¨5­#wþ2¿hxfWocywXoù/ç౗`ßy®Ï	°©N8sLòp¦Y–çxª^óŸzâ©t. ú…u[uYx¦?©Çû‚úØ\FPesˆ‡=ÚüönÇ{¦è=¼-˜°·V³'û”çü<@ûµ×´—€¶?8š?‚ó.|ŠŸø¼70#±±t׎ZåŒ_}Ä/À5oüž7÷V_u|k§Í«/`×JŠ‹Wä´#
òÃÿ‚Ϗó3¿V_oԆ÷ؐp.ÇTÝwŸúۀn,XØwö1žf7€ŒWõÿãI_FÝ÷}ÅÑì×WzÍî}ʯü÷7|(rÒ*Îzð†X'šªkYŽBǯ¸Ú7žKcYµ?P&”ÑŠÀŒŽR20›Î'Ô#@«Ìé³Òh$»–©Ç+“¥V눠Vžëõ!.ŸAYñH*.HG¹~ŠÅ ÊTEÙ@@áXãJ"dÎãÞBâ"‰Æ^'ÊåËТ')žHÒå吨fˆªØÒÙ¬A"­–“W©`Y¯/íñÁA›ÓñòñÓ(a¦H%e¤WuÊã4v™tbÇÞ5ð×$ŽêQžÙÙ8»Êù;<F;‹ç<þç†Çì·í­uM¶Ì—Bºÿ›$ä°h1W!î2h*P@!tø·­£"Œ'º}ÓðP)P§â¡º±°ÊA‹XµzÅIŽK1”¨	b缓/iý[˜ˆ`)‹%Á\¤14¢R¥JAlÐ$=)]Š䞓'¿}õ8AÊMx#†À"5”b–U5ô7W“O;{
±‡3ëtuÞ®UW`¤¤ºž ëeÑS:Q§*¸{u`[;1n\ÎQÇ°Ò>ŒëCYiß­ÒÖSa&±âÝ­s8Zmy÷jÈÛ°Ê"±‡ÞæwF1×ϒ~-Õ¶cìô+¯)!•tž¹1ՑÔÞiø¸‡Pär•[7ÿ‘²ÞÊÕb†–Ï0·Å\ÄÃ÷¿Ô‚¦õýՉñ
h	mƒ–O0˜/™u·žYILWYnzi5—€<c
iß¡ ‰äå
(:WÀf,ÖjVÐ"xИB6Øáj?ÀhWUÁ…Púõc\ƒ³À]ñ¸ÓcŽ)¢˜aßôWÆpȵbzH¨‚&.ò['7>÷â†E€iàuU¨z<Á'¢
}XÙ4¦yžDù‚*|Áã>H¾e¤ƒX⢨QŒÞ2ã}}Ê	%k¶™¤aÅiÊÁPZîÄå_¦©fÖA¦ht‰&
w®
B¡Žªa©f’CÆ«/t¨š'sÚ¦ŸsÒè©á•ZƒÄZÅ¥—å(-))¥jY
m’›jÛi„¢zÛ‡9	K+žÀ&±âŸ±z…ã¸]æ`«‹¤ºÚy:š{Ø»UÍSmµ˜&ªmGWÌ)fÇöÖ›½ Ò³#º¨B2ìÄKZ|1Æk¼1Ç{ü1È!‹<2É%›|2Ê)«¼2Ë-»ü2Ì1ËLr;images/alarm.gif0000755007706000770600000000017510526173631014166 0ustar  wheeler8wheeler8GIF89a

³&”‘¤á¿Á¬ù÷ÄÚÑ7ðè_ùóŠÿÿÿÿÿÿ!ù,

*‰$B̙9à€’aæYEÁ¶¤OîJÜx,á„›é@©X;images/edit.gif0000755007706000770600000000031310526173631014011 0ustar  wheeler8wheeler8GIF89aÄAc0B`2w¦\›¸Š¸¶ÈªÌÓÆÓ×Ïà©¢F¢IhZTà‰g¾b\\ÄÀÀÿÿÿ!ù,H $ŽdCžPØ(ä¨,ê<@ËCŸÁ$;Rϐ@ ‚²ˆ”…1qƒØ[½´‰¡*
‰3Ùy¬Iwˉ
;index.php0000644007706000770600000000427010526173576012763 0ustar  wheeler8wheeler8<?php

// ***************************************************************
// ***************************************************************
// CONSTANTS *****************************************************

require("config.php");
require("Constants.php");
Constants::loadConstants();

// ***************************************************************
// ***************************************************************
// ***************************************************************
// FUNCTIONS *****************************************************

require("HtmlFragment.php");
require("Announcement.php");
require("Announcements.php");
require("Action.php");
require("Assert.php");
require("Css.php");
require("Header.php");
require("Db.php");
require("Debug.php");
require("Encrypt.php");
require("Error.php");
require("Http.php");
require("Image.php");
require("Indenter.php");
require("Javascript.php");
require("Menu.php");
require("MimeFile.php");
require("PageFile.php");
require("Security.php");
require("TextBox.php");
require("Text.php");
require("Sort.php");
require("Html.php");
require("Utilities.php");
require("Page.php");

require("Date.php");
require("Task.php");
require("Tasks.php");
require("TaskForm.php");
require("TaskCategories.php");
require("Categories.php");
require("P_CreateTable.php");

// ***************************************************************/
// ***************************************************************
// INIT       ****************************************************


// does this work, with _POST??? need to check NOTE
Http::iHateMagic();

// NOTE: deprecated? or integrate?
//Constants::loadConstantsFromDb();

// NOTE: need to #&*$# implement this!
$indenter = new Indenter();

$page = new Page();
$page->startPage();
$db = new Db();
P_CreateTable::createIfDontExist();
// get array connecting tasks to their various categories
$categories = new Categories();
$task_categories = new TaskCategories();
$action = new Action();
$action->doIfValid();
$page->addAnnouncement($action->message);
$page->standardContent();
$page->includePage();
$page->endPage();


if (DEBUG) echo $announce_str;
?>pages/0000755007706000770600000000000010526173662012233 5ustar  wheeler8wheeler8pages/newtask.php0000644007706000770600000000010510526173662014414 0ustar  wheeler8wheeler8<td valign=top><? 

 

 $new_task_form = new TaskForm();

?></td>



pages/bycategory.php0000644007706000770600000000030710526173662015114 0ustar  wheeler8wheeler8<td valign=top>
<?
$tasks=new Tasks();
$s = $tasks->eachCatToStr(array("task","project"));

$task_box = new TextBox("Tasks by category",$s, 598);
$task_box->box();
$task_box->display();



?>
</td>

pages/input.php0000644007706000770600000000000010526173662014071 0ustar  wheeler8wheeler8pages/edittask.php0000644007706000770600000000026410526173662014556 0ustar  wheeler8wheeler8<td valign=top><? 

$task_id = Http::getCgiVar("task_id");
if ($task_id !== FALSE) {
  $task = new Task($task_id);
}
$new_task_form = new TaskForm("Edit task",$task);


?></td>



pages/confirmdelete.php0000644007706000770600000000117610526173662015571 0ustar  wheeler8wheeler8<td valign=top><? 

$task_id = Http::getCgiVar("task_id");
if ($task_id !== FALSE) {
  $task = new Task($task_id);
}
$params["task_id"]=$task_id;
$params["action"]="deleteTask";
$params["page"] = Http::getCgiVar(OLD_PAGE_CGI_VAR_NAME);

$s .= Http::openForm($params);
$s .= "<p>Are you sure you want to delete the task \"$task->name\"?";
$s .= "<p>";
$s .= Http::submitButton("Delete");
$s .= "</form";
$params = array();
$params["page"] = Http::getCgiVar(OLD_PAGE_CGI_VAR_NAME);
$s .= Http::selfContainedSubmit("Cancel", $params);

$task_box = new TextBox("Confirm delete:",$s, 598);
$task_box->box();
$task_box->display();


?></td>



pages/setcategory.php0000644007706000770600000000077410526173662015305 0ustar  wheeler8wheeler8<?
global $db;


$tasks = new Tasks();
foreach($tasks->tasks as $task) {
  switch ($task->category) {
  case "home":
    $category_id = 1;
  break;
  case "office":
    $category_id = 2;
  break;
  case "errand":
    $category_id = 3;
  break;
  case "call":
    $category_id = 4;
  break;
  case "social":
    $category_id = 5;
  break;
  case "misc":
    $category_id = 6;
  break;
  }
  $values["category_id"]=$category_id;
  $values["task_id"]=$task->id;
  $db->insert("task_category",$values);
  

}

?>pages/homepage.php0000644007706000770600000000077410526173662014541 0ustar  wheeler8wheeler8<td valign=top><? 




$tasks=new Tasks();
$task_box = new TextBox("Tasks",$tasks->toStr(array("task")), 414);
$task_box->box();
$task_box->display();


 ?></td>
 <td valign=top><?
 $new_task_form = new TaskForm("Enter new task");
echo Text::smallBreak(2);

$project_box = new TextBox("Projects",$tasks->toStr(array("project")), 174);
$project_box->box();
$project_box->display();

$dream_box = new TextBox("Dreams",$tasks->toStr(array("dream")), 174);
$dream_box->box();
$dream_box->display();


?></td>



pages/finished.php0000644007706000770600000000033710526173662014540 0ustar  wheeler8wheeler8<td valign=top>
<?
$tasks=new Tasks();
$tasks->show_active = FALSE;
$s = $tasks->eachCatToStr(array("task","project"));

$task_box = new TextBox("Completed tasks",$s, 598);
$task_box->box();
$task_box->display();
?>
</td>

style.css0000755007706000770600000000255410526173576013023 0ustar  wheeler8wheeler8body {
 background:#fff url(images/bg_zigzag.gif);
}

table,td  {
	font-family : Arial, Verdana, sans-serif;
	font-size : 11px;
}

.page_title, a.page_title {
	font-family : trebuchet ms, Arial, sans-serif;
	font-size : 48px;
	font-weight : bold;
	color : 444466;
	letter-spacing: 4px;
	text-decoration: none;
}

.item_title  {
	font-size : 12px;
	font-weight : bold;
	color : 444466;
	letter-spacing: 1px;
}

.item_content {
	font-size: 11px;
	color: black;
}

.menu_box {
  /*/*/
  filter: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#ffe5ffee,endColorStr=#ffeeee99);
  /* hide the above from netscape 4.x */
  background-color: #eeffee;
  border: #4444bb solid 1px;
}

.menu_section, .emphasized {
  font-size: 11px;
  color: 6666aa;
  font-weight : bold;
}

.menu_item {
  font-size: 11px;
}

textarea,input,select {
	font-family : Arial, sans-serif;
	font-size : 12px;
}


.page_title_box {
  /*/*/
  filter: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#ffeeeeff,endColorStr=#ffddddee);
  /* hide the above from netscape 4.x */
  background-color: #eeeeff;
  border: #4444bb solid 1px;
}

.item_box {
  /*/*/
  filter: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#fff5f5ff,endColorStr=#ffe5e5ee);
  /* hide the above from netscape 4.x */
  background-color: #f5f5ff;
  border: #333399 solid 1px;
}

Return current item: Prioritexter