Physician Directory"; //for viewing by specialty if ($_GET['d'] == 1) { echo "View Physicians by Name"; $specialties = new database("localhost", "uhswvcom", "5Sk25fT!"); $specialties->query("SELECT * FROM uhswvcom_himg.specialty order by specialty_name"); for ($i=0; $i<$specialties->numberofrows(); $i++) { $rowset1 = $specialties->getrow(); echo "

" . $rowset1['specialty_name'] . "

"; $database->query("SELECT * FROM uhswvcom_himg.physician p NATURAL JOIN uhswvcom_himg.physician_specialty ps WHERE p.physician_enabled = 1 AND ps.specialty_id = " . $rowset1['specialty_id']); for ($j=0; $j<$database->numberofrows(); $j++) { $rowset2 = $database->getrow(); echo "" . $rowset2['physician_last'] . ", " . $rowset2['physician_first'] . " " . $rowset2['physician_middle'] . " " . $rowset2['physician_title'] . "
"; } } } //for viewing by name else { echo "View Physicians by Specialty

"; //make two columns for physician links. each for loop represents a column echo "
"; $database->query("SELECT * FROM uhswvcom_himg.physician WHERE physician_enabled = 1 order by physician_last"); $numberofphysicians = $database->numberofrows(); $halfphysicians = $numberofphysicians / 2; for ($i=0; $i<$halfphysicians; $i++) { $row = $database->getrow(); echo "" . $row['physician_last'] . ", " . $row['physician_first'] . " " . $row['physician_middle'] . " " . $row['physician_title'] . "
"; } if ($numberofphysicians % 2 != 0) $halfphysicians++; echo "
"; for ($i=$halfphysicians; $i<$numberofphysicians; $i++) { $row = $database->getrow(); echo "" . $row['physician_last'] . ", " . $row['physician_first'] . " " . $row['physician_middle'] . " " . $row['physician_title'] . "
"; } echo "

"; } require_once ('inc/inc.footer.php'); ?>