info("Here is the where clause for the Accounts list view: $the_where");
return $the_where;
}
function build_contact_where_clause ($the_query_string) {
$where_clauses = Array();
array_push($where_clauses, "lastname like '$the_query_string%'");
array_push($where_clauses, "firstname like '$the_query_string%'");
array_push($where_clauses, "contactsubdetails.assistant like '$the_query_string%'");
if (is_numeric($the_query_string)) {
array_push($where_clauses, "phone like '%$the_query_string%'");
array_push($where_clauses, "mobile like '%$the_query_string%'");
array_push($where_clauses, "homephone like '%$the_query_string%'");
array_push($where_clauses, "otherphone like '%$the_query_string%'");
array_push($where_clauses, "phone_fax like '%$the_query_string%'");
array_push($where_clauses, "assistant_phone like '%$the_query_string%'");
}
$the_where = "";
foreach($where_clauses as $clause)
{
if($the_where != "") $the_where .= " or ";
$the_where .= $clause;
}
$log = LoggerManager::getLogger('contact_unified_search');
$log->info("Here is the where clause for the Contacts list view: $the_where");
return $the_where;
}
function build_opportunity_where_clause ($the_query_string) {
$where_clauses = Array();
array_push($where_clauses, "potentialname like '$the_query_string%'");
$the_where = "";
foreach($where_clauses as $clause)
{
if($the_where != "") $the_where .= " or ";
$the_where .= $clause;
}
$log = LoggerManager::getLogger('opportunity_unified_search');
$log->info("Here is the where clause for the Potentials list view: $the_where");
return $the_where;
}
/*
function build_case_where_clause ($the_query_string) {
$where_clauses = Array();
array_push($where_clauses, "cases.name like '$the_query_string%'");
if (is_numeric($the_query_string)) array_push($where_clauses, "cases.number like '$the_query_string%'");
$the_where = "";
foreach($where_clauses as $clause)
{
if($the_where != "") $the_where .= " or ";
$the_where .= $clause;
}
$log = LoggerManager::getLogger('case_unified_search');
$log->info("Here is the where clause for the Cases list view: $the_where");
return $the_where;
}
*/
//main
echo get_module_title("", "Search Results", true);
echo "\n
\n";
if(isset($_REQUEST['query_string']) && preg_match("/[\w]/", $_REQUEST['query_string'])) {
//get accounts
$where = Account::build_generic_where_clause($_REQUEST['query_string']);
echo "