502.495.5040

pharmacy

Open(“PROVIDER=MSDASQL;DRIVER={SQL SERVER}; Server=omca.biz;Database=providernetbiz;UID=acmo_read;PWD=acmo_read!;”);
// SQL statement to build recordset.
//groupsource specialty county city zipcode lastname
$rs = $conn->Execute(“sp_getpharmacy2 ‘”.$county.”‘,'”.$city.”‘,'”.$zip.”‘,'”.$lastname.”‘”);
//$rs = $conn->Execute(“sp_getpharmacy2 ‘All’,’All’,’All’,””);
//$rs = $conn->Execute(“select top 20 * from pharmacy”);

$searchdata = ‘

‘;
$searchdata=$searchdata.’

‘;

while (!$rs->EOF)
{

//$f1 = “groupname”;
$f1 = $rs->Fields(“group_name”);
$f2 = $rs->Fields(“group_street”);
$f3 = $rs->Fields(“group_city”);
$f4 = $rs->Fields(“group_state”);
$f5 = $rs->Fields(“group_zip”);
$f6 = formatPhone($rs->Fields(“group_phone”));

//$searchdata=$searchdata.”

“.$f1.”

“;

$searchdata=$searchdata.”

“;
$searchdata=$searchdata.”

“;
$searchdata=$searchdata.’

‘;
$searchdata=$searchdata.’

‘;
$searchdata=$searchdata.”

“;
$searchdata=$searchdata.”

“;

$rs->MoveNext();

}
$searchdata=$searchdata.”

 Name   Address   Phone   MAP 
“.$f1.” ‘.$f2.” “.$f3.” “.$f4.” “.$f5.’ ‘.$f6.’ Map
“;
$rs->Close();

return $searchdata ;

}

function getdata2()
{
$groupsource= $_POST[“groupsource”];
$lastname = $_POST[“lastname”];
$groupname = $_POST[“groupname”];
$specialty = $_POST[“Specialty”];
$city = $_POST[“city”];
$zip = $_POST[“zip”];
$county = $_POST[“county”];

//county city zipcode lastname

$conn = new COM(“ADODB.Connection”) or die(“Cannot start ADO”);
$conn->Open(“PROVIDER=MSDASQL;DRIVER={SQL SERVER}; Server=omca.biz;Database=providernetbiz;UID=acmo_read;PWD=acmo_read!;”);
// SQL statement to build recordset.
//groupsource specialty county city zipcode lastname
//$rs = $conn->Execute(“sp_getpharmacy ‘”.$groupsource.”‘,'”.$specialty.”‘,'”.$county.”‘,'”.$city.”‘,'”.$zip.”‘,'”.$lastname.”‘”);
$rs = $conn->Execute(“select top 10 * from pharmacy”);
$searchdata = ‘

‘;
//$searchdata = $searchdata.’

‘;
echo ‘ TESasfdasfdaT ‘;
while (!$rs->EOF)
{
$fv1=””;
$fv2=””;
$fv3=””;
$fv4=””;

$f1 = $rs->Fields(“group_name”);
$f2 = $rs->Fields(“group_street”);
$f3 = $rs->Fields(“group_city”);
$f4 = $rs->Fields(“group_state”);
$f5 = $rs->Fields(“group_zip”);
$f6 = formatPhone($rs->Fields(“group_phone”));
$f15=$rs->Fields(“street”);

$fv1 = $rs->Fields(“last_name”);
$fv2 = $rs->Fields(“middle_name”);
$fv3 = $rs->Fields(“first_name”);
$fv4 = $rs->Fields(4);

//3 2 1 4
$fv = $fv3->value.” “.$fv2->value.” “.$fv1->value.” “.$fv4->value;

$fv = “test”;
$fv5 = $rs->Fields(5); //pract
$fv6 = $rs->Fields(6); //addressmiddle
$fv7 = $rs->Fields(7); //citysuffix
$fv8 = $rs->Fields(8); //state
$fv9 = $rs->Fields(9); //zip
$fv14 = $rs->Fields(14); //state

//$searchdata=$searchdata.”

“;
$searchdata =$searchdata.’

‘.$fv->value.’

‘;
$rs->MoveNext();
}
//$searchdata=$searchdata.”

 Name   Practice   Specialty   Address   Phone   MAP 
“.$fv.” “;
//$searchdata=$searchdata.$fv5->value.’
‘.$fv14->value.’ ‘.$f15->value.’ ‘.$f6.” Map

“;
$searchdata=$searchdata.”

“;
$rs->Close();

return $searchdata;
}

function loadresults()
{
//echo “

Your results would show here”;
$groupsource= $_POST[“groupsource”];
$lastname = $_POST[“lastname”];
$groupname = $_POST[“groupname”];
//$specialty = $_POST[“Specialty”];
$city = $_POST[“city”];
$zip = $_POST[“zip”];
$county = $_POST[“county”];
echo “Results from Search:
“;
//echo “Gatekeeper Selection: “.$groupsource.”
“;
//echo “Specialty: “.$specialty.”
“;
echo “City: “.$city.”
“;
echo “Zip Code: “.$zip.”
“;
echo “County: “.$county.”
“;
echo “Name: “.$lastname.”
“;
echo ” 
“;
echo ‘RESET
‘;
echo ” 

“;

echo getdata();

}

if (!isset($_POST[‘submit’]))
{ // if page is not submitted to itself echo the form
echo loadform();
} else
{
echo loadresults();
}
?>