Updates for php version diffs
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 30 Nov 2016 17:41:00 +0000 (12:41 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 30 Nov 2016 17:41:00 +0000 (12:41 -0500)
Updating to move site to ws6

admin/packages/addPackage.php
authorize/sequence.txt
classes/class_administrator.inc
classes/class_auth.inc
classes/class_contact_form.inc
classes/class_events.inc
classes/class_guide_form.inc
classes/class_package.inc
classes/class_ticket_inv.inc
classes/class_toolbox.inc
order-form.inc.php

index 83167c3..2564935 100644 (file)
@@ -42,7 +42,7 @@ if( date("w",$min_time) == 0 )
     $min_time = mktime(0,0,0,date('m'),date('j')+6,date('Y'));
 }
 // min date for packages is May 15th (fort closed before this)
-$fort_opens = mktime(0,0,0,5,15,date('Y'));
+$fort_opens = mktime(0,0,0,5,13,date('Y'));
 if( $min_time < $fort_opens )
 {
     $min_time = $fort_opens;
@@ -57,8 +57,8 @@ else
 }
 // min date for packages is May 13th (fort closed before this)
 $min_date = date("n/j/Y",$min_time);
-// max date for packages is Oct 2nd (fort closed after this)
-$max_time = mktime(0,0,0,10,3,date('Y'));
+// max date for packages is Sep 30th (fort closed after this)
+$max_time = mktime(0,0,0,12,30,date('Y'));
 $max_date = date("n/j/Y",$max_time);
 $cal_set = ',pagedate: "'.$page_date.'",mindate: "'.$min_date.'",maxdate: "'.$max_date.'"';
 $fields[] = array('name'=>'cday','type'=>'hide');
index 16d6cd1..931fdb7 100755 (executable)
@@ -1 +1 @@
-1016541
+1016544
index 5d33fa0..36493cc 100755 (executable)
@@ -141,7 +141,7 @@ class administrator extends GLM_DB
     function edit_result( $data )
     {
         $out = $this->add_form_top();
-        $out .= '<form name="admin" action="'.$GLOBALS['PHP_SELF'].'" method="post">
+        $out .= '<form name="admin" action="'.$_SERVER['PHP_SELF'].'" method="post">
             <table id="admin-edit-table">';
         $form = new form_creator( $this->fields, $data );
         $this->form_scripts =& $form->form_scripts;
@@ -160,7 +160,7 @@ class administrator extends GLM_DB
     function add_result( $data = null )
     {
         //$out = $this->add_form_top();
-        $out .= '<form name="admin" action="'.$GLOBALS['PHP_SELF'].'" method="post">
+        $out .= '<form name="admin" action="'.$_SERVER['PHP_SELF'].'" method="post">
             <table id="admin-edit-table">';
         $form = new form_creator( $this->fields, $data );
         $this->form_scripts =& $form->form_scripts;
@@ -188,7 +188,8 @@ class administrator extends GLM_DB
 
                     case "text":
                     default:
-                        $q_part[$fields['name']] .= " = '".$_POST[$fields['name']]."'";
+                        $q_part[$fields['name']] .= " = '"
+                            . addslashes( stripslashes( $_POST[$fields['name']] ) ) . "'";
                     break;
                 }
             }
@@ -310,7 +311,7 @@ class administrator extends GLM_DB
 
             case "Update":
                 $out .= $member->update_member( $_POST['id'] );
-                header('Location: '.$GLOBALS["PHP_SELF"].'?Action=List+Members');
+                header('Location: '.$_SERVER["PHP_SELF"].'?Action=List+Members');
                 exit();
             break;
 
@@ -339,7 +340,8 @@ class administrator extends GLM_DB
 
             case "Update":
                 $out .= $member->update_member( $_POST['id'] );
-                header('Location: '.$GLOBALS["PHP_SELF"].'?Action=List+Members');
+
+                header('Location: '.$_SERVER["PHP_SELF"].'?Action=List+Members');
                 exit();
             break;
 
@@ -361,7 +363,7 @@ class administrator extends GLM_DB
 
             case "Delete Package":
                 $out .= $package->delete_package( $_GET['id'] );
-                header('Location: '.$GLOBALS["PHP_SELF"].'?Action=List+Packages');
+                header('Location: '.$_SERVER["PHP_SELF"].'?Action=List+Packages');
                 exit();
             break;
 
@@ -371,7 +373,7 @@ class administrator extends GLM_DB
 
             case "Update Package":
                 $out .= $package->update_package( $_POST['id'] );
-                header('Location: '.$GLOBALS["PHP_SELF"].'?Action=List+Packages');
+                header('Location: '.$_SERVER["PHP_SELF"].'?Action=List+Packages');
                 exit();
             break;
 
@@ -407,7 +409,7 @@ class administrator extends GLM_DB
                 $out .= $package->approve_vouchers();
                 if( $package->return_page )
                 {
-                    header('Location: '.$package->return_page);//$GLOBALS["PHP_SELF"].'?Action=Voucher+Reciepts');
+                    header('Location: '.$package->return_page);
                     exit();
                 }
             break;
index 56d9709..0c921f9 100755 (executable)
@@ -1,33 +1,33 @@
 <?php
-/** 
+/**
 * Toolbox Classes :)
-* 
+*
 * <p>
 * $Id: class_auth.inc,v 1.1.1.1 2007/04/19 13:06:15 matrix Exp $
 * Authentication class. Enables different levels
-* of authentication for users with one master(admin) user 
-* able to set up accounts for others and permissions based on different 
+* of authentication for users with one master(admin) user
+* able to set up accounts for others and permissions based on different
 * levels.  Can be modified to use more levels.  This is set up with four levels.
 * </p>
 * @package Toolbox Library
 * @subpackage Authentication Library
 * @filesource
-* 
+*
 */
 /**
 * Require DocBlock
 */
 require_once( BASE.'classes/class_db.inc' );
-/** 
+/**
 *      authuser
 * <p>
 * $Id: class_auth.inc,v 1.1.1.1 2007/04/19 13:06:15 matrix Exp $
 *   Authentication class. Enables different levels
-*   of authentication for users with one master(admin) user 
-*   able to set up accounts for others and permissions based on different 
+*   of authentication for users with one master(admin) user
+*   able to set up accounts for others and permissions based on different
 *   levels.  Can be modified to use more levels.  This is set up with four levels.
 * </p><p>
-*   Permissions are checked using bitwise operators so you can have custom permission 
+*   Permissions are checked using bitwise operators so you can have custom permission
 *   levels per user.  Thus an admin user with perms set to 15 would have all levels.</p>
 *   <code>CREATE TABLE authuser (
                *   id SERIAL,
@@ -72,8 +72,8 @@ require_once( BASE.'classes/class_db.inc' );
                /** @var $auth_data array to keep user info */
                var $auth_data;
 
-               /**     authuser 
-               Class construtor.  Set up the default variables for 
+               /**     authuser
+               Class construtor.  Set up the default variables for
                the class.
                */
                function authuser( &$DB )
@@ -93,7 +93,7 @@ require_once( BASE.'classes/class_db.inc' );
 
                /**
                * fill_data:
-               * 
+               *
                * @return mixed
                * @access public
                **/
@@ -114,20 +114,20 @@ require_once( BASE.'classes/class_db.inc' );
                Checks the user login.  Checks the users IP address to be sure
                it is not hijacked.
                @param level - If a level is giving and the user doesn't match the
-               level then the page is not shown. 
+               level then the page is not shown.
                @return void
                */
 
 
                /**
                * verify: verify the user
-               * 
-               * <p>check the table in $this->usertable for user matching 
+               *
+               * <p>check the table in $this->usertable for user matching
                * password and username and tells if passed or not
                * </p>
-               * @param $NULL: 
-               * 
-               * @return boolean  
+               * @param $NULL:
+               *
+               * @return boolean
                * @access public
                **/
                function verify($level=NULL)
@@ -140,8 +140,8 @@ require_once( BASE.'classes/class_db.inc' );
                                $this->logout();
                        }
 
