“;
//echo $age . “
“;
//echo $resources . “
“;
//echo $services . “
“;
//echo $insurance . “
“;
//echo $user_address . “
“;
//echo $trans . “
;

$today = mktime(0, 0, 0, date(‘m’), date(‘d’), date(‘Y’));
$subtract = $subtract = $today – (86400 * 225);
$dt_225=date(‘Y-m-d H:i:s’, $subtract);

$db_free = new ps_DB;
$sql = “SELECT in_pk FROM insurance WHERE in_name = ‘Free'”;
$db_free->query($sql);
$db_free->next_record();
$free_pk = $db_free->f(“in_pk”);

$db_res = new ps_DB;
$sql = “SELECT * FROM provider”;

if ($services)
$sql .= “, services, services_provider_link”;

if ($insurance || $free)
$sql .= “, insurance, insurance_provider_link”;

$sql .= ” WHERE provider.rs_fk=$resources”;

if ($services)
$sql .= ” AND services.sv_pk=$services AND services_provider_link.sv_fk=$services AND services_provider_link.pr_fk=provider.pr_pk”;

if ($insurance && ($free == ‘on’))
$sql .= ” AND insurance.in_pk=$insurance AND (insurance_provider_link.in_fk=$insurance OR insurance_provider_link.in_fk=$free_pk) AND insurance_provider_link.pr_fk=provider.pr_pk”;

if (!$insurance && ($free == ‘on’))
$sql .= ” AND insurance.in_pk=$free_pk AND insurance_provider_link.in_fk=$free_pk AND insurance_provider_link.pr_fk=provider.pr_pk”;

if ($insurance && (!$free == ‘on’))
$sql .= ” AND insurance.in_pk=$insurance AND insurance_provider_link.in_fk=$insurance AND insurance_provider_link.pr_fk=provider.pr_pk”;

if ($cc_age==’0′)
$sql .= ” AND provider.`pr_cc_0-23`>0″;
if ($cc_age==’2′)
$sql .= ” AND provider.`pr_cc_2-3`>0″;
if ($cc_age==’3′)
$sql .= ” AND provider.`pr_cc_3-4`>0″;
if ($cc_age==’5′)
$sql .= ” AND provider.`pr_cc_5`>0″;

if ($trans == ‘on’)
$sql .= ” AND provider.pr_transportation=’Yes'”;

if ($age)
$sql .= ” AND provider.pr_age_min<=$age AND provider.pr_age_max>=$age”;

$sql .= ” AND pr_active=’Yes'”;

if ($g<>“No Preference” && $g<>“”) {
$sql .= ” AND ( provider.pr_gender=’$g’ OR provider.pr_gender=’Both’ )”;
}

// ONLY SHOW PROVIDERS THAT HAVE VIEWED/UPDATED PROFILE IN LAST 225 DAYS
$sql .= ” AND `pr_dt_updated` > ‘” . $dt_225 . “‘”;

// GROUP BY provider.pr_pk
$sql .= ” GROUP BY provider.pr_pk”;

// ORDER BY LAST MODIFIED DATE
$sql .= ” ORDER BY pr_dt_updated DESC”;

$dbid=$db_res->query($sql);
//if (!$dbid) {
// header(“Location: notfound.php”);
// exit();
//}

$num_rows = $db_res->num_rows();
//echo $num_rows . ” ” . $trans . ” ” . $services . ” ” . $sql . “
“;

$db_name = new ps_DB;

if ($services) {
$sql = “SELECT * FROM services WHERE sv_pk=” . $services;
$db_name->query($sql);
$db_name->next_record();
$service_name=$db_name->f(“sv_name”);
$sv_count = $db_name->f(“sv_numsearch”) + 1;
}

if ($resources) {
$sql = “SELECT * FROM resources WHERE rs_pk=” . $resources;
$db_name->query($sql);
$db_name->next_record();
$resource_name=$db_name->f(“rs_name”);
$rs_count = $db_name->f(“rs_numsearch”) + 1;
}

