"People", 'TITLE' => "People", 'MODULENAME' => "people.phpx", 'NAV1' => "INFO" // Level 1 menu navigation group ); //------------------------------------------------------------------------ // Local configuration parameters //------------------------------------------------------------------------ $PEOPLECFG = array ( 'ADMINLEVEL' => '6', 'EDITLEVEL' => '5', ); global $PEOPLECFG; //------------------------------------------------------------------------ // Database Fields //------------------------------------------------------------------------ $NEWFIELD = array( 'first_name', 'last_name', 'nickname', 'gender', 'primary_phone', 'mobile_phone', 'email_1', 'home_city', 'home_zip', ); $ALLFIELD = array( 'people_id', 'full_name', 'gender', 'first_name', 'last_name', 'nickname', 'people_occupation', 'people_status', 'home_street', 'home_city', 'home_state', 'home_zip', 'home_country', 'partner_id', 'partner_type', //'latitude', //'longitude', 'email_1', 'people_source', 'referred_by', 'primary_phone', 'mobile_phone', 'headshot_url', 'people_notes', ); // // Fields visible in query output list // $SHOW = array( 'full_name', 'gender', 'partner_id', 'people_status', 'home_city', ); if ($_SESSION['access_level'] >= $PEOPLECFG['ADMINLEVEL'] ) { $SHOW[] = 'people_id'; // DEVONLY } // // Fields that can have query drill down links on display // $LINK = array( 'people_type', 'people_status', 'gender', 'home_city', 'home_zip', ); // // Fields that are from a Menu Picklist // $EXTEND = array( 'people_type', 'people_status', 'people_source', ); // // Required for New Entry // $RequiredField = array( 'first_name' => 'enter first name', 'last_name' => 'enter last name', 'email_1' => 'enter primary email', 'people_type' => 'select type or category of new person', 'people_status' => 'select status of new person', 'gender' => 'select gender', 'home_city' => 'enter city in which you live', 'home_zip' => 'enter postal zip code where you live', ); // // Global query choices // $InValidChoice = array( 'All', '', ' ', 'None', 'Choose' ); // // Edit record fields with edit disabled // $NoEdit = array( 'people_id', 'last_updated', 'latitude', 'longitude', ); $FieldType = array( 'birth_month' => 'Menu', 'birth_day' => 'Menu', 'people_notes' => 'TextArea', 'people_occupation' => 'LongText', 'headshot_url' => 'LongText', 'email_1' => 'LongText', 'email_2' => 'LongText', 'partner_id' => 'MenuArray', 'partner_type' => 'Menu', 'gender' => 'Menu', 'people_type' => 'Menu', 'people_status' => 'Menu', 'people_source' => 'Menu', ); $BASE = "SELECT choice FROM menu WHERE table_name = 'people' AND "; $Menu = array( "birth_month" => "$BASE field_name = 'birth_month' ORDER BY choice", "birth_day" => "$BASE field_name = 'birth_day' ORDER BY choice", "gender" => "$BASE field_name = 'gender' ORDER BY choice", "partner_type" => "$BASE field_name = 'partner_type' ORDER BY choice", "partner_id" => "SELECT people_id, full_name from people order by full_name", "people_source" => "$BASE field_name = 'people_source' ORDER BY choice", "people_status" => "$BASE field_name = 'people_status' ORDER BY choice", "people_type" => "$BASE field_name = 'people_type' ORDER BY choice", ); // // Display exceptions from default tdcs centered display table cell // $JustifyCss = array( 'email_1' => 'tds', 'home_street' => 'tds', 'home_city' => 'tds', 'full_name' => 'tds', 'home_city' => 'tds', 'people_type' => 'tds', ); //------------------------------------------------------------------------ // BEGIN Program //------------------------------------------------------------------------ spew_header($FMT); if (array_key_exists('Action', $_REQUEST)) { echo "
\n"; // DEVONLY print_r($_REQUEST); // DEVONLY echo "\n"; // DEVONLY //---------------------------------------------------------------------- // Delete //---------------------------------------------------------------------- if ($_REQUEST['Action'] == "Delete") { if ( array_key_exists('people_id', $_REQUEST)) { if ( isset($_REQUEST['people_id'] ) ) { $people_id = stripslashes( $_REQUEST['people_id']); }else{ die ("NO People ID in delete function.") ; } if ( ! is_numeric($people_id) ) { die ("People ID ($people_id) is not an integer.") ; } }else{ die ("No People Id Set") ; } $dbh = jjn_pdo_connect(); if ($people_id < 101){ die("People ID out of range\n"); } // // Fetch Name // $sql = "SELECT full_name from people where people_id = $people_id"; echo "
$sql
\n"; // DEVONLY $name = get_value($sql); echo "$sql
\n"; // DEVONLY run_sql($sql); $sql = "DELETE from access where people_id = $people_id"; echo "$sql
\n"; // DEVONLY run_sql($sql); $_REQUEST = array(); $_REQUEST['Action'] = "List"; }// Endsub Delete //---------------------------------------------------------------------- // Insert New Entry //---------------------------------------------------------------------- if ($_REQUEST['Action'] == "Insert New Entry With Website Login" || $_REQUEST['Action'] == "Insert New Entry" ) { $dbh = jjn_pdo_connect(); echo "Insert Entry
\n"; // DEVONLY $pcnt = count($_POST); $rcnt = count($_REQUEST); echo "Request Count is greater that one, $rcnt
\n"; // DEVONLY echo "Post Count is greater that one, $pcnt
\n"; // DEVONLY echo "Session of captcha_keystring is $_SESSION[captcha_keystring]
\n"; // DEVONLY echo "Post of keystring is $_POST[keystring]
\n"; // DEVONLY echo "Request of keystring is $_REQUEST[keystring]
\n"; // DEVONLY // CAPTCHA if( count($_REQUEST) > 1 ){ if(isset($_SESSION['captcha_keystring']) && $_SESSION['captcha_keystring'] === $_REQUEST['keystring']){ echo "Excellent, you are a human!
"; }else{ echo "The numbers from the captcha box do match those in the image.";
echo "
Please press the back button and try again.\n";
echo "
No Data
"; spew_footer($FMT); exit; } // // Get list of fields for this table // $fieldlabel = get_field_labels('people','people',$JJNCFG['DBNAME']); $fields = array_keys($fieldlabel); $fieldlabel['dob'] = 'Birth Date (YYYY-MM-DD)'; $fieldlabel['people_height'] = 'Height in inches
|
$sql
\n"; // DEVONLY $dbh->query($sql); $people_id = $dbh->lastInsertId() ; if ( is_numeric($people_id) && $people_id > 100 ){ $_REQUEST['people_id'] = $people_id; echo "Returned People ID of $_REQUEST[people_id]\n"; // DEVONLY echo "
Initialize User Preferences
\n"; // DEVONLY init_mypreference($people_id); // // Add Access entry for website login // if ($_REQUEST['Action'] == "Insert New Entry With Website Login"){ $login = strtolower($_REQUEST['first_name']) . '.' . strtolower($_REQUEST['last_name']); $today = date('Y-m-d'); $sql = "SELECT allcal_id from allcal where calendar_date >= '$today' order by allcal_id LIMIT "; $sql .= $JJNCFG['NEWPASSWDEXP']; echo "$sql
\n"; // DEVONLY $days = array(); $days = get_menu($sql); $idx = max($days); $sql = "SELECT calendar_date from allcal where allcal_id = $idx"; echo "$sql
\n"; // DEVONLY $expdate = get_value($sql); $sql = "INSERT INTO access ( people_id', metagroup_id', access_login', access_password',"; $sql .= " access_class', access_role', access_level', expiration_date') VALUES ("; $sql .= "$people_id, $people_id, '$login', "; $sql .= $dbh->quote($JJNCFG['GUESTPWENC']); $sql .= ",'Guest,'Guest',2,"; $sql .= $dbh->quote($expdate); echo "$sql
\n"; // DEVONLY $dbh->query($sql); $access_id = $dbh->lastInsertId(); echo "Success: Access ID: $access_id
\n"; // DEVONLY } $_REQUEST['Action'] = 'View'; } //---------------------------------------------------------------------- // Update Existing Entry //---------------------------------------------------------------------- if ($_REQUEST['Action'] == "Update" ) { spew_query_form(); if ( array_key_exists('people_id', $_REQUEST)) { $people_id = $_REQUEST['people_id']; if (! is_numeric( $people_id ) ) { die ("ERROR: Attempt to update People requires people_id to be integer. It is not."); } }else{ die ("No People Id Set. Unable to update") ; } if ($_SESSION['access_level'] <= $PEOPLECFG['EDITLEVEL'] ) { if ( $_SESSION['people_id'] != $_REQUEST['people_id'] ){ die("You only have permission to update your own information.\n"); } } echo "\n"; // DEVONLY
echo "Incoming\n"; // DEVONLY
print_r($_REQUEST); // DEVONLY
echo "\n"; // DEVONLY
$dbh = jjn_pdo_connect();
$today = date('Y-m-d H:i');
//
// Get Original Record
//
$Original = array();
$sql = "SELECT full_name from people where people_id = ";
$sql .= $dbh->quote($_SESSION['people_id']);
echo "$sql
\n"; // DEVONLY
$who = get_value($sql);
$sql = 'SELECT * FROM people WHERE people_id = ';
$sql .= $dbh->quote($people_id);
echo "$sql
\n"; // DEVONLY
$result = $dbh->query($sql);
$Original = $result->fetch(PDO::FETCH_ASSOC);
echo "Original
\n"; // DEVONLY
print_r($Original); // DEVONLY
//
// Get list of fields for this table
//
$fieldlabel = get_field_labels('people','aaaaaaaaaa',$JJNCFG['DBNAME']);
print ''; // DEBUG DEVONLY
echo "Incoming Updated Fields\n"; // DEBUG DEVONLY
print htmlspecialchars(print_r($fieldlabel), ENT_QUOTES); // DEBUG DEVONLY
print '
'; // DEBUG DEVONLY
$fields = array_keys($fieldlabel);
//
// Eliminate all keys that have invalid answers
// Overwrite entries with NEW_... entries for Open Menus
//
foreach ($fields as $f) {
$altkey = "NEW_" . $f;
if (isset($_REQUEST[$altkey])) {
if (!in_array($_REQUEST[$altkey], $InValidChoice)) {
$_REQUEST[$f] = $_REQUEST[$altkey];
unset ($_REQUEST[$altkey]);
}
}
if (in_array($_REQUEST[$f], $InValidChoice)) {
unset ($_REQUEST[$f]);
}
}
//
// Update only the fields that have changed
//
$DataKey = array();
$UpdateData = array();
$changelog = "Changed $today by $who ($_SESSION[people_id]):Skipping $f as it is in NoEdit array...
\n"; // DEVONLY continue; } if ( array_key_exists($f, $_REQUEST)) { $val = $_REQUEST[$f]; echo "For ... $f
\n"; // DEVONLY echo "Original: $Original[$f]
\n"; // DEVONLY echo "New: $_REQUEST[$f]
\n"; // DEVONLY if (preg_match('/_phone$/', $f)){ $oldpn = $_REQUEST[$f]; $_REQUEST[$f] = format_phone_number($_REQUEST[$f]) ; echo "Reformated phone number from $oldpn to $_REQUEST[$f]
\n"; // DEVONLY } if ( $_REQUEST[$f] != $Original[$f] ) { echo "Updating $f to $_REQUEST[$f]
\n"; // DEVONLY $key = $f; $UpdateData[] = "$key = " . $dbh->quote($_REQUEST[$f]); $changelog .= "$sql
\n"; // DEVONLY DEBUG $result = $dbh->query($sql); }else{ echo "At end of Update, Next Action is $_REQUEST[NextAction]
\n"; // DEVONLY $_REQUEST['Action'] = $_REQUEST['NextAction']; }else{ echo "At end of Update, NO Next Action
\n"; // DEVONLY $_REQUEST['Action'] = "View"; } } //---------------------------------------------------------------------- // Query or List //---------------------------------------------------------------------- if ($_REQUEST['Action'] == "Query" || $_REQUEST['Action'] == "List Partners" || $_REQUEST['Action'] == "List All" || $_REQUEST['Action'] == "Address List" || $_REQUEST['Action'] == "Email List" || $_REQUEST['Action'] == "Contact Roster" || $_REQUEST['Action'] == "Contact Info" || $_REQUEST['Action'] == "List" ) { echo "Entering Query/List Function
\n"; // DEVONLY if ($_SESSION['access_level'] >= $PEOPLECFG['EDITLEVEL'] ) { $SHOW[] = 'people_type'; } echo "\n"; // DEBUG DEVONLY print_r($_SESSION); // DEBUG DEVONLY echo "\n"; // DEBUG DEVONLY $dbh = jjn_pdo_connect(); $fieldlabel = array(); // // Base sql query // $What = array( 'p.*' ); $Where = array( 'p.people_id > 100' ); $From = array( 'people' => 'p' ); if ( $_REQUEST['Action'] == "Contact Info" ){ $SHOW[] = 'email_1'; $SHOW[] = 'primary_phone'; $SHOW[] = 'mobile_phone'; } if ( $_REQUEST['Action'] != "List All" ){ $Where[] = "p.people_status = 'Active'"; } if ( $_REQUEST['Action'] == "Address List" ){ $SHOW[] = 'home_street'; $SHOW[] = 'home_city'; $SHOW[] = 'home_state'; $SHOW[] = 'home_zip'; } if ( $_REQUEST['Action'] == "Email List" ){ $SHOW[] = 'email_1'; } if ($_REQUEST['event_id'] > 0 ){ $What[] = 'e.event_name'; $From['event'] = 'e'; $From['attend'] = 'a'; $Where[] = "a.event_id = " . $_REQUEST['event_id'] ; $Where[] = "a.people_id = p.people_id"; $Where[] = "a.event_id = e.event_id"; $esql = "SELECT event_name from event where event_id = " . $_REQUEST['event_id']; $event_attended = get_value($esql); } $Who = array(); $sql = "SELECT people_id, full_name from people"; if ( $_SESSION['access_level'] < $PEOPLECFG['ADMINLEVEL'] ) { $sql .= " WHERE people_type = 'Dancer'"; $Where[] = "people_type = 'Dancer'"; } $Who = get_menu_array($sql); $fieldlabel = get_field_labels('people','people',$JJNCFG['DBNAME']); $fields = array_keys($fieldlabel); //---------------------------------------------------------- // Capture previous selection criteria and append to links // To enable drill down subqueries //---------------------------------------------------------- foreach(explode( '&', $_SERVER['QUERY_STRING']) as $entry ) { list($key, $val) = explode( '=', $entry); if ( ! empty( $val ) ) { if (! in_array($val, $InValidChoice)) { if (in_array($key, $ALLFIELD) ) { $parameters[$key] = $val; } } } } $parameters['Action'] = $_REQUEST['Action']; //---------------------------------------------------------- // Uniquify for duplicate entries //---------------------------------------------------------- $validentries = array(); foreach ($parameters as $key => $val ) { $val = preg_replace('/\s+/', '+', $val); $validentries[] = $key . '=' . $val; } if (count($validentries)) { $drilldown = implode('&', $validentries); } // // Construct where clause into an array // foreach ($fields as $f) { if (array_key_exists($f, $_REQUEST)) { $val = $_REQUEST[$f]; if (in_array( $val, $InValidChoice ) ){ unset($val) ; }else{ if ( preg_match('/%/', $val)) { $_REQUEST[$f] .= '%'; $Where[] = "p." . $f . ' LIKE ' . $dbh->quote($_REQUEST[$f]); }else{ $Where[] = "p." . $f . "=" . $dbh->quote($_REQUEST[$f]); } } } } $sql = "SELECT DISTINCT " . implode(',', $What); $Fromsql = array(); foreach ($From as $table => $abbr) { $Fromsql[] = $table . ' ' . $abbr; } $Fromsql = array_unique($Fromsql); $sql .= ' FROM ' . implode(', ', $Fromsql); if ( count($Where) ) { $sql .= ' WHERE ' . implode(' AND ', $Where); } //--------------------------------------------------- // ORDER BY //--------------------------------------------------- $OrderBy = array( 'City' => 'p.home_city, p.full_name', 'First Name' => 'p.first_name, p.last_name', 'Last Name' => 'p.last_name, p.first_name', 'Email' => 'p.email_1, p.full_name', 'People Type' => 'p.people_type, p.full_name', 'Status' => 'p.people_status, p.full_name', 'Type' => 'p.people_type, p.full_name', 'Zip' => 'p.people_zip, p.people_city, p.full_name', ); $sortby = $_REQUEST['Sortmeby']; $sby = $OrderBy[$sortby]; if (empty ($sby)){ $sql .= ' ORDER BY p.full_name'; }else{ $sql .= ' ORDER BY ' . $sby; } echo "
$sql
\n"; // DEVONLY $result = $dbh->query($sql); $rowcount = $result->rowCount(); // Add synthetic names after query made $fields = array_keys($fieldlabel); // Blurb echo "\n";
if ($event_attended){
echo "List for those who attended $event_attended.
\n";
}
echo "Column entries that are links will "drill down" to refine your query.\n";
echo "Name links show contact details.\n";
echo "
Green shading in Status column indicates valid email on record.\n";
echo "
Query returned $rowcount " . ( $rowcount ==1 ? 'entry.' : 'entries.');
echo "
| Edit | \n"; // SECURITY } foreach ($ALLFIELD as $f) { if (in_array($f, $SHOW)) { echo "$fieldlabel[$f] | \n"; } } $row = array(); $oldcid = 0; $ccnt=0; $BGC = '#FFF'; while ($row = $result->fetch(PDO::FETCH_ASSOC)){ if (isset($row['latitude']) && isset($row['longitude'])){ $Map[] = $row['latitude'] . ',' . $row['longitude']; } echo "|||
|---|---|---|---|---|
";
echo "";
if ( $_REQUEST['Action'] == 'Contact Roster' ){
echo "";
}else{
echo " ";
}
echo " | \n";
}
foreach ($ALLFIELD as $f) {
$css = "tdcs";
$display = stripslashes($row[$f]);
$BGC = $BIGBGC;
//
// Display Exceptions (lookup)
//
if ( $f == 'full_name' ) {
$pid = $row['people_id'];
$display = "$row[$f]";
}
if ( $f == 'email_1' ) {
$em = $row[$f];
$display = "$em";
}
if (in_array($f, $SHOW)) {
if (array_key_exists($f, $JustifyCss)) {
$css = $JustifyCss[$f];
}
if ($f == 'people_status' ){
if (preg_match('/@/', $row['email_1']) ) {
echo ""; }else{ //echo " | "; // Pink for "bad dog" echo " | "; } }else{ echo " | ";
}
if (in_array($f, $LINK)) {
echo "";
echo "$display\n";
}else{
echo "$display\n";
}
echo " | \n";
}
}
}
echo "
\n"; echo "Enter entries. Details on meanings and choice details available via help links in left column.\n"; echo "Asterisk (*) indicates field is required.\n"; echo "
\n"; echo "Entering Show Function with ID of $_REQUEST[people_id]
\n"; // DEVONLY if ( array_key_exists('people_id', $_SESSION)) { if ( isset ( $_SESSION['people_id'] ) ) { $people_id = $_SESSION['people_id']; }else{ die ("No People ID in Show function") ; } if ( ! is_numeric($people_id) ) { die ("People ID ($people_id) is not an integer.") ; } }else{ die ("No People Id Set") ; } // // Get People roster for partner id // $Who = array(); $sql = "SELECT people_id, full_name from people"; $Who = get_menu_array($sql); $menulist = array(); $row = array(); $dbh = jjn_pdo_connect(); $sql = 'SELECT * FROM people WHERE people_id = '; $sql .= $dbh->quote($people_id); echo "$sql
\n"; // DEVONLY $result->query($sql); $row = $result->fetch(PDO::FETCH_ASSOC); $fieldlabel = get_field_labels('people','people',$JJNCFG['DBNAME']); // Blurb echo "\n"; echo "Field explanation available via link in left column field labels.\n"; echo "Change them by clicking Edit button at bottom of page.\n"; echo "
\n"; echo "| "; echo ""; echo "$label | \n"; echo "";
$display = stripslashes($row[$fieldname]);
//
// View Entry Lookup Map Translations (id -> othertable.name for foreign keys)
//
echo "$display "; echo " | \n";
echo "$display
Entering Edit Function
\n"; // DEVONLY if ( array_key_exists('people_id', $_REQUEST)) { if ( isset($_REQUEST['people_id'] ) ) { $people_id = stripslashes( $_REQUEST['people_id']); }else{ die ("NO People ID in edit function.") ; } if ( ! is_numeric($people_id) ) { die ("People ID ($people_id) is not an integer.") ; } if ( $people_id <= 100 ) { die ("People ID ($people_id) belongs to a special admin group and can not be edited via website.") ; } }else{ die ("No People Id Set") ; } $dbh = jjn_pdo_connect(); // // Hardwire to update my stuff unless I have admin privileges // if ( $_SESSION['access_level'] < $PEOPLECFG['EDITLEVEL'] ) { echo "You only have permission to edit your own information\n"; $_REQUEST['people_id'] = $_SESSION['people_id']; $NoEdit[] = 'people_status'; $NoEdit[] = 'headshot_url'; $NoEdit[] = 'people_source'; $NoEdit[] = 'people_type'; $NoEdit[] = 'latitude'; $NoEdit[] = 'longitude'; $NoEdit[] = 'headshot_url'; $NoShow = array( 'headshot_url', 'vaccination_record', 'headshot_url', 'people_id', 'people_source', 'latitude', 'longitude', 'alternate_email', 'home_country', ); } $menulist = array(); $Me = array(); $sql = "SELECT * FROM people WHERE people_id = '$people_id'"; echo "
$sql
\n"; // DEVONLY $result = $dbh->query($sql); $Me = $row = $result->fetch(PDO::FETCH_ASSOC); $Who = array(); $sql = "SELECT people_id, full_name from people where people_id > 100"; echo "$sql
\n"; // DEVONLY $Who = get_menu_array($sql); $fieldlabel = get_field_labels('people','people',$JJNCFG['DBNAME']); // Blurb echo "\n"; echo "Change desired entries and click Update at bottom of form.\n"; echo "
\n"; echo "| Change Personal Information | \n"; echo "Change Related Information | \n"; echo "
|---|
| \n"; // Submit action buttons at top of form echo "\n"; echo " | \n"; echo "
\n"; echo "
\n"; echo "\n"; if ( $_SESSION['access_level'] >= $PEOPLECFG['EDITLEVEL'] ) { show_journal_history($people_id, 'people'); } echo "$sql
\n"; // DEVONLY $Who = get_menu_array($sql); $menulist = array(); $row = array(); $dbh = jjn_pdo_connect(); // // Get info about this person // $Me = array(); $sql = "SELECT p.* FROM people p"; $sql .= " WHERE "; $sql .= " p.people_id = "; $sql .= $dbh->quote($people_id); echo "$sql
\n"; // DEVONLY $meresult = $dbh->query($sql); $Me = $meresult->fetch(PDO::FETCH_ASSOC); $Partner = array(); $fieldlabel = get_field_labels('people','people',$JJNCFG['DBNAME']); // // Figure out photos directory // $Photo = array(); $Photo = scandir($JJNCFG['HEADSHOTDIR']); echo ""; // DEVONLY echo "Headshotdir: /var/www/jjn-html/photos/headshots\n"; // DEVONLY echo ""; // DEVONLY echo "
Headshotdir: $JJNCFG[HEADSHOTDIR]\n"; // DEVONLY print_r($Photo); // DEVONLY echo "
| View Photos, Etc. | \n"; echo "View Personal Information | \n"; //-------------------------------------------------------------- // Left Margin Column: Photos and Role Info //-------------------------------------------------------------- echo "
|---|---|
| ";
//---------------
// Me
//---------------
echo " " . $Me['full_name'] . " \n"; if ( isset( $Me['headshot_url']) ){ // // Is my photo in the library? // echo "My Photo: $Me[headshot_url] \n"; // DEVONLY $dirs = explode('/', $Me['headshot_url']); $headshot = end($dirs); echo "Url has $headshot \n"; // DEVONLY //if ( in_array($headshot, $Photo) && in_array('headshot', $ALLFLD) ){ if ( in_array($headshot, $Photo) ){ echo " | \n";
// Blurb
echo " \n"; echo "Field explanation available via link in left column field labels.\n"; echo " \n"; // Inner left column table echo "\n"; echo " | \n";
echo "
Entering spew_query_form
\n"; // DEVONLY global $JJNCFG; global $PEOPLECFG; $list = array(); $dbh = jjn_pdo_connect(); echo ""; echo "Help and explanations available at "; echo "Overview."; echo "
\n"; echo "Entering generate_year_array
\n"; // DEVONLY global $JJNCFG; global $PEOPLECFG; $thisyear = date('Y'); $year = 1920; $yrs = array(); while ($year < $thisyear) { $yrs[] = $year; $year++; } return($yrs); }//End generate_year_array //---------------------------------------------------------------- // END FUNCTIONS //---------------------------------------------------------------- ?>