-                       /* Check to see if GLM-AUTH cookie is set then check if 
-                       $auth is registered in session. 
+                       /* Check to see if GLM-AUTH cookie is set then check if
+                       $auth is registered in session.
                        */
                        if($_COOKIE[$this->cookie_name])
                        {
@@ -159,7 +159,7 @@ require_once( BASE.'classes/class_db.inc' );
                                {
                                        session_start();
                                        session_destroy();
-                                       $p = session_get_cookie_params(); 
+                                       $p = session_get_cookie_params();
                                        setcookie(session_name(), "", 0, $p["path"], $p["domain"]);
                                        setcookie($this->cookie_name,"",0,"/");
                                        if(!$this->login())
@@ -190,13 +190,13 @@ require_once( BASE.'classes/class_db.inc' );
 
                function sqlBypass( $text )
                {
-                       $text = eregi_replace('[();\'\"]','',$text);
+                       $text = preg_replace('%[();\'\"]%i','',$text);
                        return( $text );
                }
 
-               /**     
+               /**
                * login
-               * 
+               *
                *  <p>User login funtcion.  Now this will check for a cookie
                *  which can be set if the user selects remember my login.</p>
                *  @return boolean - True if login in successful False not.
@@ -228,14 +228,14 @@ require_once( BASE.'classes/class_db.inc' );
                                        }
                                        return(true);
                                }
-                               else 
+                               else
                                {
                                        session_register("auth");
                                        $auth['failed'] = true;
                                        return(false);
                                }
                        }
-                       else 
+                       else
                        {
                                session_register("auth");
                                $auth['failed'] = true;
@@ -248,9 +248,9 @@ require_once( BASE.'classes/class_db.inc' );
                * is_admin:
                *
                * <p>Tells if user is an admin user or not</p>
-               * 
+               *
                * @return boolean
-               * @access public 
+               * @access public
                **/
                function is_admin()
                {
@@ -264,12 +264,12 @@ require_once( BASE.'classes/class_db.inc' );
                        }
                }
 
-               /** login_screen 
+               /** login_screen
                *
                *  <p>Outputs the login screen</p>
                *
                *  @return void
-               * @access public 
+               * @access public
                */
                function login_screen()
                {
@@ -292,7 +292,7 @@ require_once( BASE.'classes/class_db.inc' );
                                                <td>Username:</td>
                                                <td><input type="text" name="username"
                                                        value="';
-                                                       if ( isset( $this->auth["uname"] ) ) 
+                                                       if ( isset( $this->auth["uname"] ) )
                                                        {
                                                                $out .= $this->auth["uname"];
                                                        }
@@ -307,7 +307,7 @@ require_once( BASE.'classes/class_db.inc' );
                                                <td align="right" colspan="2"><input type="submit" name="submit" value="Login now"></td>
                                        </tr>
                                </table>
-                               <p>'; 
+                               <p>';
                                if ( $_SESSION['auth']['failed'] == true )
                                {
                                        $out .= '<!-- failed login code -->
@@ -328,27 +328,27 @@ require_once( BASE.'classes/class_db.inc' );
                        if (document.forms[0][0].value != \'\')
                        {
                                document.forms[0][1].focus();
-                       } 
-                       else 
+                       }
+                       else
                        {
                                document.forms[0][0].focus();
                        }
                        // -->
                </script>';
                return( $out );
-       } 
+       }
 
        /**     logout
        Ends the current session and distroys any cookies that were
        created
        @return void
-       * @access public 
+       * @access public
        */
        function logout()
        {
                session_start();
                session_destroy();
-               $p = session_get_cookie_params(); 
+               $p = session_get_cookie_params();
                setcookie(session_name(), "", 0, $p["path"], $p["domain"]);
                setcookie($this->cookie_name,"",0,"/");
        }
@@ -357,15 +357,15 @@ require_once( BASE.'classes/class_db.inc' );
        Stop the script from going any further.
        @param reply - string to show user if any.
        @return void
-       * @access public 
+       * @access public
        */
        function failed($reply=NULL)
        {
                if(isset($reply))
                {
                        die('<b>'.$reply.'</b>');
-               }       
-               else 
+               }
+               else
                {
                        exit;
                }
index 6b84f7d..56443ac 100644 (file)
@@ -632,7 +632,7 @@ class contact_form {
                                        break;
 
                                        case 'phone':
-                                               if( $_POST[$val['name']] && !ereg("([0-9]{7,11})",ereg_replace("[()-. ]","",$_POST[$val['name']])) )
+                                               if( $_POST[$val['name']] && !preg_match("%([0-9]{7,11})%",preg_replace("%[()-. ]%","",$_POST[$val['name']])) )
                                                {
                                                        $error[$val['name']] = 1;
                                                        unset( $_POST[$val['name']] );
@@ -644,7 +644,7 @@ class contact_form {
                                        break;
 
                                        case 'url':
-                                               if( $_POST[$val['name']] && !ereg("^http://",$_POST[$val['name']]) )
+                                               if( $_POST[$val['name']] && !preg_match("%^http://%",$_POST[$val['name']]) )
                                                {
                                                        $error[$val['name']] = 1;
                                                        unset( $_POST[$val['name']] );
@@ -657,7 +657,7 @@ class contact_form {
 
 
                                        default:
-                                               if( $_POST[$val['name']] && ereg("^http://|\@",$_POST[$val['name']]) )
+                                               if( $_POST[$val['name']] && preg_match("%^http://|\@%",$_POST[$val['name']]) )
                                                {
                                                        $error[$val['name']] = 1;
                                                        unset( $_POST[$val['name']] );
@@ -843,7 +843,7 @@ class contact_form {
                                        if( $db_interest_field )
                                        {
                                                $interest_array = $_POST['interest'];
-                                               $f_int_string = ereg_replace("^:|:$","",$cData[0][$db_interest_field]);
+                                               $f_int_string = preg_replace("%^:|:$%","",$cData[0][$db_interest_field]);
                                                if( $f_int_string )
                                                {
                                                        $f_int_array = explode(":",$f_int_string);
@@ -976,7 +976,7 @@ font-size: 12px;
 ';
                        if( $_POST['interest'] )
                        {
-                               $interest = ereg_replace( "^:|:$","",$_POST['interest'] );
+                               $interest = preg_replace( "%^:|:$%","",$_POST['interest'] );
                        //      $_POST['interest'] = explode(":",$interest);
                        }
                        foreach($this->DB_fields as $key=>$value)
index 08650c2..f6ad2fe 100755 (executable)
@@ -1,11 +1,11 @@
 <?php
 /**
  *
- * Library for the generation of the detail events 
+ * Library for the generation of the detail events
  *
  * <p>USAGE:  to build an event calendar create the events class. thats it.  <br>Pass it second param of 'Flat' to change to flat layout.</p>
  *
- * @package Toolbox 
+ * @package Toolbox
  * @subpackage Event
  * @filesource
  */
@@ -19,7 +19,7 @@ require_once(BASE.'classes/class_db.inc');
 require_once(BASE.'classes/class_template.inc');
 /**
  *
- * Library for the generation of the detail events 
+ * Library for the generation of the detail events
  *
  * <p>USAGE:  to build an event calendar create the events class. thats it.  <br>Pass it second param of 'Flat' to change to flat layout.</p>
  * <code>
@@ -36,15 +36,15 @@ require_once(BASE.'classes/class_template.inc');
 class GLM_EVENTS extends GLM_TEMPLATE{
        /**
         * @access public
-        * @var integer 
+        * @var integer
         */
        var $topicid;
        /**#@+
         * @access public
-        * @var string 
+        * @var string
         */
        var $page_name;
-       /** 
+       /**
         * Type of display flat or calendar based on weather or not a topicid exists.
         */
        var $display_type;
@@ -58,13 +58,13 @@ class GLM_EVENTS extends GLM_TEMPLATE{
                parent::GLM_TEMPLATE( $GLOBALS['catid'] );
                $DB =& $toolbox->DB;
                $this->topicid = $GLOBALS['topicid'];
-               $this->page_name = BASE_URL.'events.phtml';//$GLOBALS['PHP_SELF'];
-               $this->display_type = $this->get_type(); // Calendar or Flat 
+               $this->page_name = BASE_URL.'events.phtml';
+               $this->display_type = $this->get_type(); // Calendar or Flat
                $this->get_events();
        }
        /**
-        * get_type 
-        * 
+        * get_type
+        *
         * @return string
         */
        function get_type()
@@ -84,7 +84,7 @@ class GLM_EVENTS extends GLM_TEMPLATE{
                                return('flat');
                        }
                }
-               elseif( $_POST['topicid'] || $_GET['topicid'] || $_POST['topic'] 
+               elseif( $_POST['topicid'] || $_GET['topicid'] || $_POST['topic']
                                || $_POST['topics_id'] || $_POST['EventName'])
                {
                        return('flat');
@@ -97,9 +97,9 @@ class GLM_EVENTS extends GLM_TEMPLATE{
 
        // date helper funcs
        /**
-        * lastDayOfMonth 
-        * 
-        * @param string $timestamp 
+        * lastDayOfMonth
+        *
+        * @param string $timestamp
         * @return string
         */
        function lastDayOfMonth($timestamp = '')
@@ -108,13 +108,13 @@ class GLM_EVENTS extends GLM_TEMPLATE{
                return( mktime(0,0,0, date("m",$timestamp)+1, 1, date("Y",$timestamp))-3600*24);
        }
        /**
-        * show_print_link 
-        * 
+        * show_print_link
+        *
         * @return string
         */
        function show_print_link()
        {
-               if(!ereg("printable.phtml",$GLOBALS["PHP_SELF"]))
+               if(!preg_match("%printable.phtml%",$_SERVER["PHP_SELF"]))
                {
                        $month = (int)substr($GLOBALS['month'],0,2);
                        $year = (int)substr($GLOBALS['month'],3,6);
@@ -128,9 +128,9 @@ class GLM_EVENTS extends GLM_TEMPLATE{
                return( $out );
        }
        /**
-        * firstDayOfMonth 
-        * 
-        * @param string $timestamp 
+        * firstDayOfMonth
+        *
+        * @param string $timestamp
         * @return string
         */
        function firstDayOfMonth($timestamp='')
@@ -156,9 +156,9 @@ class GLM_EVENTS extends GLM_TEMPLATE{
                }
                if(!$month || $month == "All")
                {
-                       $month = date("n");     
+                       $month = date("n");
                }
-               if(ereg("^0([0-9]).*",$month,$part))
+               if(preg_match("%^0([0-9]).*%",$month,$part))
                        $month = $part[1];
                $st = mktime(0,0,0,$month,1,$year);
                $starting = date("m-d-Y",$this->firstDayOfMonth($st));
@@ -191,7 +191,7 @@ class GLM_EVENTS extends GLM_TEMPLATE{
 
        /**
         * get_event_search
-        * 
+        *
         * @uses PGSQL_ASSOC
         * @uses GLM_EVENT::$page_name
         * @uses calendar()
@@ -223,9 +223,9 @@ class GLM_EVENTS extends GLM_TEMPLATE{
 
                $page = BASE_URL.'events.phtml';
 
-               for($i=0;$i<pg_numrows($result);$i++) 
+               for($i=0;$i<pg_numrows($result);$i++)
                {
-                       $data = $this->DB->db_fetch_array($result,$i,PGSQL_ASSOC); 
+                       $data = $this->DB->db_fetch_array($result,$i,PGSQL_ASSOC);
                        $s_month = $data['d1_month'];
                        $s_year = $data['d1_year'];
                        $e_month = $data['d2_month'];
@@ -233,11 +233,11 @@ class GLM_EVENTS extends GLM_TEMPLATE{
 
                        $start_time_stamp = mktime(0,0,0,$s_month,1,$s_year);
                        $end_time_stamp = mktime(0,0,0,$e_month,1,$e_year);
-                       $watchdog = 20; 
+                       $watchdog = 20;
                        $cur_time_stamp = mktime(0,0,0,$m,1,$y);
-                       for( $y=$s_year, $m=$s_month; $cur_time_stamp <= $end_time_stamp ; ) 
+                       for( $y=$s_year, $m=$s_month; $cur_time_stamp <= $end_time_stamp ; )
                        {
-                               if( $m == 13 ) 
+                               if( $m == 13 )
                                {
                                        $y++;
                                        $m = 1;
@@ -261,9 +261,9 @@ class GLM_EVENTS extends GLM_TEMPLATE{
                }
 
                // Selections part
-               while( list($key,$value) = each($selection)) 
+               while( list($key,$value) = each($selection))
                {
-                       $qs = "SELECT  
+                       $qs = "SELECT
                                DISTINCT $key
                                FROM    event
                                WHERE   visable = 't'
@@ -274,12 +274,12 @@ class GLM_EVENTS extends GLM_TEMPLATE{
 
                        $out .= "<select name=\"$key\">";
 
-                       for ($i=0;$i<pg_numrows($result);++$i) 
+                       for ($i=0;$i<pg_numrows($result);++$i)
                        {
                                $data = pg_result($result,$i,$key);
-                               if($data != "") 
+                               if($data != "")
                                {
-                                       $out .= "<option value=\"$data\">$data\n"; 
+                                       $out .= "<option value=\"$data\">$data\n";
                                }
                        }
 
@@ -287,8 +287,8 @@ class GLM_EVENTS extends GLM_TEMPLATE{
                }
                $out .= '<a name="event"></a>';
                // topic search part
-               $qs = "select distinct on (descr) id,descr,topiccolor  
-                       from    topic 
+               $qs = "select distinct on (descr) id,descr,topiccolor
+                       from    topic
                        where   id in ( select topicid from event where visable = 't' )
                        order by descr;";
                if( $result = $this->DB->db_auto_get_data($qs) )
@@ -301,12 +301,12 @@ class GLM_EVENTS extends GLM_TEMPLATE{
                        }
                        $out .= '</div>';
                }
-               $month_qs = "SELECT 
+               $month_qs = "SELECT
                        DISTINCT        bdate
                        FROM            event
                        WHERE           visable = 't'
                        AND             edate >= CURRENT_DATE
-                       ORDER BY        bdate;";        
+                       ORDER BY        bdate;";
 
                        $result = $this->DB->db_exec($month_qs);
                if( $_POST['month'] )
@@ -353,13 +353,13 @@ class GLM_EVENTS extends GLM_TEMPLATE{
                        <form action="'.$page.'#event" method="POST">';
                $out .= "By Month: <select name=\"month\">";
                //$out .= '<option value="">Show All Month</option>';
-               if(isset($emonths) && is_array($emonths)) 
+               if(isset($emonths) && is_array($emonths))
                {
-                       for(reset($emonths);$key=key($emonths);next($emonths)) 
+                       for(reset($emonths);$key=key($emonths);next($emonths))
                        {
                                $date = mktime(0,0,0,(integer)substr($key,0,2),1,substr($key,3,4));
                                $now = mktime(0,0,0,date("m"),1,date("Y"));
-                               if($date>=$now) 
+                               if($date>=$now)
                                {
                                        $out .= "<option value=\"$key\">";
                                        $m = substr( $key, 0, 2 );
@@ -436,7 +436,7 @@ class GLM_EVENTS extends GLM_TEMPLATE{
 
        /**
         * get_events:
-        * @param $type: 
+        * @param $type:
         * @uses BASE
         * @uses GLM_EVENT::get_event_search()
         * @uses GLM_EVENT::make_events()
@@ -512,16 +512,16 @@ class GLM_EVENTS extends GLM_TEMPLATE{
                        $qs="set datestyle to 'sql,us';";
                        $qs.= "select e.*,
                                t.descr as topicname
-                               from event e left outer join topic t on ( e.topicid = t.id ) 
-                               where ( reacur != 't' 
-                                               and e.visable = 't' 
-                                               and e.edate >= '$mydate' 
+                               from event e left outer join topic t on ( e.topicid = t.id )
+                               where ( reacur != 't'
+                                               and e.visable = 't'
+                                               and e.edate >= '$mydate'
                                                and e.bdate <= '$mydate')
-                               or (reacur = 't' 
-                                               and e.visable = 't' 
-                                               and e.edate >= '$mydate' 
+                               or (reacur = 't'
+                                               and e.visable = 't'
+                                               and e.edate >= '$mydate'
                                                and e.bdate <= '$mydate'
-                                               and e.daysow & $myDayOw = $myDayOw 
+                                               and e.daysow & $myDayOw = $myDayOw
                                   )
                                order by e.all_day desc,e.bdate,e.edate;";
                        $row=$this->DB->db_auto_get_data($qs);
@@ -549,7 +549,7 @@ class GLM_EVENTS extends GLM_TEMPLATE{
                                $out .= '<div class="clearer"></div>'."\n";
                                $out .= calendar($month,$year,2,$this->page_name.'?event=1&amp;month=',$this->page_name.'?eventid=1&month='.$month,$newdata);
                                //      $out .= '<div align="center"><a href="./">Back to Calendar</a></div>';
-                       }       
+                       }
                }
                else
                {
@@ -610,8 +610,8 @@ class GLM_EVENTS extends GLM_TEMPLATE{
                                        }
                                }
                        }
-                       if( $_POST['EventDateTo'] && $_POST['EventDateFrom'] 
-                                       && ( strtotime( $_POST['EventDateFrom'] )  != -1 ) 
+                       if( $_POST['EventDateTo'] && $_POST['EventDateFrom']
+                                       && ( strtotime( $_POST['EventDateFrom'] )  != -1 )
                                        && ( strtotime( $_POST['EventDateTo'] ) != -1 )
                                        )
                        {
@@ -653,7 +653,7 @@ class GLM_EVENTS extends GLM_TEMPLATE{
         * @uses GLM_TEMPLATE::get_event_date()
         * @uses GLM_EVENT::format_to_time()
         * @uses GLM_EVENT::keyword_replace()
-        * @param array $row The data array.  
+        * @param array $row The data array.
         * @return string
         **/
        function make_events($row)
@@ -748,17 +748,17 @@ class GLM_EVENTS extends GLM_TEMPLATE{
                        }
                        if($row[$i]['btime'])
                        {
-                               if($row[$i]['btime'] && $row[$i]['etime']) 
+                               if($row[$i]['btime'] && $row[$i]['etime'])
                                {
-                                       $time = $this->format_to_time($row[$i]['btime'])." to ".$this->format_to_time($row[$i]['etime'])."<br>";                
+                                       $time = $this->format_to_time($row[$i]['btime'])." to ".$this->format_to_time($row[$i]['etime'])."<br>";
                                }
-                               elseif($row[$i]['btime'] && !$row[$i]['etime']) 
+                               elseif($row[$i]['btime'] && !$row[$i]['etime'])
                                {
-                                       $time = "Time: ".$this->format_to_time($row[$i]['btime'])."<br>";               
+                                       $time = "Time: ".$this->format_to_time($row[$i]['btime'])."<br>";
                                }
-                               else 
+                               else
                                {
-                                       $time = "";             
+                                       $time = "";
                                }
                                $event.= '<div class="eventtime">'.$time.'</div>';
                        }
@@ -803,7 +803,7 @@ class GLM_EVENTS extends GLM_TEMPLATE{
                                        <img alt="'.$image.'" title="'.$image.'" src="'.MIDSIZED.$image.'">
                                        </div>
                                        ';
-                       }                               
+                       }
 
                        // Description
                        if( $row[$i]['descr'] )
@@ -887,33 +887,33 @@ class GLM_EVENTS extends GLM_TEMPLATE{
 
        /**
         * Grab the event row from database and return data array.
-        * @uses DB::db_auto_get_data 
+        * @uses DB::db_auto_get_data
         * @return array
         */
        function get_event_by_id($id)
        {
                // method fetches events based on event id
                /*
-                  id      | integer                    
-                  topicid | integer                    
-                  bdate   | date                       
-                  edate   | date                       
-                  loc     | text                       
-                  header  | text                       
-                  descr   | text                       
-                  img     | text                       
-                  url     | text                       
-                  contact | text                       
-                  phone   | text                       
-                  email   | text                       
-                  btime   | text                       
-                  etime   | text                       
-                  visable | boolean                    
-                  home    | boolean                    
+                  id      | integer
+                  topicid | integer
+                  bdate   | date
+                  edate   | date
+                  loc     | text
+                  header  | text
+                  descr   | text
+                  img     | text
+                  url     | text
+                  contact | text
+                  phone   | text
+                  email   | text
+                  btime   | text
+                  etime   | text
+                  visable | boolean
+                  home    | boolean
                   ds      | timestamp without time zone
-                  daysow  | integer                    
-                  reacur  | boolean                    
-                  weekom  | text                       
+                  daysow  | integer
+                  reacur  | boolean
+                  weekom  | text
                 */
                $query = "SET DATESTYLE TO 'SQL,US';
                SELECT          header,
@@ -933,15 +933,15 @@ class GLM_EVENTS extends GLM_TEMPLATE{
 
        /**
         * format_to_time:
-        * @param $time: 
-        * @return string 
+        * @param $time:
+        * @return string
         **/
        function format_to_time($time)
        {
                return($time);
 
                $timestamp = strtotime("today $time");
-               $newtime = date("g:i A",$timestamp); 
+               $newtime = date("g:i A",$timestamp);
                return($newtime);
        }
        /**#@-*/
index 555f0a6..00112e2 100755 (executable)
@@ -1,15 +1,15 @@
 <?php
-/** 
- * Toolbox Classes 
+/**
+ * Toolbox Classes
  * <p>
  * creates a contact form with an updatable fields array.
  * Don't set values in the var part only declare them.  If you set them their they will be like
  * defines and cannot be changed.  Setup in constructor function then there's no problem.
  * </p>
- * 
+ *
  * @package Toolbox
  * @subpackage Forms
- * @tutorial Toolbox/Forms/contact_form.cls 
+ * @tutorial Toolbox/Forms/contact_form.cls
  * @filesource
 */
 /**
@@ -21,23 +21,23 @@ include_once("class_db.inc");
 */
 include_once("class_toolbox.inc");
 /**
- * contact_form 
+ * contact_form
  * <p>
  * creates a contact form with an updatable fields array.
  * Don't set values in the var part only declare them.  If you set them their they will be like
  * defines and cannot be changed.  Setup in constructor function then there's no problem.
  * </p>
- * 
+ *
  * @package Toolbox
  * @subpackage Forms
  * @version $id$
  * @copyright 2005 Gaslight Media
- * @author Steve Sutton <steve@gaslightmedia.com> 
- * @license 
+ * @author Steve Sutton <steve@gaslightmedia.com>
+ * @license
  */
 class contact_form {
        /**
-        * DB_fields 
+        * DB_fields
         *
         * array for the needed fields
         * @var mixed
@@ -45,7 +45,7 @@ class contact_form {
         */
        var $DB_fields;
        /**
-        * CDB 
+        * CDB
         *
         * database object
         * @var mixed
@@ -53,97 +53,97 @@ class contact_form {
         */
        var $CDB;
        /**
-        * email 
+        * email
         * the email address. if blank will not send out
-        * 
+        *
         * @var mixed
         * @access public
         */
        var $email;
        /**
-        * table_name 
+        * table_name
         * database table name.
-        * 
+        *
         * @var mixed
         * @access public
         */
        var $table_name;
        /**
-        * styleLabel 
+        * styleLabel
         * css style for the label cell
-        * 
+        *
         * @var mixed
         * @access public
         */
        var $styleLabel;
        /**
-        * fieldcell 
+        * fieldcell
         * css style class for fieldcell
-        * 
+        *
         * @var mixed
         * @access public
         */
        var $fieldcell;
        /**
-        * contact_db 
+        * contact_db
         * weather or not they have database
-        * 
+        *
         * @var mixed
         * @access public
         */
        var $contact_db;
        /**
-        * instructioncell 
+        * instructioncell
         * style for the instruction cell
-        * 
+        *
         * @var mixed
         * @access public
         */
        var $instructioncell;
        /**
-        * subject 
+        * subject
         * Subject line of the E-mail
-        * 
+        *
         * @var mixed
         * @access public
         */
-       var $subject;           
+       var $subject;
        /**
-        * submit_value  
+        * submit_value
         * value for the submit button on form
-        * 
+        *
         * @var mixed
         * @access public
         */
        var $submit_value;
        /**
-        * subject 
+        * subject
         * the subject line for the email
-        * 
+        *
         * @var mixed
         * @access public
         */
        var $subject;
        /**
-        * not_interested 
-        * 
+        * not_interested
+        *
         * @var mixed
         * @access public
         */
        var $not_interested;
        /**
-        * contact_form 
-        * 
+        * contact_form
+        *
         * @access public
         * @return void
         */
        function contact_form()
        {
-               $this->CDB =& new GLM_DB(CONN_STR);                                     // creates DB object    
+               $this->CDB =& new GLM_DB(CONN_STR);                                     // creates DB object
                $this->set_DB_fields();                                         // set up the DB_fields array (configuration)
                $this->set_int_array();                                         // interest array
                $this->email = OWNER_EMAIL;                                     // email address for mail function
-               $this->table_name = 'contact';                          // the contact table 
+               $this->table_name = 'contact';                          // the contact table
                $this->styleLabel = "labelcell";                        // css style for the labelcell
                $this->fieldcell = "fieldcell";                         // css style for the field input
                $this->instructioncell = "instructioncell"; // css style for the field input
@@ -155,8 +155,8 @@ class contact_form {
 
        /**
        * get_form: one function to rule them all
-        * 
-        * @return void 
+        *
+        * @return void
         * @access public
         **/
        function get_form()
@@ -177,8 +177,8 @@ class contact_form {
 
        /**
         * set_DB_fields:
-        * 
-        * @return void 
+        *
+        * @return void
         * @access public
         **/
        function set_DB_fields()
@@ -198,7 +198,7 @@ class contact_form {
                $DB_fields[]=array('name'=>'verify_email','title' => 'Verify Email:','type' => 'text',  'vtype'=>'email',       'req'=>1,       'inst'=>$Einst);
 //             $DB_fields[]=array('name'=>'phone',             'title' => 'Phone:',    'type' => 'text',               'vtype'=>'phone');
 //             $DB_fields[]=array('name'=>'fax',               'title' => 'Fax:',              'type' => 'text',               'vtype'=>'phone');
-//             $DB_fields[]=array('name'=>'comments',  'title' => 'Comments:', 'type' => 'desc'); 
+//             $DB_fields[]=array('name'=>'comments',  'title' => 'Comments:', 'type' => 'desc');
                $wAbout = array(''=>'Choose One','Billboard'=>'Billboard','Print_Advertising'=>'Print Advertising','Radio_Advertisement'=>'Radio Advertisement','Search_Engine'=>'Search Engine','Other_Web_Site'=>'Other Web Site','Other'=>'Other');
                $DB_fields[]=array('name'=>'whereabout','title' => 'How did you hear about alpenacvb.com?', 'type'=>'drop','drop'=>$wAbout);
                $DB_fields[]=array('name'=>'mailok',    'title' => 'Put me on the Alpena CVB mailing list:','type' => 'radio');
@@ -206,12 +206,12 @@ class contact_form {
 //             $DB_fields[]=array('name'=>'interest',  'title' => 'Interest:','type' => 'interest');
                $DB_fields[]=array('name'=>'interest',  'val' => ':2:','type' => 'hide');
                $DB_fields[]=array('name'=>'subject','val'=> 'Visitors Guide Request' ,'type' => 'hide');
-               $this->DB_fields = &$DB_fields; 
+               $this->DB_fields = &$DB_fields;
        }
 
        /**
         * set_int_array:
-        * 
+        *
         * @return void
         * @access public
         **/
@@ -237,34 +237,34 @@ class contact_form {
 
        /**
         * interest:
-        * @param $field: 
-        * 
+        * @param $field:
+        *
         * @return void
         * @access public
         **/
        function interest($field)
-       {               
+       {
                foreach( $this->int_array as $key => $value )
                {
                        $out .= '<label for="int'.$key.'"><input type="checkbox" id="int'.$key.'" name="interest[]" value="'.$key.'"';
                        if( strpos( $field, (string)$key ) )
                        {
-                               $out .= ' checked';                             
+                               $out .= ' checked';
                        }
-                       $out .= '>'.$value.'</label>';          
-               }               
+                       $out .= '>'.$value.'</label>';
+               }
                return( $out );
        }
 
        /**
        * display_form: shows the form and any errors in it
-        * @param $error = NULL: error array  
-        * 
+        * @param $error = NULL: error array
+        *
         * @return string $out
         * @access public
         **/
        function display_form($error=NULL)
-       {                       
+       {
                if(is_array($_POST))
                {
                        foreach($_POST as $k=>$v)
@@ -302,7 +302,7 @@ class contact_form {
                                        if($value['req'])
                                        {
                                                $out .= '</span>';
-                                       }       
+                                       }
                                        $out .= '</label></td>
                                                ';
                                        $out .= '<td class="'.$field.'">';
@@ -326,7 +326,7 @@ class contact_form {
                                        if($value['req'])
                                        {
                                                $out .= '</span>';
-                                       }       
+                                       }
                                        $out .= '</label></td>
                                                <td class="'.$field.'">
                                                <input id="'.$value["name"].'" name="'.$value["name"].'" value="'.$_POST[$value["name"]].'" maxlength="50">';
@@ -420,7 +420,7 @@ class contact_form {
                                        {
                                                $cols=' cols="'.$value['cols'].'"';
                                        }
-                                       
+
                                        $out .= '<tr';
                                        $out .= ( $error[$value['name']] ) ? ' class="req"' : '';
                                        $out .= '><td colspan="2">'.$value[title].'
@@ -465,7 +465,7 @@ class contact_form {
                                        }
                                $out .= '</tr>';
                                break;
-                               
+
                                case "drop":
                                        $out .= '<tr';
                                        $out .= ( $error[$value['name']] ) ? ' class="req"' : '';
@@ -482,7 +482,7 @@ class contact_form {
                                $out .= '</tr>';
                                break;
                        }
-               }               
+               }
                $submit_val = ( $this->submit_value != '' ) ? $this->submit_value : 'Send';
                $out .= '<tr align="center"><td colspan="2"><input type="submit" name="Command" value="'.$submit_val.'"></td></tr>';
                $out .= '</table>';
@@ -491,8 +491,8 @@ class contact_form {
        }
 
        /**
-        * get_db_fields 
-        * 
+        * get_db_fields
+        *
         * @access public
         * @return void
         */
@@ -519,9 +519,9 @@ class contact_form {
        }
 
        /**
-        * check_valid_fields 
+        * check_valid_fields
         * validates the fields based on vtype in DB_fields array
-        * 
+        *
         * @access public
         * @return void
         */
@@ -594,8 +594,8 @@ class contact_form {
        /**
        * form_process: process the form checking for any required form values as set up in the
        * DB_fields array.
-        * 
-        * @return error array if bad 
+        *
+        * @return error array if bad
         * @access public
         **/
        function form_process()
@@ -605,7 +605,7 @@ class contact_form {
                $ban_words[] = "mime-version";
                $ban_words[] = "cc\:";
                $ban_words[] = "bcc\:";
-               
+
                if(is_array($_POST))
                {
                        foreach($_POST as $k=>$v)
@@ -630,7 +630,7 @@ class contact_form {
                                }
                        }
                }
-               
+
                $in_fields[] = 'contact_type';
                $in_vars[] = '2';
                $in_fields[] = 'create_date';
@@ -672,7 +672,7 @@ class contact_form {
                                        $zipDB->dbname = 'zip_v2';
                                        $zipDB->user = 'nobody';
                                        $zipDB->conn = 0;
-                                       if( $res = $zipDB->db_auto_get_data( $query ) ) 
+                                       if( $res = $zipDB->db_auto_get_data( $query ) )
                                        {
                                                if( count( $res ) == 0 )
                                                {
@@ -749,12 +749,12 @@ class contact_form {
                                {
                                        if( $db_interest_field )
                                        {
-                                               $interest_string = ereg_replace("^:|:$","",$_POST['interest']);
+                                               $interest_string = preg_replace("%^:|:$%","",$_POST['interest']);
                                                if( $interest_string )
                                                {
                                                        $interest_array = explode(":",$interest_string);
                                                }
-                                               $f_int_string = ereg_replace("^:|:$","",$cData[0][$db_interest_field]);
+                                               $f_int_string = preg_replace("%^:|:$%","",$cData[0][$db_interest_field]);
                                                if( $f_int_string )
                                                {
                                                        $f_int_array = explode(":",$f_int_string);
@@ -825,7 +825,7 @@ class contact_form {
                                {
                                        $invars = implode("','",$in_vars);
                                }
-                               $query = "INSERT INTO ".$this->table_name." 
+                               $query = "INSERT INTO ".$this->table_name."
                                        ($infds)
                                        VALUES
                                        ('$invars')";
@@ -847,12 +847,12 @@ class contact_form {
                        color: black;
                        font-family: verdana, arial, helvetica, sans-serif;
                        }
-               h1, h2 {font-family: arial, helvetica, sans-serif;}     
+               h1, h2 {font-family: arial, helvetica, sans-serif;}
                h1 {font-size: 18px; }
                h2 {font-size: 16px; margin-bottom: 5px;}
                p {font-size: 12px;}
                .label {
-                       font-weight: bold; 
+                       font-weight: bold;
                        background-color: transparent;
                        text-align: right;
                        width: 200px;
@@ -863,33 +863,33 @@ class contact_form {
                        background-color: #fff;
                        padding: 3px;
                        }
-               table.data { 
-                       //background-color: #F9FBFD; 
-                       background-color: #fff; 
-                       color: #000; 
-                       width: 500px;  
-                       //border: 1px solid #D7E5F2; 
-                       border: 1px solid #ccc; 
-                       border-collapse: collapse; 
+               table.data {
+                       //background-color: #F9FBFD;
+                       background-color: #fff;
+                       color: #000;
+                       width: 500px;
+                       //border: 1px solid #D7E5F2;
+                       border: 1px solid #ccc;
+                       border-collapse: collapse;
                        margin-left: 20px;
                        }
-               table.data td { 
-                       //border: 1px solid #D7E5F2; 
-                       border: 1px solid #ccc; 
-                       padding-left: 4px; 
+               table.data td {
+                       //border: 1px solid #D7E5F2;
+                       border: 1px solid #ccc;
+                       padding-left: 4px;
                        font-size: 12px;
-                       }       
+                       }
                -->
 </style><body>
-               
+
 <h1>'.$this->subject.'</h1>
 <h2>From  '.(($_POST["fname"])?' '.$_POST["fname"].'':'').' '.(($_POST["lname"])?' '.$_POST["lname"].'':'').'</h2>
 <h2>Information</h2>
-<table class="data">   
+<table class="data">
                                ';
                        if( $_POST['interest'] )
                        {
-                               $interest = ereg_replace( "^:|:$","",$_POST['interest'] );
+                               $interest = preg_replace( "%^:|:$%","",$_POST['interest'] );
                                $_POST['interest'] = explode(":",$interest);
                        }
                        foreach($this->DB_fields as $key=>$value)
@@ -942,7 +942,7 @@ class contact_form {
                        $_POST['lname'] = stripslashes(str_replace(",","",$_POST['lname']));
                        $headers = "From: ".SITENAME." <".FROM_NEWS_EMAIL.">\n"
                                . "Reply-To:  ".$_POST['fname']." ".$_POST['lname']." <".$_POST['email'].">\n"
-                        .  "MIME-Version: 1.0\n" 
+                        .  "MIME-Version: 1.0\n"
                         .  "Content-type: text/html; charset=iso-8859-1";
 
                        $body .= '
index 45f9e9e..df7a24b 100755 (executable)
@@ -357,7 +357,7 @@ class package extends GLM_TOOLBOX
             {
                 $pars = implode("&",$params);
             }
-            $this->return_page = $GLOBALS["PHP_SELF"].'?Action=Voucher+Reciepts&error='.implode("|",$error_ar).'&'.$pars;
+            $this->return_page = $_SERVER["PHP_SELF"].'?Action=Voucher+Reciepts&error='.implode("|",$error_ar).'&'.$pars;
             return( false );
         }
         // when approving package_numbers for ferry boat vouchers
@@ -380,7 +380,7 @@ class package extends GLM_TOOLBOX
         }
         $out = $this->ferry_vouchers();
         $out .= '<div><p>Updated Records</p></div>';
-        //$this->return_page = $GLOBALS["PHP_SELF"].'?Action=Ferry+Vouchers';
+        //$this->return_page = $_SERVER["PHP_SELF"].'?Action=Ferry+Vouchers';
         return( $out );
     }
 
@@ -388,7 +388,7 @@ class package extends GLM_TOOLBOX
     {
         if( is_array( $this->ferry_members ) )
         {
-            $out .= '<form method="post" action="'.$GLOBALS['PHP_SELF'].'">
+            $out .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'">
                 <fieldset id="package-search">
                     <legend>Package Members (ferry lines)</legend>
                     <p><input type="hidden" name="Action" value="Approve Vouchers"></p>
@@ -425,7 +425,7 @@ class package extends GLM_TOOLBOX
         // listing of ferry member vouchers and inputbutton
         if( is_array( $this->ferry_members ) )
         {
-            $out .= '<div class="buttons"><form action="'.$GLOBALS['PHP_SELF'].'">
+            $out .= '<div class="buttons"><form action="'.$_SERVER['PHP_SELF'].'">
                 <fieldset id="package-search">
                     <legend>Package Members (ferry lines)</legend>
                     <p><input type="hidden" name="Action" value="List Vouchers"></p>
@@ -433,7 +433,7 @@ class package extends GLM_TOOLBOX
                     <p>'.GLM_TOOLBOX::build_picklist('ferry',$this->ferry_members,$_GET['ferry'],'standard').'</p>
                     <br clear="all">
                     <p><button><img alt="list Vouchers" src="'.BASE_URL.'admin/icons/application_view_list.png">List Vouchers</button></p>
-                    <p><a href="'.$GLOBALS['PHP_SELF'].'?Action=Voucher+Reciepts"><img alt="Assign Vouchers" src="'.BASE_URL.'admin/icons/add.png">Assign Vouchers</a></p>
+                    <p><a href="'.$_SERVER['PHP_SELF'].'?Action=Voucher+Reciepts"><img alt="Assign Vouchers" src="'.BASE_URL.'admin/icons/add.png">Assign Vouchers</a></p>
                 </fieldset>
                 </form>';
         }
index 7f90dec..befe2c3 100755 (executable)
@@ -1,55 +1,55 @@
 <?php
 require_once(BASE."classes/class_db.inc");
-require_once(BASE."classes/class_toolbox.inc");        
-require_once(BASE."classes/class_template.inc");       
-require_once(BASE."classes/class_administrator.inc");  
-require_once(BASE."classes/class_form_creator.inc");   
+require_once(BASE."classes/class_toolbox.inc");
+require_once(BASE."classes/class_template.inc");
+require_once(BASE."classes/class_administrator.inc");
+require_once(BASE."classes/class_form_creator.inc");
 /**
- * glm_member 
- * 
+ * glm_member
+ *
  * @uses GLM
  * @uses _TOOLBOX
  * @package Toolbox
  * @version $id$
  * @copyright 2007 Gaslight Media
- * @author Steve Sutton <steve@gaslightmedia.com> 
- * @license 
+ * @author Steve Sutton <steve@gaslightmedia.com>
+ * @license
  */
-class ticket_inv extends GLM_TOOLBOX 
+class ticket_inv extends GLM_TOOLBOX
 {
        /**
-        * DB 
-        * 
+        * DB
+        *
         * @var mixed
         * @access public
         */
        var $DB;
        /**
-        * content 
-        * 
+        * content
+        *
         * @var mixed
         * @access public
         */
        var $content;
        /**
-        * toolbox 
-        * 
+        * toolbox
+        *
         * @var mixed
         * @access public
         */
        var $toolbox;
        /**
-        * administrator 
-        * 
+        * administrator
+        *
         * @var mixed
         * @access public
         */
        var $administrator;
        /**
-        * glm_member 
-        * 
-        * @param mixed $DB 
-        * @param mixed $config 
+        * glm_member
+        *
+        * @param mixed $DB
+        * @param mixed $config
         * @access public
         * @return string
         */
@@ -60,8 +60,8 @@ class ticket_inv extends GLM_TOOLBOX
        }
 
        /**
-        * get_member_list 
-        * 
+        * get_member_list
+        *
         * @access public
         * @return string
         */
@@ -92,10 +92,10 @@ class ticket_inv extends GLM_TOOLBOX
                        return( 'failed to delete ticket' );
                }
        }
-       
+
        function edit_ticket_inv( $member_id, $ticket_id, $id = null )
        {
-               $GLOBALS['PHP_SELF'] = 'test.php';
+               $_SERVER['PHP_SELF'] = 'test.php';
                $query = "select *,to_char(date,'MM/DD/YYYY') as date  from ticket_inventory where id = $id";
                if( $data = $this->DB->db_auto_get_data( $query ) )
                {
@@ -129,7 +129,7 @@ class ticket_inv extends GLM_TOOLBOX
 
        function add_ticket_inv( $member_id, $ticket_id )
        {
-               $GLOBALS['PHP_SELF'] = 'test.php';
+               $_SERVER['PHP_SELF'] = 'test.php';
                // unset the id field (this should be the first array element)
                unset( $this->administrator->fields[0] );
                $data['member_id'] = $member_id;
@@ -155,6 +155,6 @@ class ticket_inv extends GLM_TOOLBOX
                {
                        return( 'Your Record is Added' );
                }
-       }       
+       }
 }
 ?>
index 4bcbcff..de3e470 100755 (executable)
@@ -1,16 +1,16 @@
 <?php
-/** 
+/**
  *     Toolbox Classes :)
- * 
+ *
  *     <p>
  * These classes and any code is not licensed for anyone but gaslight to use
  * {@link http://www.gaslightmedia.com www.gaslightmedia.com}
  *     </p>
  *
- * @package Toolbox 
+ * @package Toolbox
  * @tutorial Toolbox/Toolbox.pkg
  * @filesource
- * 
+ *
  */
 /**
  *     Toolbox Class :)
  *     <p>class.  This is so we can eventially move everything to one siteinfo.inc file.</p>
  *  <kbd>matrix@devsys Does this work?</kbd>
  *
- *     @package Toolbox 
+ *     @package Toolbox
  *     @author $Author: matrix $
  *     @copyright 2005
  *     @version $Revision: 1.5 $
  *     @since $Date: 2013/08/30 14:38:21 $
- * 
+ *
  *     @todo move all functions from setup.phtml into here
  */
-class GLM_TOOLBOX 
+class GLM_TOOLBOX
 {
        /** @var array php_version */
        var $php_version;
@@ -36,8 +36,8 @@ class GLM_TOOLBOX
        var $php_old_pg;
 
        /**
-        * GLM_TOOLBOX 
-        * 
+        * GLM_TOOLBOX
+        *
         * @access public
         * @return void
         */
@@ -48,8 +48,8 @@ class GLM_TOOLBOX
        }
 
        /**
-        * get_season 
-        * 
+        * get_season
+        *
         * @access public
         * @return string
         */
@@ -86,35 +86,35 @@ class GLM_TOOLBOX
                return( $season );
        }
        /**
-        * make_teaser 
-        * 
-        * @param mixed $text 
-        * @param mixed $maxlength 
-        * @param mixed $strip_tags 
+        * make_teaser
+        *
+        * @param mixed $text
+        * @param mixed $maxlength
+        * @param mixed $strip_tags
         * @access public
         * @return string
         */
        function make_teaser($text, $maxlength, $strip_tags=FALSE)
        {
                if($strip_tags)
-               { 
-                       $text = strip_tags($text); 
+               {
+                       $text = strip_tags($text);
                }
                if(strlen($text) > $maxlength)
-               {     
+               {
                        $pos = strpos($text, ' ', $maxlength);
                        $text = substr($text, 0, $pos);
                }
                return $text;
        }
        /**
-        * make_data_table 
-        * 
+        * make_data_table
+        *
         * @param mixed $data    array of data to put into table
         * @param mixed $tableId id for table
         * @param mixed $headers table header names
         * @param mixed $param   extra parameters to pass through
-        * 
+        *
         * @access public
         * @return string
         */
@@ -166,8 +166,8 @@ class GLM_TOOLBOX
                return $table;
        }
        /**
-        * create_sitemap 
-        * 
+        * create_sitemap
+        *
         * @access public
         * @return string
         */
@@ -186,9 +186,9 @@ class GLM_TOOLBOX
                }
        }
        /**
-        * template_read 
-        * 
-        * @param mixed $template 
+        * template_read
+        *
+        * @param mixed $template
         * @access public
         * @return string
         */
@@ -207,10 +207,10 @@ class GLM_TOOLBOX
                }
        }
        /**
-        * explode_template 
-        * 
-        * @param mixed $template 
-        * @param mixed $data 
+        * explode_template
+        *
+        * @param mixed $template
+        * @param mixed $data
         * @access public
         * @return string
         */
@@ -223,10 +223,10 @@ class GLM_TOOLBOX
 
        }
        /**
-        * template_replacement 
-        * 
-        * @param mixed $template 
-        * @param mixed $fieldarr 
+        * template_replacement
+        *
+        * @param mixed $template
+        * @param mixed $fieldarr
         * @access public
         * @return string
         */
@@ -249,8 +249,8 @@ class GLM_TOOLBOX
                return $template;
        }
        /**
-        * php_version_check 
-        * 
+        * php_version_check
+        *
         * @access public
         * @return void
         */
@@ -261,10 +261,10 @@ class GLM_TOOLBOX
        }
 
        /**
-        * php_old_pg 
-        * 
+        * php_old_pg
+        *
         * <p>after php 4.2 they changed the pg_ functions for postgres </p>
-        * 
+        *
         * @access public
         * @return void
         */
@@ -295,10 +295,10 @@ class GLM_TOOLBOX
         *
         * <p>$options array is $options = array( 'href'=>'', 'text'=>'', 'title'=>'',
         *      'onMouseover'=>'', 'onMouseout'=>'','id'=>'' );</p>
-        * @param $options : an array 
-        * 
-        * @return string for the hyper link 
-        * @access public 
+        * @param $options : an array
+        *
+        * @return string for the hyper link
+        * @access public
         **/
        function create_href( $options )
        {
@@ -327,47 +327,47 @@ class GLM_TOOLBOX
         * @param string $Num: Credit Card Number
         * @param string $Name = '': Type of Card
         * @param array $Accepted='' : Accepted array
-        * 
-        * @return bool 
-        * @access public 
+        *
+        * @return bool
+        * @access public
         **/
-       function CreditVal($Num, $Name = '', $Accepted='') 
-       { 
+       function CreditVal($Num, $Name = '', $Accepted='')
+       {
                $Name = strtolower( $Name );
                $Accepted = strtolower( $Accepted );
                $GoodCard = 1;
-               $Num = ereg_replace("[^[:digit:]]", "", $Num); 
-               switch ($Name) 
-               { 
+               $Num = preg_replace("%[^[:digit:]]%", "", $Num);
+               switch ($Name)
+               {
 
-                       case "mastercard" : 
-                               $GoodCard = ereg("^5[1-5].{14}$", $Num); 
-                       break; 
+                       case "mastercard" :
+                               $GoodCard = preg_match("%^5[1-5].{14}$%", $Num);
+                       break;
 
-                       case "visa" : 
-                               $GoodCard = ereg("^4.{15}$|^4.{12}$", $Num); 
-                       break; 
+                       case "visa" :
+                               $GoodCard = preg_match("%^4.{15}$|^4.{12}$%", $Num);
+                       break;
 
-                       case "americanexpress" : 
-                               $GoodCard = ereg("^3[47].{13}$", $Num); 
-                       break; 
+                       case "americanexpress" :
+                               $GoodCard = preg_match("%^3[47].{13}$%", $Num);
+                       break;
 
-                       case "discover" : 
-                               $GoodCard = ereg("^6011.{12}$", $Num); 
-                       break; 
+                       case "discover" :
+                               $GoodCard = preg_match("%^6011.{12}$%", $Num);
+                       break;
 
-                       case "dinerscard" : 
-                               $GoodCard = ereg("^30[0-5].{11}$|^3[68].{12}$", $Num); 
+                       case "dinerscard" :
+                               $GoodCard = preg_match("%^30[0-5].{11}$|^3[68].{12}$%", $Num);
                        break;
 
                        default:
-                       if( ereg("^5[1-5].{14}$", $Num) ) $Name = "mastercard";
-                       if( ereg("^4.{15}$|^4.{12}$", $Num) ) $Name = "visa";
-                       if( ereg("^3[47].{13}$", $Num) ) $Name = "americanexpress";
-                       if( ereg("^6011.{12}$", $Num) ) $Name = "discover";
-                       if( ereg("^30[0-5].{11}$|^3[68].{12}$", $Num) ) $Name="dinerscard";
+                       if( preg_match("%^5[1-5].{14}$%", $Num) ) $Name = "mastercard";
+                       if( preg_match("%^4.{15}$|^4.{12}$%", $Num) ) $Name = "visa";
+                       if( preg_match("%^3[47].{13}$%", $Num) ) $Name = "americanexpress";
+                       if( preg_match("%^6011.{12}$%", $Num) ) $Name = "discover";
+                       if( preg_match("%^30[0-5].{11}$|^3[68].{12}$%", $Num) ) $Name="dinerscard";
                        break;
-               } 
+               }
 
                // If there's a limit on card types we accept, check for it here.
                if( $Accepted )
@@ -383,41 +383,41 @@ class GLM_TOOLBOX
                        }
                        if( !$type_verified ) return(FALSE);
                }
-               $Num = strrev($Num); 
-               $Total = 0; 
-               for ($x=0; $x<strlen($Num); $x++) 
-               { 
-                       $digit = substr($Num,$x,1); 
-                       if ($x/2 != floor($x/2)) 
-                       { 
-                               $digit *= 2; 
-                               if (strlen($digit) == 2)  
+               $Num = strrev($Num);
+               $Total = 0;
+               for ($x=0; $x<strlen($Num); $x++)
+               {
+                       $digit = substr($Num,$x,1);
+                       if ($x/2 != floor($x/2))
+                       {
+                               $digit *= 2;
+                               if (strlen($digit) == 2)
                                {
-                                       $digit = substr($digit,0,1) + substr($digit,1,1); 
+                                       $digit = substr($digit,0,1) + substr($digit,1,1);
                                }
-                       } 
-                       $Total += $digit; 
-               } 
-               if ($GoodCard && $Total % 10 == 0) 
+                       }
+                       $Total += $digit;
+               }
+               if ($GoodCard && $Total % 10 == 0)
                {
-                       return(true); 
+                       return(true);
                }
-               else 
+               else
                {
-                       return(false); 
+                       return(false);
                }
        }
 
        /**
-        * html_error :Generates a footer table on the bottom of the page it's called on.       
+        * html_error :Generates a footer table on the bottom of the page it's called on.
         * and closes out the body and html tags.
         * @param string $msg: string error message to be displayed
         * @param boolean $bail : bool whether or not to exit() after $msg
-        * 
-        * @return void 
-        * @access public 
+        *
+        * @return void
+        * @access public
         **/
-       function html_error($msg, $bail) 
+       function html_error($msg, $bail)
        {
                echo '<div style="color:red;"><pre>'.$msg.'</pre></div>';
                if($bail)
@@ -427,14 +427,14 @@ class GLM_TOOLBOX
        }
 
        /**
-        * html_nav_table 
-        * 
-        * @param mixed $nav 
-        * @param mixed $w 
+        * html_nav_table
+        *
+        * @param mixed $nav
+        * @param mixed $w
         * @access public
         * @return void
         */
-       function html_nav_table($nav, $w) 
+       function html_nav_table($nav, $w)
        {
                if( is_array( $nav ) )
                {
@@ -442,7 +442,7 @@ class GLM_TOOLBOX
                        foreach( $nav as $link => $url )
                        {
                                $out .= '<li';
-                               if( strstr( $GLOBALS['PHP_SELF'], $url ) )
+                               if( strstr( $_SERVER['PHP_SELF'], $url ) )
                                {
                                        $out .= ' class="selected"';
                                }
@@ -454,16 +454,16 @@ class GLM_TOOLBOX
        }
 
        /**
-        * html_header :Opens up the html tags, and includes the style sheet link                       
+        * html_header :Opens up the html tags, and includes the style sheet link
         generates a header table on the top of the page it's called on.
-        * @param string $title: Page Title 
-        * @param string $msg: message to display 
+        * @param string $title: Page Title
+        * @param string $msg: message to display
         * @param string $img : image to display
-        * 
-        * @return void 
-        * @access public 
+        *
+        * @return void
+        * @access public
         **/
-       function html_header($title, $msg, $img) 
+       function html_header($title, $msg, $img)
        {
                $header_table_width = "400";
                $header_table_align = "center";
@@ -478,7 +478,7 @@ class GLM_TOOLBOX
                        <table width="<?echo $header_table_width?>" align="<?echo $header_table_align?>" summary="Header Information" class="headertable" cellspacing="0" cellpadding="3">
                        <tr class="headertr">
                        <td class="headertd">';
-               if($img) 
+               if($img)
                {
                        echo '<img src="<?echo IMG_BASE.$img?>" alt="<?echo HEAD?>" border="0">';
                }
@@ -493,22 +493,22 @@ class GLM_TOOLBOX
        }
 
        /**
-        * form_header :Opens up the form tag, and includes the hidden assoc array as hidden    
+        * form_header :Opens up the form tag, and includes the hidden assoc array as hidden
         fields.
         * @param string $action: string form action string
         * @param string $method: string Method of form
         * @param string $hidden = "" : assoc array with $hidden($name => $value)
-        * 
-        * @return void 
-        * @access public 
+        *
+        * @return void
+        * @access public
         **/
-       function form_header($action, $method, $hidden = "") 
+       function form_header($action, $method, $hidden = "")
        {
-               echo "<form action=\"$action\" method=\"$method\" 
+               echo "<form action=\"$action\" method=\"$method\"
                        enctype=\"multipart/form-data\">";
-               if($hidden != "" && is_array($hidden)) 
-               {               
-                       foreach($hidden as $key=>$value) 
+               if($hidden != "" && is_array($hidden))
+               {
+                       foreach($hidden as $key=>$value)
                        {
                                echo "<input type=\"hidden\" name=\"$key\" value=\"$value\">";
                        }
@@ -522,13 +522,13 @@ class GLM_TOOLBOX
         * @param int $rows = 15: int4 number of rows in textarea box
         * @param int $cols = 50: int4 number of cols in textarea box
         * @param string $wrap = "virtual"  : string the wrap value for the textarea box
-        * 
-        * @return void 
-        * @access public 
+        *
+        * @return void
+        * @access public
         **/
-       function text_area($name, $value, $rows = 15, $cols = 50, $wrap = "virtual" ) 
+       function text_area($name, $value, $rows = 15, $cols = 50, $wrap = "virtual" )
        {
-               echo "<td class=\"navtd2\"><textarea id=\"$name\" name=\"$name\" cols=\"$cols\" 
+               echo "<td class=\"navtd2\"><textarea id=\"$name\" name=\"$name\" cols=\"$cols\"
                        rows=\"$rows\" wrap=\"$wrap\">$value</textarea></td>";
        }
 
@@ -537,13 +537,13 @@ class GLM_TOOLBOX
         * @param string $name: string name of text box
         * @param string $value: string value of text box
         * @param int $size = 35 : string size of text box
-        * 
-        * @return void 
-        * @access public 
+        *
+        * @return void
+        * @access public
         **/
-       function text_box($name, $value, $size = 35) 
+       function text_box($name, $value, $size = 35)
        {
-               echo "<td class=\"navtd2\"><input type=\"text\" name=\"$name\" 
+               echo "<td class=\"navtd2\"><input type=\"text\" name=\"$name\"
                        value=\"".htmlspecialchars($value)."\" size=\"$size\"></td>";
        }
 
@@ -551,16 +551,16 @@ class GLM_TOOLBOX
         * form_footer :Closes up the form tag, and includes the submit button
         * @param string $name: string form action string
         * @param boolean $suppress = 0: string Method of form
-        * @param int $cs : int colspan for td 
-        * 
-        * @return void 
-        * @access public 
+        * @param int $cs : int colspan for td
+        *
+        * @return void
+        * @access public
         **/
-       function form_footer($name, $suppress = 0, $cs) 
+       function form_footer($name, $suppress = 0, $cs)
        {
                echo "<tr><td colspan=\"$cs\" align=center>
                        <input type=\"SUBMIT\" name=\"Command\" value=\"$name\">";
-               if($suppress == 1) 
+               if($suppress == 1)
                {
                        echo "<input type=\"SUBMIT\" name=\"Command\" value=\"Delete\">";
                }
@@ -569,35 +569,35 @@ class GLM_TOOLBOX
        }
 
        /**
-        * process_image 
-        * NOTES:                                                               
-        * This function does the following:                       
+        * process_image
+        * NOTES:
+        * This function does the following:
         *
-        * 1) places image into original folder                    
+        * 1) places image into original folder
         *
         * 2) makes three images from original size and places them
         * into the RESIZED, MIDSIZED, and THUMB folders
-        * 
-        * @param mixed $image 
-        * @param mixed $image_name 
+        *
+        * @param mixed $image
+        * @param mixed $image_name
         * @access public
         * @return string
         */
-       function process_image( $image, $image_name ) 
+       function process_image( $image, $image_name )
        {
-               if(!defined("ORIGINAL_PATH")) 
+               if(!defined("ORIGINAL_PATH"))
                {
                        GLM_TOOLBOX::html_error("this not defined original_path",1);
                }
-               if(!defined("RESIZED_PATH")) 
+               if(!defined("RESIZED_PATH"))
                {
                        GLM_TOOLBOX::html_error("this not defined resized_path",1);
                }
-               if(!defined("MIDSIZED_PATH")) 
+               if(!defined("MIDSIZED_PATH"))
                {
                        GLM_TOOLBOX::html_error("this not defined midsized_path",1);
                }
-               if(!defined("THUMB_PATH")) 
+               if(!defined("THUMB_PATH"))
                {
                        GLM_TOOLBOX::html_error("this not defined thumb_path",1);
                }
@@ -611,18 +611,18 @@ class GLM_TOOLBOX
        }
 
        /**
-        * img_resize 
+        * img_resize
         * resized based on imagick widthxheight given
         * to scale by maxwidth of 280 use '280>'
-        * which will keep it from making image larger 
-        * 
-        * @param mixed $path2image 
-        * @param mixed $path2thumb 
-        * @param mixed $size 
+        * which will keep it from making image larger
+        *
+        * @param mixed $path2image
+        * @param mixed $path2thumb
+        * @param mixed $size
         * @access public
         * @return string
         */
-       function img_resize( $path2image, $path2thumb, $size ) 
+       function img_resize( $path2image, $path2thumb, $size )
        {
                exec( "which convert", $output, $return );
                if( $return == 0 )
@@ -643,37 +643,37 @@ class GLM_TOOLBOX
        }
 
        /**
-        * img_upload 
+        * img_upload
         * simplified to use the file_upload function with restricted set to true
         * which will return an array instead of string (as in files)
         * and only allow png,gif,jpg images to be uploaded
-        * 
-        * @param mixed $form_field 
-        * @param mixed $img_name 
-        * @param mixed $destination_path 
+        *
+        * @param mixed $form_field
+        * @param mixed $img_name
+        * @param mixed $destination_path
         * @access public
         * @return string
         */
-       function img_upload( $form_field, $img_name, $destination_path ) 
+       function img_upload( $form_field, $img_name, $destination_path )
        {
                return( file_upload( $form_field, $img_name, $destination_path, true ) );
        }
 
        /**
         * file_upload
-        * this will replace the older version and that of img_upload which calls this with extra 
-        * restricted of true 
-        * 
-        * @param mixed $form_field 
-        * @param mixed $file_name 
-        * @param mixed $destination_path 
+        * this will replace the older version and that of img_upload which calls this with extra
+        * restricted of true
+        *
+        * @param mixed $form_field
+        * @param mixed $file_name
+        * @param mixed $destination_path
         * @access public
         * @return string
         */
-       function file_upload( $form_field, $file_name, $destination_path, $restricted = false ) 
+       function file_upload( $form_field, $file_name, $destination_path, $restricted = false )
        {
                $file_name_in_use = false;
-               $file_name = ereg_replace( "[!@#$%^&()+={};:\'\"\/ ]", "-", $file_name );
+               $file_name = preg_replace( "%[!@#$\%^&()+={};:\'\"\/ ]%", "-", $file_name );
                if( $restricted )
                {
                        $size = getImageSize( $form_field );
@@ -693,7 +693,7 @@ class GLM_TOOLBOX
                {
                        $file_name_in_use = true;
                }
-               if( $file_name_in_use == true ) 
+               if( $file_name_in_use == true )
                {
                        $new_file_name = mktime().$file_name;
                        $new_file_location = $destination_path.$new_file_name;
@@ -701,7 +701,7 @@ class GLM_TOOLBOX
                        $file_upload = $new_file_name;
                        $file_upload_array = array( $new_file_name, $new_file_location );
                }
-               else 
+               else
                {
                        $new_file_name = $file_name;
                        $new_file_location = $destination_path.$new_file_name;
@@ -728,28 +728,28 @@ class GLM_TOOLBOX
        /**
         * http_strip :Strips the http:// part from start of string
         * @param string $string : $string
-        * 
+        *
         * @return string $stirng minus http:// in front
-        * @access public 
+        * @access public
         **/
-       function http_strip(&$string) 
+       function http_strip(&$string)
        {
                $test_string = strtolower($string);
-               if(substr($test_string,0,7) == "http://") 
+               if(substr($test_string,0,7) == "http://")
                {
                        $string = substr($string,7);
                }
        }
 
        /**
-        * footer 
-        * 
-        * used for admin page footer to close out the top function 
-        * 
+        * footer
+        *
+        * used for admin page footer to close out the top function
+        *
         * @access public
         * @return void
         */
-       function footer() 
+       function footer()
        {
                $out = '
                        </body>
@@ -758,28 +758,28 @@ class GLM_TOOLBOX
        }
 
        /**
-        * top 
-        * 
+        * top
+        *
         * Output the starting html and admin table tags
-        * 
-        * @param mixed $message 
-        * @param mixed $hp 
-        * @param mixed $hp2 
+        *
+        * @param mixed $message
+        * @param mixed $hp
+        * @param mixed $hp2
         * @access public
         * @return void
         */
-       function top($message, $hp,$hp2 = NULL) 
+       function top($message, $hp,$hp2 = NULL)
        {
                if($hp2 != "")
                {
                        $help_guide = '<div id="glm-manual">';
                        /*
                           $help_guide = '<div id="glm-manual"><a id="manual-html"
-                          href="http://www.gaslightmedia.com/manuals/html/'.$hp2.'.html" 
+                          href="http://www.gaslightmedia.com/manuals/html/'.$hp2.'.html"
                           target="_blank">Online Help Guide</a>&nbsp;';
                         */
                        $help_guide .= '<a id="manual-pdf"
-                               href="http://www.gaslightmedia.com/manuals/pdf/'.$hp2.'.pdf" 
+                               href="http://www.gaslightmedia.com/manuals/pdf/'.$hp2.'.pdf"
                                target="_blank">Printable Help Guide</a></div>';
                }
                $out = '
@@ -818,25 +818,25 @@ YAHOO.example.init();
 </script>
                        </head>
                        <body>
-                       <h1>'.$message.'</h1>   
+                       <h1>'.$message.'</h1>
                        '.$help_guide.'
                        ';
                echo $out;
        }
 
        /**
-        * top2 
-        * 
+        * top2
+        *
         * top2 : alias to top()
-        * 
-        * @param mixed $message 
-        * @param mixed $hp 
-        * @param mixed $hp2 
+        *
+        * @param mixed $message
+        * @param mixed $hp
+        * @param mixed $hp2
         * @uses GLM_TOOLBOX::top()
         * @access public
         * @return void
         */
-       function top2($message, $hp,$hp2 = NULL) 
+       function top2($message, $hp,$hp2 = NULL)
        {
                // make this an alias to top()
                // by calling top instead of adding extra code
@@ -849,9 +849,9 @@ YAHOO.example.init();
         * MUST BE CALLED AFTER TEXTAREAS ON PAGE
         * @param $$w = 570: width of htmlarea in px
         * @param $$h = 400: height of htmlarea in px
-        * 
+        *
         * @return void
-        * @access 
+        * @access
         **/
        function htmlcode( $w = 570, $h = 400, $textarea = array('description') )
        {
@@ -859,7 +859,7 @@ YAHOO.example.init();
                        <style type="text/css">
                        /*<![CDATA[*/
                        <!--
-                       .textarea { height: '.$h.'px; width: '.$w.'px; } 
+                       .textarea { height: '.$h.'px; width: '.$w.'px; }
                -->
                        /*]]>*/
                        </style>
@@ -943,7 +943,7 @@ YAHOO.example.init();
                                        }
                                        echo ', "htmlmode", "separator",
                                                 "copy", "cut", "paste", "space", "undo", "redo" ]
-                                                        ];     
+                                                        ];
                                        ';
                                        if( HTMLAREA_CONTEXT_MENU == true )
                                        {
@@ -957,7 +957,7 @@ YAHOO.example.init();
                                                echo '
 
                                                        // register the TableOperations plugin
-                                                       editor_'.$htmlarea.'.registerPlugin(TableOperations); 
+                                                       editor_'.$htmlarea.'.registerPlugin(TableOperations);
                                                ';
                                        }
                                        if( HTMLAREA_CHARACTER_MAP == true )
@@ -965,7 +965,7 @@ YAHOO.example.init();
                                                echo '
 
                                                        // register the CharacterMap plugin
-                                                       editor_'.$htmlarea.'.registerPlugin(CharacterMap); 
+                                                       editor_'.$htmlarea.'.registerPlugin(CharacterMap);
                                                ';
                                        }
                                        echo '
@@ -974,49 +974,49 @@ YAHOO.example.init();
                                }
 
                                echo '
-                       } 
+                       }
                function addEvent(obj, evType, fn)
-               { 
-                       if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } 
-                       else if (obj.attachEvent) {  var r = obj.attachEvent("on"+evType, fn);  return r;  } 
-                       else {  return false; } 
-               } 
+               {
+                       if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; }
+                       else if (obj.attachEvent) {  var r = obj.attachEvent("on"+evType, fn);  return r;  }
+                       else {  return false; }
+               }
                addEvent(window, \'load\', initdocument);
                //]]>
-               </script>       
+               </script>
                        ';
        }
 
        /**
         * date_entry : Generate the select boxes for date entry
         * month-day-year as drop down select
-        * @param mixed $month: 
-        * @param mixed $day: 
-        * @param mixed $year: 
-        * @param mixed $month_name: name of select month 
-        * @param mixed $day_name: name of select day 
+        * @param mixed $month:
+        * @param mixed $day:
+        * @param mixed $year:
+        * @param mixed $month_name: name of select month
+        * @param mixed $day_name: name of select day
         * @param mixed $year_name : name of select year
-        * 
+        *
         * @return string
-        * @access public 
+        * @access public
         **/
-       function date_entry($month,$day,$year,$month_name,$day_name,$year_name) 
+       function date_entry($month,$day,$year,$month_name,$day_name,$year_name)
        {
                $cur_date = getdate();
-               if( $month == "" ) 
+               if( $month == "" )
                {
                        $month = $cur_date['mon'];
                }
-               if( $day == "" ) 
+               if( $day == "" )
                {
                        $day = $cur_date['mday'];
-               }       
-               if($year == "") 
+               }
+               if($year == "")
                {
                        $year = $cur_date['year'];
                }
                $date = '<select name="'.$month_name.'">';
-               for($i=1;$i<13;$i++) 
+               for($i=1;$i<13;$i++)
                {
                        $date .= '<option value="';
                        if($i < 10)
@@ -1024,73 +1024,73 @@ YAHOO.example.init();
                                $date .= "0";
                        }
                        $date .= $i.'"';
-                       if($i == $month) 
+                       if($i == $month)
                        {
                                $date .= ' selected';
                        }
-                       $date .= '>'.$i.'</option>';    
+                       $date .= '>'.$i.'</option>';
                }
                $date .= '</select>';
                $date .= '<select name="'.$day_name.'">';
-               for($i=1;$i<32;$i++) 
+               for($i=1;$i<32;$i++)
                {
                        $date .= '<option value="';
-                       if($i < 10) 
+                       if($i < 10)
                        {
                                $date .= "0";
                        }
                        $date .= $i.'"';
-                       if($i == $day) 
+                       if($i == $day)
                        {
                                $date .= ' selected';
                        }
-                       $date .= '>'.$i.'</option>';    
-               }       
+                       $date .= '>'.$i.'</option>';
+               }
                $date .= '</select>';
                $date .= '<select name="'.$year_name.'">';
-               for($i=2000;$i<2023;$i++) 
+               for($i=2000;$i<2023;$i++)
                {
                        $date .= '<option value="'.$i.'"';
-                       if($i == $year) 
+                       if($i == $year)
                        {
                                $date .= ' selected';
                        }
                        $date .= '>'.$i.'</option>';
                }
                $date .= '</select>';
-               return $date;   
-       }       
+               return $date;
+       }
 
        /**
         * contact_date_entry : build select boxes for date entry going backwords in years
-        * @param mixed $month: 
-        * @param mixed $day: 
-        * @param mixed $year: 
+        * @param mixed $month:
+        * @param mixed $day:
+        * @param mixed $year:
         * @param mixed $month_name: name of select month
         * @param mixed $day_name: name of select day
         * @param mixed $year_name : name of select year
-        * 
+        *
         * @return void
-        * @access public 
+        * @access public
         **/
-       function contact_date_entry($month,$day,$year,$month_name,$day_name,$year_name) 
+       function contact_date_entry($month,$day,$year,$month_name,$day_name,$year_name)
        {
                $cur_date = getdate();
 
-               if($month == "") 
+               if($month == "")
                {
                        $month = $cur_date['mon'];
                }
-               if($day == "") 
+               if($day == "")
                {
                        $day = $cur_date['mday'];
-               }       
-               if($year == "") 
+               }
+               if($year == "")
                {
                        $year = $cur_date['year'];
                }
                $date = '<select name="'.$month_name.'">';
-               for($i=1;$i<13;$i++) 
+               for($i=1;$i<13;$i++)
                {
                        $date .= '<option value="';
                        if($i < 10)
@@ -1098,35 +1098,35 @@ YAHOO.example.init();
                                $date .= "0";
                        }
                        $date .= $i.'"';
-                       if($i == $month) 
+                       if($i == $month)
                        {
                                $date .= ' selected';
                        }
-                       $date .= '>'.$i.'</option>';    
+                       $date .= '>'.$i.'</option>';
                }
                $date .= '</select>';
                $date .= '<select name="'.$day_name.'">';
-               for($i=1;$i<32;$i++) 
+               for($i=1;$i<32;$i++)
                {
                        $date .= '<option value="';
-                       if($i < 10) 
+                       if($i < 10)
                        {
                                $date .= "0";
                        }
                        $date .= $i.'"';
-                       if($i == $day) 
+                       if($i == $day)
                        {
                                $date .= ' selected';
                        }
-                       $date .= '>'.$i.'</option>';    
-               }       
+                       $date .= '>'.$i.'</option>';
+               }
                $date .= '</select>';
                $date .= '<select name="'.$year_name.'">';
                $ystart = $cur_date['year'] - 10;
-               for($i=$ystart;$i<=$year;$i++) 
+               for($i=$ystart;$i<=$year;$i++)
                {
                        $date .= '<option value="'.$i.'"';
-                       if($i == $year) 
+                       if($i == $year)
                        {
                                $date .= ' selected';
                        }
@@ -1137,37 +1137,37 @@ YAHOO.example.init();
        }
 
        /**
-        * time_entry 
-        * 
+        * time_entry
+        *
         * build select boxes for time entry
-        * 
-        * @param mixed $H 
-        * @param mixed $m 
-        * @param mixed $F 
-        * @param mixed $H_name 
-        * @param mixed $m_name 
-        * @param mixed $F_name 
+        *
+        * @param mixed $H
+        * @param mixed $m
+        * @param mixed $F
+        * @param mixed $H_name
+        * @param mixed $m_name
+        * @param mixed $F_name
         * @access public
         * @return void
         */
-       function time_entry( $H, $m, $F, $H_name, $m_name, $F_name ) 
+       function time_entry( $H, $m, $F, $H_name, $m_name, $F_name )
        {
                $cur_date = getdate();
-               if($H == "") 
+               if($H == "")
                {
                        $H = $cur_date['hours'];
                }
-               if($m == "") 
+               if($m == "")
                {
                        $m = $cur_date['minutes'];
-               }       
-               if($H>12) 
+               }
+               if($H>12)
                {
                        $F = "PM";
                        $H = $H - 12;
                }
                $time = "Hr:<select name=\"$H_name\" size=\"1\">";
-               for($i=1;$i<=12;$i++) 
+               for($i=1;$i<=12;$i++)
                {
                        $time .= "<option value=\"";
                        if($i < 10)
@@ -1175,43 +1175,43 @@ YAHOO.example.init();
                                $time .= "0";
                        }
                        $time .= "$i\"";
-                       if($i == $H) 
+                       if($i == $H)
                        {
                                $time .= " selected";
                        }
-                       $time .= ">$i\n";       
+                       $time .= ">$i\n";
                }
                $time .= "</select>\n";
                $time .= "Min:<select name=\"$m_name\" size=\"1\">";
-               for($i=0;$i<60;$i=$i+15) 
+               for($i=0;$i<60;$i=$i+15)
                {
                        $time .= "<Option value=\"";
-                       if($i < 10) 
+                       if($i < 10)
                        {
                                $time .= "0";
                        }
                        $time .= "$i\"";
-                       if($i == $m) 
+                       if($i == $m)
                        {
                                $time .= " selected";
                        }
                        $time .= ">";
-                       if($i < 10) 
+                       if($i < 10)
                        {
                                $time .= "0";
                        }
-                       $time .= "$i\n";        
-               }       
+                       $time .= "$i\n";
+               }
                $time .= "</select>";
                $time .= "<select name=\"$F_name\" size=\"1\">";
                $time .= "<option value=\"AM\"";
-               if($F == "AM") 
+               if($F == "AM")
                {
                        $time .= " selected";
                }
                $time .= ">AM\n";
                $time .= "<option value=\"PM\"";
-               if($F == "PM") 
+               if($F == "PM")
                {
                        $time .= " selected";
                }
@@ -1221,11 +1221,11 @@ YAHOO.example.init();
        }
 
        /**
-        * get_parentid 
-        * 
+        * get_parentid
+        *
         * get the (highest level) parent category for this id
-        * 
-        * @param mixed $id 
+        *
+        * @param mixed $id
         * @access public
         * @return void
         */
@@ -1234,12 +1234,12 @@ YAHOO.example.init();
                static $parentshow;
                if( $id == 0 )
                {
-                       return( 0 );            
+                       return( 0 );
                }
                if(!is_array($parentshow))
                {
                        $qs = "select parent from bus_category where id = $id";
-                       $parentrow = GLM_TOOLBOX::db_auto_get_data( $qs );        
+                       $parentrow = GLM_TOOLBOX::db_auto_get_data( $qs );
                }
                if($parentrow[0]['parent'] == 0)
                {
@@ -1252,16 +1252,16 @@ YAHOO.example.init();
        }
 
        /**
-        * build_picklist 
-        * 
+        * build_picklist
+        *
         * Builds a pick list from an array
-        * 
-        * @param mixed $fieldname 
-        * @param mixed $data 
-        * @param mixed $selected 
-        * @param string $type 
-        * @param int $auto 
-        * @param mixed $width 
+        *
+        * @param mixed $fieldname
+        * @param mixed $data
+        * @param mixed $selected
+        * @param string $type
+        * @param int $auto
+        * @param mixed $width
         * @access public
         * @return void
         */
@@ -1287,7 +1287,7 @@ YAHOO.example.init();
                {
                        case "multiple":
                                $str = "<select name=\"".$fieldname."\" multiple size=\"10\" ".$autosubmit.">\n";
-                       while( list($key, $val) = each($data) ) 
+                       while( list($key, $val) = each($data) )
                        {
                                if( in_array($key,$sel) )
                                {
@@ -1300,7 +1300,7 @@ YAHOO.example.init();
                        break;
                        case "simple":
                                $str = "<select name=\"$fieldname\" ".$autosubmit.">\n";
-                       for( $i=0 ; $i<count($data) ; $i++ ) 
+                       for( $i=0 ; $i<count($data) ; $i++ )
                        {
                                $select = (in_array($data[$i],$sel)) ? " selected ":"";
                                $str .= "       <option value=\"".$data[$i]."\"".$select.">".$data[$i]."</option>\n";
@@ -1310,7 +1310,7 @@ YAHOO.example.init();
                        case "standard":
                        default:
                                $str = "<select name=\"$fieldname\" ".$autosubmit.">\n";
-                               while( list($key, $val) = each($data) ) 
+                               while( list($key, $val) = each($data) )
                                {
                                        $select = (in_array($key,$sel)) ? " selected ":"";
 
@@ -1326,29 +1326,29 @@ YAHOO.example.init();
        }
 
        /**
-        * create_page_links:Create prev and next links 
+        * create_page_links:Create prev and next links
         * to page through the results.
         * @param mixed $totalnum: The total result of the query
         * @param mixed $num: The total result for the page
         * @param mixed $start=0: The starting num defaults to 0
         * @param mixed $params: variables to add to the url
         * @param mixed $ENTRIES_PER_PAGE: number of items on page defaults to the ENTRIES_PER_PAGE
-        * 
-        * @return string of links 
-        * @access public 
+        *
+        * @return string of links
+        * @access public
         **/
        function create_page_links($totalnum,$num,$start=0,$params,$page_length=ENTRIES_PER_PAGE)
        {
                // FIND out which page we're on.
                if($totalnum!=0)
-               {  
-                       $total_pages = floor($totalnum / $page_length);         // total pages = the total result divided by page length rounded down 
+               {
+                       $total_pages = floor($totalnum / $page_length);         // total pages = the total result divided by page length rounded down
                        $total_pages++;                                                                         // then add one
                        if($start == 0)                                                                         // if start is 0 then page is one
                        {
-                               $page = 1;                                                                              
+                               $page = 1;
                        }
-                       else    
+                       else
                        {
                                $page = ($start / $page_length) + 1;
                        }
@@ -1362,28 +1362,28 @@ YAHOO.example.init();
                {
                        $end = $totalnum;
                }
-               $last = $start - $page_length;  
+               $last = $start - $page_length;
                if(($start - $page_length) < 0)
                {
                        $prev = "";
                }
-               else    
+               else
                {
                        $prev = "<span class=\"accenttext\">[</span><a class=\"small\"
-                               href=\"$GLOBALS[PHP_SELF]?start=".$last."&$params\">PREVIOUS PAGE</a><span
+                               href=\"$_SERVER[PHP_SELF]?start=".$last."&$params\">PREVIOUS PAGE</a><span
                                class=\"accenttext\"> ]</span>";
                }
                if($end < $totalnum)
                {
                        $next = "<span class=\"accenttext\">[</span><a class=\"small\"
-                               href=\"$GLOBALS[PHP_SELF]?start=".$end."&$params\">NEXT PAGE</a><span
+                               href=\"$_SERVER[PHP_SELF]?start=".$end."&$params\">NEXT PAGE</a><span
                                class=\"accenttext\"> ]</span>";
                }
-               else    
+               else
                {
                        $next = "";
                }
-               $starting = $start + 1; 
+               $starting = $start + 1;
                $last_c = $start + $num;
                if( $last_c > $end )
                {
@@ -1391,23 +1391,23 @@ YAHOO.example.init();
                }
                $links = '<center><span class="pagetitle">Listings Displayed: </span><span
                        class="accenttext">'.$starting.' to '.$last_c.'</span>
-                       <span class="pagetitle"> of '.$totalnum.'<br></span> '.$prev. ' &nbsp; <span 
-                       class="pagetitle"></span> '.$next.'<BR></span></center>';       
+                       <span class="pagetitle"> of '.$totalnum.'<br></span> '.$prev. ' &nbsp; <span
+                       class="pagetitle"></span> '.$next.'<BR></span></center>';
                return($links);
        }
 
        /**
-        * valid_email 
+        * valid_email
         * Checks for a valid format and good (mx check) email address.
-        * 
-        * @param mixed $email 
+        *
+        * @param mixed $email
         * @access public
         * @return void
         */
-       function valid_email($email) 
+       function valid_email($email)
        {
                // First, we check that there's one @ symbol, and that the lengths are right
-               if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) 
+               if (!preg_match("%^[^@]{1,64}@[^@]{1,255}$%", $email))
                {
                        // Email invalid because wrong number of characters in one section, or wrong number of @ symbols.
                        return false;
@@ -1415,24 +1415,24 @@ YAHOO.example.init();
                // Split it into sections to make life easier
                $email_array = explode("@", $email);
                $local_array = explode(".", $email_array[0]);
-               for ($i = 0; $i < sizeof($local_array); $i++) 
+               for ($i = 0; $i < sizeof($local_array); $i++)
                {
-                       if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) 
+                       if (!preg_match("%^(([A-Za-z0-9!#$\%&'*+/=?^_`{|}~-][A-Za-z0-9!#$\%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$%", $local_array[$i]))
                        {
                                return false;
                        }
-               }  
-               if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) 
-               { 
+               }
+               if (!preg_match("%^\[?[0-9\.]+\]?$%", $email_array[1]))
+               {
                        // Check if domain is IP. If not, it should be valid domain name
                        $domain_array = explode(".", $email_array[1]);
-                       if (sizeof($domain_array) < 2) 
+                       if (sizeof($domain_array) < 2)
                        {
                                return false; // Not enough parts to domain
                        }
-                       for ($i = 0; $i < sizeof($domain_array); $i++) 
+                       for ($i = 0; $i < sizeof($domain_array); $i++)
                        {
-                               if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) 
+                               if (!preg_match("%^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$%", $domain_array[$i]))
                                {
                                        return false;
                                }
@@ -1443,7 +1443,7 @@ YAHOO.example.init();
 
        function send_html_email( $to, $subject, $body, $headers )
        {
-               if( !ereg("\n$",$headers) ) {
+               if( !preg_match("%\n$%",$headers) ) {
                        $headers .= "\n";
         }
 
index f264b25..16264f0 100755 (executable)
@@ -58,7 +58,7 @@ else
 // min date for packages is May 15th (fort closed before this)
 $min_date = date("n/j/Y",$min_time);
 // max date for packages is Sep 30th (fort closed after this)
-$max_time = mktime(0,0,0,9,30,date('Y'));
+$max_time = mktime(0,0,0,12,30,date('Y'));
 $max_date = date("n/j/Y",$max_time);
 $cal_set = ',pagedate: "'.$page_date.'",mindate: "'.$min_date.'",maxdate: "'.$max_date.'"';
 $fields[] = array('name'=>'cday','type'=>'hide');