setTimeout(function () { window.location.assign('$url') }, 3600);"; return $confirmation; } /** * Fix GravityForms - Redirect form after save to setting in 'Confirmation' (not working in form). */ add_action( 'gform_after_submission_20', 'redirect_to_page', 10, 2 ); add_action( 'gform_after_submission_21', 'redirect_to_page', 10, 2 ); function redirect_to_page( $entry, $form ) { // Set the path for the redirection. switch($entry['form_id']) { case '20' : $location = '/sales-items/'; break; case '21' : $location = '/edit-payment-records/'; break; default : $location = '/'; } header('Location: '.$location); } /** * Create a button to edit/view a form via a post. */ // Get a link for the listing. function getRecordLink($id,$mode,$label,$link) { return("
". "". "". "". "
" ); } /** * Load the parents style sheet. */ add_action( 'wp_enqueue_scripts', 'total_child_enqueue_parent_theme_style' ); function total_child_enqueue_parent_theme_style() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css', [], wp_get_theme( 'Total' )->get( 'Version' ) ); } /** * Define the dynamic filters to pass to Ninja Tables for the WHERE clause of a query. */ add_filter('ninja_table_raw_sql_placeholders', function ($value) { // Save the number along with the parameters to be passed. $value['{unitName}'] = (isset($_REQUEST['unitName'])) ? $_REQUEST['unitName'] : ''; $value['{memberNum}'] = (isset($_REQUEST['memberNum'])) ? $_REQUEST['memberNum'] : ''; return($value); }); /** * Display the elected State Officers on the Officer's page. */ function displayOfficers($query) { // Get the names of the men in office. $result = getDbObject()->dbQuery($query); // Build the officers section. $buffer = '
'; foreach ($result as $officer) { $buffer .= "
"; $buffer .= $officer['one']."
".$officer['two']; $buffer .= "
"; } $buffer .= "
"; // Display results. return($buffer); } /** * Display the Chapter Presidents on the Officer's page. */ function directorsAndMembership($officeAbbr,$title) { // Get the list of members. $officerList = getDbObject()->dbQuery( "SELECT b.fullName ". "FROM wp_sar_officerList a, wp_sar_currentMembers b ". "WHERE a.officeAbbr = '$officeAbbr' and a.nationalNum = b.nationalNum ". "ORDER BY last, first, middle, suffix" ); // Are there any entries to add? if (sizeof($officerList) > 0) { // Format the title. $title = "
$title
"; // Add the names. foreach($officerList as $name) $title .= $name['fullName']."
"; } return($title); } /** * Determine the date the rotationals end on the Officer's page. */ function computeYear($offset) { $year = (date("m") < '3') ? date("Y") : (date("Y") + 1); return($year + $offset); } /** * Add a user to WordPress. */ function addUserToWordpress($first,$last,$generalNum,$email,$password,$zip) { // Can we create the user? $id = wp_create_user( $generalNum, $password, $email); if (!is_wp_error($id)) { // Can we add metadata to the account? $status = wp_update_user(array( 'ID' => $id, 'user_nicename' => $generalNum, 'display_name' => $first." ".$last, 'user_status' => 0, 'first_name' => $first, 'last_name' => $last, 'role' => 'subscriber', 'meta_input' => array( 'user_password' => $password, 'user_zip' => $zip ) )); } // Did an error occur? if (is_wp_error($id) || is_wp_error($status)) error_log("addUserToWordpress: ".print_r($id->get_all_error_data(),true)."User/Email: ".$generalNum."/".$email,1,G_WEBMASTER_EMAIL); return($status); } /** * Add a record to a form in the Gravity Forms' database. */ // Add the fields of the associative array to a new entry in Gravity Forms. function addGfEntry($form,$fieldArray) { // Built a new template. $newEntry = array( "form_id" => "", "date_created" => date("Y-m-d")." 00:00:00", "is_starred" => "0", "is_read" => "0", "ip" => "::1", "source_url" => "https://www.masssr.org/", "currency" => "USD", "created_by" => "1", "user_agent" => "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0", "status" => "active" ); // Add the date created and form identifier. $newEntry['date_created'] = date("Y-m-d H:m:s"); $newEntry['form_id'] = $form; // Add the data fields for the record. foreach($fieldArray as $key => $value) $newEntry[$key] = $value; // Add the record to the database. $entry_id = GFAPI::add_entry($newEntry); return($entry_id); } /** * Add transaction number to Authorize.net charge to the payment transaction. */ add_filter('gform_authorizenet_transaction_pre_capture', function( $transaction, $form_data, $config, $form, $entry ) { if ( $form['id'] == '25' ) { $transaction->invoice_num = rgar($entry,GF_TX_INVOICE_NUM_FIELD); $transaction->cust_id = rgar($entry,GF_TX_CUSTOMER_NUM_FIELD); } return $transaction; }, 10, 5 ); /** * Add line items to Authorize.net submission object before transaction is sent. */ add_filter( 'gform_submission_data_pre_process_payment_25', 'modify_submission_data_25', 10, 4); function modify_submission_data_25( $submission_data, $feed, $form, $entry ) { // Parse itm string to create an array of line items. $line_items = array(); $items = explode("<||>",rgar($entry,'38')); // Are there any items? if (sizeof($items) > 0) { // Repack each item in a collection of associative arrays foreach ($items as $item) if (strlen($item) > 10) { $pieces = explode("<|>",$item); $line_items[] = array( 'id' => $pieces[0], 'name' => $pieces[1], 'description' => $pieces[2], 'quantity' => $pieces[3], 'unit_price' => $pieces[4], 'options' => '' ); } // Replace the line items field in the submission. $submission_data['line_items'] = $line_items; } return($submission_data); } /** * TEMPORARY PROCEDURE FOR GUEST FORM. DELETE AFTER EVENT xxx */ add_filter( 'gform_field_validation_31_6', 'custom_validation_quantity', 10, 4 ); function custom_validation_quantity ( $result, $value, $form, $field ) { if ($result['is_valid'] && $_POST['input_6_3'] < '1') { $result['is_valid'] = false; $result['message'] = 'Quantity must be one or more'; } return $result; } /** * TEMPORARY PROCEDURE FOR GUEST FORM. DELETE AFTER EVENT xxx */ add_filter( 'gform_field_validation_31_9', 'custom_validation_national_number', 10, 4 ); function custom_validation_national_number( $result, $value, $form, $field ) { // Is there a member for the national number? $member = getDbObject()->dbQuery( "SELECT COUNT(*) as 'count' FROM wp_sar_currentMembers WHERE nationalNum = '".$_POST['input_9']."'" ); if ($result['is_valid'] && $member[0]['count'] == 0) { $result['is_valid'] = false; $result['message'] = 'No member found for national number'; } return $result; } /* * Do the national number and its confirmation match on 'update national number' form? */ add_filter( 'gform_field_validation_11_4', 'custom_validation', 10, 4 ); function custom_validation( $result, $value, $form, $field ) { // Do number and confirmation match? if ($result['is_valid'] && $_POST['input_3'] != $_POST['input_4']) { $result['is_valid'] = false; $result['message'] = 'New number does not match its confirmation'; } else { // Does member with national number already exist? $member = getDbObject()->dbQuery( "SELECT * FROM view_sar_get_membership_records WHERE nationalNum = '".$_POST['input_4']."'" ); // Flag error if so. if (sizeof($member) > 0) { $result['is_valid'] = false; $result['message'] = 'Member with national number already exists'; } } return $result; } /** * Change national number of member in membership record, and in the sales records on 'update national number'. */ add_action( 'gform_post_submission_11', 'update_national_number', 10, 2 ); function update_national_number( $entry, $form ) { // Update the general number if both arguments supplied. getDbObject()->dbQuery( "CALL sproc_sar_update_national_number('".$_POST['input_1']."','".$_POST['input_4']."')" ); } /** * Change user password - Does password and confirmation agree? Make change if so. */ add_filter( 'gform_field_validation_22_5', 'updateMemberPassword', 10, 4 ); function updateMemberPassword($result,$value,$form,$field ) { // Does the number and confirmation match? Reset password if so. if ($_POST['input_4'] != $_POST['input_5']) { $result['is_valid'] = false; $result['message'] = 'Password and conformation mismatch'; } else wp_update_user(array('ID' => $_POST['input_1'], 'user_pass' => $_POST['input_4'])); return($result); } /** * Update the roster of officers/members when a state or chapter officer changes. */ add_action( 'gform_after_submission_9', 'updateListOfOfficers', 10, 2 ); add_action( 'gform_after_submission_8', 'updateListOfOfficers', 10, 2 ); function updateListOfOfficers( $entry, $form ) { // Update the list of officers. getDbObject()->dbQuery( "CALL sproc_sar_create_officer_list();" ); // Update the highest office held in the membership records. getDbObject()->dbQuery( "CALL sproc_sar_set_highest_office()" ); } /** * Update the modified payment record after editing. */ add_action( 'gform_after_submission_21', 'update_payment_record', 10, 2 ); function update_payment_record( $entry, $form ) { $result = getDbObject()->dbQuery( "UPDATE wp_sar_salesPayments ". "SET nationalNum = '".$_POST['input_1']."' ". " amount = '".$_POST['input_8']."' ". " first = '".$_POST['input_3.3']."' ". " last = '".$_POST['input_3.6']."' ". " address = '".$_POST['input_7.1']."' ". " city = '".$_POST['input_7.3']."' ". " state = '".$_POST['input_7.4']."' ". " zip = '".$_POST['input_7.5']."' ". " phone = '".$_POST['input_5']."' ". " email = '".$_POST['input_4']."' ". " checkNum = '".$_POST['input_10']."' ". " dateOfCheck = '".$_POST['input_11']."' ". "WHERE invoiceNum = '".$_POST['input_2']."'" ); } /** * Add the check payment for the purchase to the purchases table. */ add_action('gform_after_submission_26', 'record_check_payment', 10, 2 ); function record_check_payment( $entry, $form ) { getDbObject()->dbQuery( "CALL sproc_sar_record_check_payment('".date("Y-m-d")."','".$entry['id']."')" ); } /** * Update life memberships when one is changed. */ add_action( 'gform_after_submission_18', 'updateLifeMembers', 10, 2 ); function updateLifeMembers( $entry, $form ) { // Gather the entry-ids of the records to update. $result = getDbObject()->dbQuery( "SELECT d.entryId, c.natLife, c.stateLife ". "FROM ( ". " SELECT ". " MAX(IF(meta_key='1',meta_value,'')) as 'nationalNum', ". " MAX(IF(meta_key='4',meta_value,'')) as 'natLife', ". " MAX(IF(meta_key='6',meta_value,'')) as 'stateLife' ". " FROM wp_gf_entry a, wp_gf_entry_meta b ". " WHERE a.form_id = '26' and a.id = b.entry_id and a.status = 'active' ". " GROUP BY b.entry_id ". ") c, wp_sar_currentMembers d ". "WHERE c.nationalNum = d.nationalNum" ); // Update the life-membership fields. foreach($result as $member) { GFAPI::update_entry_field($member['entryId'],"77",$member['natLife']); GFAPI::update_entry_field($member['entryId'],"79",$member['stateLife']); } // Return to the life membership page. header('Location: /life-memberships/'); } /** * Add new candidate to membership roster. */ function addCandidateToRoster($mapping) { // Update the fields for which data is provided. $newCandidateArray = array(); foreach($mapping as $key => $value) if (isset($_POST[$key])) $newCandidateArray[$value] = $_POST[$key]; // Add salutation, type of member, and type of application. $newCandidateArray['28.2'] = 'Mr.'; $newCandidateArray['29'] = 'Candidate'; $newCandidateArray['35'] = 'Type of applicant: '.$_POST['input_10'].'; Related to member: '.$_POST['input_7']; // Add candidate to roster of members. addGfEntry("6",$newCandidateArray); } // Add candidate referred by member. add_action( 'gform_after_submission_2', 'add_member_referred_candidate', 10, 2 ); function add_member_referred_candidate( $entry, $form ) { // Form 2 to Form 6 field mapping. $mapping = array( "input_1_3" => "28.3", "input_1_6" => "28.6", "input_2" => "6", "input_3" => "56", "input_15" => "64", ); // Add candidate to roster. addCandidateToRoster($mapping); } // Add candidate applied from public website. add_action( 'gform_after_submission_10', 'add_candidate_from_public_website', 10, 2 ); function add_candidate_from_public_website( $entry, $form ) { // Form 10 to Form 6 field mapping. $mapping = array( "input_3_3" => "28.3", "input_3_6" => "28.6", "input_5" => "6", "input_24_1" => "2.1", "input_24_2" => "2.2", "input_24_3" => "2.3", "input_24_4" => "2.4", "input_24_5" => "2.5", "input_15" => "56", "input_6" => "82", ); // Add candidate to roster. addCandidateToRoster($mapping); } /** * Lookup the emails, name, and officers of a chapter to recieve a request for an award or medal. */ add_action( 'gform_pre_submission_12', 'award_pre_submission_handler' ); add_action( 'gform_pre_submission_13', 'award_pre_submission_handler' ); add_action( 'gform_pre_submission_14', 'award_pre_submission_handler' ); function award_pre_submission_handler( $form ) { // Fields on eagle/ROTC/public-service forms with emails, name, and officers of chapter with state chair. $mappings = array( '12' => array('zip' => '35_5', 'emails' => '30', 'chairName' => '40', 'chapName' => '25', 'stateChair' => 'XESC'), // Eagle Scout '13' => array('zip' => '41_5', 'emails' => '40', 'chairName' => '45', 'chapName' => '25', 'stateChair' => 'XROTC'), // ROTC '14' => array('zip' => '33', 'emails' => '44', 'chairName' => '46', 'chapName' => '38', 'stateChair' => 'XROTC'), // Public Service ); // Identify the chapter for the zip code. $chapter = getDbObject()->dbQuery( "SELECT chapter FROM wp_sar_zipCountyRef WHERE zip = '".substr($_POST['input_'.$mappings[$form['id']]['zip']],0,5)."'" ); // Get the emails of the target officer. $details = getDbObject()->dbQuery( "SELECT GROUP_CONCAT(c.email SEPARATOR ',') as 'emails', MAX(c.fullName) as 'chairName', MAX(c.chapName) as 'chapName' ". "FROM ( ". " SELECT email, NULL as 'fullName', NULL as 'chapName' ". " FROM view_sar_get_all_officer_roster ". " WHERE officeAbbr = '".$mappings[$form['id']]['stateChair']."' ". " UNION ". " SELECT DISTINCT a.email, a.fullName, b.chapName ". " FROM view_sar_get_all_officer_roster a, wp_sar_chapterRef b ". " WHERE a.chapAbbr = '".$chapter[0]['chapter']."' AND officeAbbr in ('CAAM','CPRES') AND a.chapAbbr = b.chapAbbr". ") c;" ); // Add emails and name of chapter and their A&M chairman to form. $_POST['input_'.$mappings[$form['id']]['emails']] = $details[0]['emails']; $_POST['input_'.$mappings[$form['id']]['chairName']] = $details[0]['chairName']; $_POST['input_'.$mappings[$form['id']]['chapName']] = $details[0]['chapName']; } /** * Enter a member's change of address into his membership record (Form 9 --> Form 3). */ add_action( 'gform_after_submission_7', 'change_of_address_update', 10, 2 ); function change_of_address_update( $entry, $form ) { // Form 9 to Form 3 field mapping. $mapping = array( "input_1_1" => "2.1", "input_1_2" => "2.2", "input_1_3" => "2.3", "input_1_4" => "2.4", "input_1_5" => "2.5", "input_1_6" => "2.6", "input_3" => "6", "input_4" => "56", "input_5" => "32", "input_6" => "31", "input_9" => "82" ); // Is the entry_id provided? if (isset($_POST['input_8']) && is_numeric($_POST['input_8'])) { // Update the fields for which data is provided. foreach($mapping as $key => $value) if (isset($_POST[$key])) GFAPI::update_entry_field($_POST['input_8'],$value,$_POST[$key]); // Update the change in the membership record in to relational table. getDbObject()->dbQuery( "CALL sproc_sar_load_gf_member_to_mysql($_POST['input_8'])" ); } } /* * Test 'redirect' custom field when entering a page. Redirect if not logged in. */ add_action('template_redirect', 'verify_authentication'); function verify_authentication() { $id = get_queried_object_id(); if (!is_user_logged_in() && get_post_meta( $id, 'mef_redirect', true ) == "true") { auth_redirect(); exit; } } /* * On successful login, redirect to the URL specified by custom login form. */ add_action('wp_login', 'on_login_redirect', 10, 3); function on_login_redirect( $user_login, $user ) { if (isset($_REQUEST['redirect_to']) && strlen($_REQUEST['redirect_to']) > 0) wp_redirect($_REQUEST['redirect_to']); else wp_redirect( home_url() ); exit; } /** * On failed login, redirect user to login page. */ add_action( 'wp_login_failed', 'myprefix_redirect_after_login_fail' ); function myprefix_redirect_after_login_fail( $username ) { wp_redirect('/login'); exit(); } /** * Redirect user to the home page when user logs out. */ add_action('wp_logout','auto_redirect_after_logout'); function auto_redirect_after_logout(){ wp_redirect( home_url() ); exit(); } /** * Always direct users to the theme's login page. */ add_filter( 'login_url', 'new_login_page', 10, 3 ); function new_login_page( $login_url, $redirect, $force_reauth ) { $login_page = home_url( '/login/' ); return add_query_arg('redirect_to', $redirect, $login_page ); } /** * This function looks for the current users national number and email in the wp_User object. */ function getNationalNumberFromWordpress(&$number,&$email,&$password,&$zip) { $number = "0"; $email = ""; $login = ""; $zip = ""; // Does the current user exist? $current_user = wp_get_current_user(); if ($current_user->exists()) { // Get the General Number (not "-X" sufix) and email. $number = substr($current_user->user_nicename,0,6); $email = $current_user->user_email; // Is this a member's account? if (is_numeric($number)) { // Get member's login and zip. /* xxx $password = get_user_meta($current_user->ID,"user_password",false)[0]; $zip = get_user_meta($current_user->ID,"user_zip",false)[0]; */ $password = get_user_meta($current_user->ID,"user_password",false); $zip = get_user_meta($current_user->ID,"user_zip",false); } } } /** * Returns TRUE if the user is has privledges above subscriber. */ function is_user_privledged($stringOfRoles) { // Is the user logged in? $status = FALSE; if (is_user_logged_in()) { // Get reference to user. Split string into array of roles. $currentUser = wp_get_current_user(); $roleArray = explode(",",$stringOfRoles); // Is any privledge in the user's roles? foreach($roleArray as $role) if (in_array(trim($role),$currentUser->roles)) $status = TRUE; } return($status); } /** * Set the directory where files are uploaded by Gravity Forms. */ add_filter( 'gform_upload_path', 'change_scwma_upload_path', 10, 2 ); function change_scwma_upload_path( $path_info, $form_id ) { $path_info['path'] = G_UPLOAD_PATH; $path_info['url'] = G_UPLOAD_URL; return $path_info; } /** * Performs a query and places the result set in a form for a Gravity Forms * drop-down control. */ function buildDropdownList($query,$message = "") { // Create array for drop down. Start with blank item. $items = array(); $items[] = array( 'value' => '0', 'text' => $message, 'selected' => 'selected'); // Get the values for the dropdown. $result = getDbObject()->dbQuery($query); // Add the element to the dropdown. foreach ($result as $item) $items[] = array( 'value' => $item['value'], 'text' => $item['text']); // Assign the list to the field. return($items); } /** * Lookup the email of the state officer. Set email of notification to it. */ add_filter( 'gform_notification_1', 'set_receivers_email', 10, 3 ); function set_receivers_email ( $notification, $form, $entry ) { // Are we sending mail to state officer? if ($_POST['input_19'] == '0') { // Get the email of the state officer or chapter president. $result = getDbObject()->dbQuery( "SELECT email ". "FROM view_sar_get_all_officer_roster ". "WHERE officeAbbr = '".$_POST['input_10']."' OR ". " (chapAbbr = '".$_POST['input_10']."' AND officeAbbr = 'CPRES')" ); // Did we find an email? Add to notification. Add it to $entry. if (sizeof($result) == 1) { $notification['to'] = $result[0]['email']; GFAPI::update_entry_field($entry['id'],"24",$result[0]['email']); } } return($notification); } /** * Lookup the chaper and the email for the membership inquiry. Set email of notification to them. */ add_filter( 'gform_notification_2', 'set_member_referral_emals', 10, 3 ); function set_member_referral_emals( $notification, $form, $entry ) { // Get emails of state registrars and secretary. $result = getDbObject()->dbQuery( "SELECT GROUP_CONCAT(email SEPARATOR ';') as 'emails' FROM view_sar_get_all_officer_roster WHERE officeAbbr in ('SSEC','SREGG','SAREGG')" ); // Did we find the emails? Add emails to notification. Add fields to to $entry. if (sizeof($result) == 1) { $notification['to'] = $result[0]['emails']; GFAPI::update_entry_field($entry['id'],"17",$result[0]['emails']); } return($notification); } /** * Lookup the chaper and the email for the membership inquiry. Set email of notification to them. */ add_filter( 'gform_notification_10', 'set_inquiry_emails', 10, 3 ); function set_inquiry_emails ( $notification, $form, $entry ) { // Get emails of state/chapter registrars and chapter president. $result = getDbObject()->dbQuery( "SELECT a.chapter, GROUP_CONCAT(c.email SEPARATOR ',') as 'emails' ". "FROM wp_sar_zipCountyRef a, view_sar_get_all_officer_roster b, wp_sar_currentMembers c ". "WHERE ((a.chapter = b.chapAbbr AND b.officeAbbr in ('CPRES','CMBR')) OR b.officeAbbr = 'SREGG') AND ". " b.nationalNum = c.nationalNum AND ". " a.zip = '".substr($_POST['input_24_5'],0,5)."'" ); // Did we find the emails? Add emails to notification. Add fields to to $entry. if (sizeof($result) == 1) { $notification['to'] = $result[0]['emails']; GFAPI::update_entry_field($entry['id'],"19",$result[0]['chapter']); GFAPI::update_entry_field($entry['id'],"23",$result[0]['emails']); } return($notification); } /** * If creating a new membership record, take the next lowest temporary number available * and assign it to the national number field of the membership record. * */ add_action( 'gform_pre_submission_6', 'member_rec_pre_submission_handler' ); function member_rec_pre_submission_handler($form) { if ( $_POST['input_10'] == G_TEMP_MEMBERSHIPNUM) { // Get the next available temporary membership number. $result = getDbObject()->dbQuery( "SELECT MIN(nationalNum)-1 as 'newNum' FROM view_sar_get_membership_records WHERE nationalNum > '".G_TEMP_MEMBERSHIPNUM."'" ); // Add the number to the form. if (sizeof($result) == 1) $_POST['input_10'] = $result[0]['newNum']; } } /** * Forward user to membership maintance page after editing of member record. * (GravityForms "confirmation" is broken on form.) * */ add_action( 'gform_after_submission_6', 'update_membership_record', 10, 2 ); function update_membership_record( $entry, $form ) { wp_redirect("/maintain"); } /** * Dynamically initialize the drop downs with a list of members and the general * numbers and loads the dropdown with it. */ add_filter('gform_pre_render','populate_dropDowns'); add_filter('gform_admin_pre_render','populate_dropDowns'); function populate_dropDowns($form) { // Scan throught the fields and load them by type. foreach ($form['fields'] as &$field ) { if (strpos( $field->cssClass,'load_current_chapters') !== false) { // Get a list of current chapters by name. $result = buildDropdownList( "SELECT chapAbbr as 'value', chapName as 'text' ". "FROM wp_sar_chapterRef ". "ORDER BY chapName", "" ); $field->choices = $result; } else if (strpos( $field->cssClass,'load_venues') !== false) { // Get a list of locations for events. $result = buildDropdownList( "SELECT entry_id as 'value', name as 'text' ". "FROM view_sar_get_event_locations ". "ORDER BY name ", "" ); $field->choices = $result; } else if (strpos( $field->cssClass,'load_this_years_events') !== false) { // Get the list of current chapters. $result = buildDropdownList( "SELECT DISTINCT b.unitName as 'value', b.unitDesc as 'text' ". "FROM wp_sar_salesPayments a, wp_sar_salesOrders b ". "WHERE a.invoiceNum = b.invoiceNum AND YEAR(a.date) = '20".G_YEAR."' ". "ORDER BY b.unitDesc", "" ); $field->choices = $result; } else if (strpos( $field->cssClass,'load_membership_types') !== false) { // Get the list of current chapters. $result = buildDropdownList( "SELECT DISTINCT memberType as 'value', memberType as 'text' ". "FROM view_sar_get_membership_records ". "UNION ". "SELECT 'Statistics' as 'value', 'Statistics' as 'text'", "" ); $field->choices = $result; } else if (strpos( $field->cssClass,'load_everyone') !== false) { // Get the list of all members of any type. $result = buildDropdownList( "SELECT nationalNum as 'value', ".G_DB_NAME_LFMS." as 'text' ". "FROM view_sar_get_membership_records ". "ORDER BY last, first, middle, suffix", "" ); $field->choices = $result; } else if (strpos( $field->cssClass,'load_members') !== false) { // Get the list of active members. $result = buildDropdownList( "SELECT nationalNum as 'value', ".G_DB_NAME_LFMS." as 'text' ". // "FROM view_sar_get_membership_records ". "FROM wp_sar_currentMembers ". "WHERE memberType in (".G_CURRENT_MEMBER_TYPES.") ". "ORDER BY last, first, middle, suffix", "" ); $field->choices = $result; } else if (strpos( $field->cssClass,'award_agents') !== false) { // Get those who are allowed to grant awards. $result = buildDropdownList( "SELECT pk as 'value', agent as 'text' ". "FROM wp_sar_awardAgents ". "ORDER BY pk", "" ); $field->choices = $result; } else if (strpos( $field->cssClass,'awards_available') !== false) { // Get the list of awards available to grant. $result = buildDropdownList( "SELECT pk as 'value', award as 'text' ". "FROM wp_sar_awardsAvailable ". "ORDER BY pk", "" ); $field->choices = $result; } else if (strpos( $field->cssClass,'member_login_id') !== false) { // Get a list of all member from year one. $result = buildDropdownList( "SELECT a.id as 'value', CONCAT(".G_DB_NAME_LFMS.",' (',a.user_login,' - ',DATE_FORMAT(b.dob,'%m%d'),')') as 'text' ". "FROM wp_users a, view_sar_get_membership_records b ". "WHERE a.user_login = b.nationalNum AND a.user_login REGEXP '^[0-9]+$' ". "ORDER BY b.last, b.first, b.middle, b.suffix", "" ); $field->choices = $result; } else if (strpos( $field->cssClass,'load_venues') !== false) { // Get the venues where we hold events. $result = buildDropdownList( "SELECT entry_id as 'value', name 'text' ". "FROM view_sar_get_event_locations ". "ORDER BY name", "" ); $field->choices = $result; } } return($form); } /** * Use the two-letter state code rather than the full name of the state. */ add_filter( 'gform_us_states', 'us_states' ); function us_states( $states ) { $new_states = array(); foreach ( $states as $state ) { $new_states[ GF_Fields::get( 'address' )->get_us_state_code( $state ) ] = $state; } return $new_states; } ?> {"id":18978,"date":"2019-01-20T15:00:33","date_gmt":"2019-01-20T20:00:33","guid":{"rendered":"https:\/\/www.massar.org\/?p=18978"},"modified":"2024-02-05T19:55:23","modified_gmt":"2024-02-05T19:55:23","slug":"golden-state-hosts-congress-in-orange-county","status":"publish","type":"post","link":"https:\/\/massar.org\/golden-state-hosts-congress-in-orange-county\/","title":{"rendered":"Golden State Hosts Congress in Orange County"},"content":{"rendered":"

