Location: PHPKode > projects > Homeless Mangement Information System > hmis/include/client_id_org_generated_class.inc
<?php
class Client_id_org_generated extends Client_id {
    var $result_matches;
    var $previous_match;

/*
	function pull_org_generated_client_id_entry_question_array ()		{
		GLOBAL $unix_date, $org_name, $organization_term;

		$this->questions["org_generated_client_id"] = array ("question_id" => "org_generated_client_id", "question_title" => "Client ID Used by Your ".$organization_term.":", "question_type" => "text",  "question_field_size" => "40", "question_display_order" => "1019", "question_required" => "no", "question_default_value" => "", "question_visible" => "yes", "question_ecma" => "");
		
    }
*/

/*
	function assemble_client_org_id_lookup_entry_table ($vetted_system_id_form_answer)	{
		$final_html .= "<table><tr>";			
		$final_html .= display_text_question ($this->questions["org_generated_client_id"], $vetted_system_id_form_answer, "yes");
		$final_html .= "</tr></table>";

		return $final_html;

	}
*/


	function set_client_info_session_variables_org ( $vetted_org_generated_identifier )	{
		GLOBAL $org_id, $client_info;	
			
            //Replace any use of the "?" (the wildcard org id character) with a "%"; the "%" below messes-up syntax highlighting
            $vetted_org_generated_identifier = str_replace("?", "%", $vetted_org_generated_identifier);
            
			//If there is an org_generted id check to see if it already exists, 
			$sqly = "
            SELECT 
                DISTINCT(client_id), 
                org_generated_client_id 
                FROM org_generated_client_ids 
                WHERE 
                    org_generated_client_id LIKE '".$vetted_org_generated_identifier."' 
                    AND org_id = '".$org_id."' 
                ORDER BY org_generated_client_id";//LIMIT 20
			//echo $sqly;
			$this->result_matches = run_query($sqly, "checking for matching org generated ids");
			
			if(num_rows($this->result_matches) == 0)
            {
				$client_info[0]["client_id"] = "0";
                $_SESSION['client_infoB'][0]["client_id"] = "0";
			}
			else
            {
                $system_client_id = fetch_array($this->result_matches, "Finding system id from org generated id", "0");
                $profile = new Client_profile;
                
                $final_html .= "<td class=\"smalltd\"><a class=\"smaller75\"
                href=\"".$system_directory."client_overview.php?display_client_overview=".$current_client["client_id"]."\">Link to Client
                Overview</a></td>";
                
                //$client_info["0"] = Client_profile::pull_client_profile_array ($system_client_id["client_id"]);
                $client_info[0] = $profile->pull_client_profile_array ($system_client_id["client_id"]);
 				$_SESSION['client_infoB'][0] = $client_info[0];
			}
    
	}


/*    
    function display_other_clients_matching_query () {
        GLOBAL $system_directory;
        
        $result_count = num_rows($this->result_matches);
        //Only display up to 75 other matching clients
        if ( $result_count > 75 )   {
            $result_count = 75;
        }
        //If there is more than one client that matches query, produce list of clients that are close 
        //matches.  Best match has already been displayed as a detailed client profile.
        if ($result_count > 1)  {
        
            $final_html .= "<table><tr><td class =\"generictabletop\">Other Clients Matching Query</td></tr></table>";
        
            $profile_list = new Client_profile;

            //Load the client profile info for client that are close to query into an array
            for ($c = 1; $c < $result_count; $c++)  {

                $system_client_id = fetch_array($this->result_matches, "Finding system id from org generated id", $c);

                //If we have already displayed this match, don't repeat it
                if ( !$this->previous_match[$system_client_id["client_id"]] )   {

                    $other_client[$c] = $profile_list->pull_client_profile_array ($system_client_id["client_id"]);
                
                }
                
                //Mark that we have a match for this client
                $this->previous_match[$system_client_id["client_id"]] = "yes";
                                
            }    
            
            $final_html .= $profile_list->display_client_profile_table ($other_client);

            return $final_html;
        }
    }    
*/    
}
?>
Return current item: Homeless Mangement Information System