if ($insurance) {
$sql = “SELECT * FROM insurance WHERE in_pk=” . $insurance;
$db_name->query($sql);
$db_name->next_record();
$insurance_name=$db_name->f(“in_name”);
$in_count = $db_name->f(“in_numsearch”) + 1;
}

// Update Insurance, Resource, Service, Provider Search Counts
$db_sc = new ps_DB;

if ($insurance) {
$sql = “UPDATE insurance SET in_numsearch=$in_count WHERE in_pk=$insurance”;
$db_sc->query($sql);
}

$sql = “UPDATE resources SET rs_numsearch=$rs_count WHERE rs_pk=$resources”;
$db_sc->query($sql);

if ($services) {
$sql = “UPDATE services SET sv_numsearch=$sv_count WHERE sv_pk=$services”;
$db_sc->query($sql);
}

//echo “You searched for a ” . $resource_name . ” Resource providing ” . $service_name;
//if ($age)
// echo ” for a ” . $age . ” year old”;
//if ($insurance)
// echo ” with ” . $insurance_name . ” as the payment option.”;
//echo “

“;
?>

Directory Search Results:


« Back
Thanks for searching the RU Directory. Your search results are below. If you would like to complete a more specific search, please see the Filter Results options. You can also begin a new search.
or view our entire list of providers.
“;
}

while ($db_res->next_record()) {

// Update Insurance, Resource, Service, Provider Search Counts

$count = $db_res->f(“pr_numsearch”) + 1;
$sql = “UPDATE provider SET pr_numsearch=$count WHERE pr_pk=” . $db_res->f(“pr_pk”);
$db_sc->query($sql);

?>

f(‘pr_pk’) . “.jpg”)) { ?>
f(‘pr_pk’); ?>” title=”View Full Profile”>f(“pr_name”); ?>
View Profile »
f(“pr_phone”)) == 10) {
echo substr($db_res->f(“pr_phone”),0,3) . “-” . substr($db_res->f(“pr_phone”),3,3) . “-” . substr($db_res->f(“pr_phone”),6,4);
} else {
echo $db_res->f(“pr_phone”);
}; ?>

f(“pr_email”) . “>” . $db_res->f(“pr_email”) . ““; ?>

f(“pr_text”),0,300));
if (strlen($db_res->f(“pr_text”)) > 300) {
echo “…”; } ?>

Hours

Mon: f(“pr_hoo_mon”); ?>
Tues: f(“pr_hoo_tue”); ?>
Wed: f(“pr_hoo_wed”); ?>
Thurs: f(“pr_hoo_thu”); ?>
Fri: f(“pr_hoo_fri”); ?>
Sat: f(“pr_hoo_sat”); ?>
Sun: f(“pr_hoo_sun”); ?>

f(“pr_agency”)) { ?>

Agency

f(“pr_agency”); ?>

Location

f(“pr_address1”); ?>
f(“pr_address2”)<>“”) {
echo $db_res->f(“pr_address2”) . “
“; } ?>
f(“pr_city”); ?>, f(“pr_state”); ?> f(“pr_zip”); ?>

Additional Info

  • Wheelchair accessible: f(‘pr_wheelchair’); ?>
  • Transportation provided: f(‘pr_transportation’); ?>

Services

    f(“pr_pk”);
    $db_sv->query($sql);

    $db_sv2 = new ps_DB;

    while ($db_sv->next_record()) {
    $sql = “SELECT * FROM services WHERE sv_pk=” . $db_sv->f(“sv_fk”);
    $db_sv2->query($sql);
    $db_sv2->next_record();

    echo “

  • ” . $db_sv2->f(‘sv_name’) . “
  • “;

    } // END WHILE ?>

Still don’t see what you’re looking for? View our full provider list »

NEWSLETTER SIGN-UP

We have stuff we like to share and we'd love to share it with you.