The Golden State Hosts Congress in Orange County<\/title><\/p>\n<div style=\"float:left;margin: 0 10px 0 0;width:100%; max-width:400px\">\n<img decoding=\"async\" width=\"100%\" src=\"https:\/\/www.massar.org\/wp-content\/uploads\/2019\/09\/congress-2019-pg.png\" \/><\/p>\n<p style=\"font-style:italic\">\nPresident General Warren Alter (2018-19) with newly elected President General John T. “Jack” Manning (on left).\n<\/p>\n<\/div>\n<p>\n<a target=\"_blank\" href=\"https:\/\/www.sar.org\/SAR-Magazine\" rel=\"noopener noreferrer\">SAR Magazine<\/a><br \/>\nSummer 2019<br \/>\nVol. 114 No. 1, pp. 7-11\n<\/p>\n<p>\nThe 129th Congress, hosted by the California Society, July 6-10, attracted 205 compatriots and numerous dignitaries and guests to the Hilton Orange County in Costa Mesa, California. Many of the events were held at the hotel. The California Society Welcome Reception took place on the Hornblower Harbor Dinner Cruise on nearby Newport Bay. The reception featured music, dinner and sightseeing from the upper deck.\n<\/p>\n<p>\nPrior to the official opening of Congress, there were numerous trips and social events, including tours of the Huntington Library and Gardens, the Lyons Air Museum and the Richard Nixon Presidential Library.\n<\/p>\n<p>\nThe Sunday Memorial Service was held at the Saint Andrews Presbyterian Church in Newport Beach in honor of the 694 compatriots who passed away during 2018. Those receiving special mention included President General (2012-13) Stephen A. Leishman of Delaware.\n<\/p>\n<p>\nUnder the direction of Chaplain General Rev. Dr. John C. Wakefield, the service featured violin and piano selections by Dr. and Mrs. M. Kent Gregory and Jung-A Lee, organist. The readings were made by several Presidents General and other members of the Chaplains Committee.\n<\/p>\n<p>\nPaul R. Callanan, chairman of the NSSAR Congress Planning Committee, and John L. Dodd, chairman of the California SAR Planning Committee, directed the event, which included numerous special breakfasts and high-level committee meetings.\n<\/p>\n<p>\nThe opening session included the posting of colors, a benediction and greetings from many California dignitaries, including a state senator and the mayor of Costa Mesa.\n<\/p>\n<p>\nDAR President General Denise Van Buren addressed Congress. Others bringing greetings included the Children of the American Revolution, the Sons of the Revolution, the General Society of the War of 1812, the Founders of North America, Decendants of Washington\u2019s Soldiers at Valley Forge, Mayflower Decendants and the Military Order of Foreign Wars.\n<\/p>\n<p>\nThe afternoon session opened with the presentation of the Gold Good Citizenship Medal to Compatriot Mike Rowe of the television show Dirty Jobs, who delivered an acceptance speech via voicemail.\n<\/p>\n<div style=\"float:right; margin: 0 0 0 10px;width:100%; max-width:500px\">\n<img decoding=\"async\" width=\"100%\" src=\"https:\/\/www.massar.org\/wp-content\/uploads\/2019\/09\/congress2019-youth.png\" \/><\/p>\n<p style=\"font-style:italic\">\nAbove, the participants in the Joseph Rumbaugh Orations Contest\u2014front row, from left, Michael Howard (Louisiana), Isaiah Chappel Goldsmith (Massachusetts), Zenna Riyadh Whayeb (Tennessee), PG Warren Alter, Contest Chairman Jack Bredenfoerder, Abigail Boyd (Indiana), winner Alison Elizabeth Stanley (Alabama), Gillian Leigh Alexanders (Arizona), Mattilyn Lee Winburn (Georgia) and Joseph Procacci Jr. (Florida). Back row, from left, Caleb He (Kentucky), Jose L. Romero (Texas), Dorothy Elizabeth McCormick (Delaware), Allison Sarah Lord (Maryland), Hattie Marie Lindey (Pennsylvania), Riley Grace Shaner (North Carolina), Jake Robert Birchmeier (South Carolina), Lauren Alexandra Bradshaw (Virginia), Brent Gregory Bergnach (Illinois) and Gabriel Anthony Gainar (Ohio).\n<\/p>\n<\/div>\n<h3>New Officers Elected<\/h3>\n<p>\nIn the only contested election of the Congress, Compatriot Douglas C. Collins of Kentucky defeated John O. Thornhill of North Carolina for the office of Registrar General. Elected by acclamation were President General John T. “Jack” Manning (New Hampshire), Secretary General Davis Lee Wright (Delaware), Treasurer General C. Bruce Pickette (Alabama), Chancellor General Peter M. Davenport (Virginia), Genealogist General James W. Faulkinbury (California), Historian General William O. Stone (Alabama), Librarian General Tony L. Vets II (Louisiana), Surgeon General Darryl S. Addington (Tennessee) and Chaplain General David J. Felts (Pennsylvania).\n<\/p>\n<p>\nLater named to the Executive Committee were President General (2018-19) Warren M. Alter (Arizona), David Boring (District of Columbia), John Dodd (California), David Perkins (Connecticut) and Fred Olive (Alabama).\n<\/p>\n<h3>Business Sessions Concluded<\/h3>\n<p>\nThe 10 Presidents General in attendance offered comments, the senior PG being Nathan E. White (2006-07) of Texas, who was attending his 24th consecutive Congress and his third in California. Others present included: Bruce A. Wilcox (2007-08), David N. Appleby (2008-09), Edward F. Butler Sr. (2009-10), J. David Sympson (2010-11), Larry J. Magerkurth (2011-12), Joseph W. Dooley (2013-14), Lindsey C. Brock (2014-15), Thomas E. Lawrence (2015-16) and J. Michael Tomme (2016-17).\n<\/p>\n<p>\nThe most significant legislative changes were housekeeping in nature. Dues and fees remained the same for 2019. Between the business sessions were committee meetings and educational opportunities, including Tuesday\u2019s session by Dr. Patrick Cecil entitled “Knocked Down, But Not Out: Quakers in the Revolution.”\n<\/p>\n<h3>Other Highlights<\/h3>\n<p>\nTuesday evening\u2019s guest speaker was Capt. J. Charles Plumb, an Annapolis graduate who flew 74 successful combat missions over North Vietnam before being shot down five days before he was to be discharged. He spent the next 2,103 days as a prisoner of war in Communist prison camps. His rivoting speech discussed his life in an 8-by-8-foot cell and how overcoming adversity, no matter how difficult, can propel us beyond our self- imposed limits.\n<\/p>\n<p>\nOn Wednesday afternoon, many attendees took the San Juan Capistrano Mission tour before returning to the hotel to get ready for the formal installation banquet<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Golden State Hosts Congress in Orange County President General Warren Alter (2018-19) with newly elected President General John T. “Jack” Manning (on left). SAR Magazine Summer 2019 Vol. 114 No. 1, pp. 7-11 The 129th Congress, hosted by the California Society, July 6-10, attracted 205 compatriots and numerous dignitaries and guests to the Hilton…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,2],"tags":[],"post_series":[],"class_list":["post-18978","post","type-post","status-publish","format-standard","hentry","category-local","category-news","entry","no-media"],"_links":{"self":[{"href":"https:\/\/massar.org\/wp-json\/wp\/v2\/posts\/18978"}],"collection":[{"href":"https:\/\/massar.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/massar.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/massar.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/massar.org\/wp-json\/wp\/v2\/comments?post=18978"}],"version-history":[{"count":0,"href":"https:\/\/massar.org\/wp-json\/wp\/v2\/posts\/18978\/revisions"}],"wp:attachment":[{"href":"https:\/\/massar.org\/wp-json\/wp\/v2\/media?parent=18978"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/massar.org\/wp-json\/wp\/v2\/categories?post=18978"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/massar.org\/wp-json\/wp\/v2\/tags?post=18978"},{"taxonomy":"post_series","embeddable":true,"href":"https:\/\/massar.org\/wp-json\/wp\/v2\/post_series?post=18978"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}