Search Based on Symptom
|
Search Based on Disease
|
Common symptoms:
|
Common diseases:
|
//connect to your database ** EDIT REQUIRED HERE **
mysql_connect("localhost","iotiubco_iotiub","voivoda1975"); //(host, username, password)
//specify database ** EDIT REQUIRED HERE **
mysql_select_db("iotiubco_iotiub") or die("Unable to select database"); //select which database we're using
$query="set names utf8";
mysql_query($query);
?> |
|
if (isset($_GET['medical_cause']))
{
$word = $_GET['medical_cause'];
$vid = $_GET['vid'];
$querya="insert into searches_ytpo (word,vid) values
('$word','$vid')";
mysql_query($querya) or die(mysql_error());
}
else
{echo"Gynaecology Anatomy Physiology Anesthesiology Reanimation Biotechnology Hospitals Internal Genetics Dermatology Venereology Pediatrics Endocrinology Gastroenterology Healthcare Management Infectious Diseases Cardiology Clinical Laboratory Evidence-based Medical library informatics books equipment Microbiology Neurology Oncology Hematology Orthopedics Traumatology Ophthalmology Psychiatry Radiology Rehabilitation Social Sports Dentistry Forensic Toxicology Ear, Nose Throat Urology Pharmacy Surgery"; }
$limit=10;
if (isset($_GET['query']))
{
$keyword = @$_GET['query'] ;
}
else
{
$keyword = @$_GET['medical_cause'] ;
}
function hightlight($str, $keywords = '')
{
$keywords = preg_replace('/\s\s+/', ' ', strip_tags(trim($keywords))); // filter
$style = 'highlight';
$style_i = 'highlight_important';
/* Apply Style */
$vara = '';
foreach(explode(' ', $keywords) as $keyword)
{
$replacement = "".$keyword."";
$vara .= $replacement." ";
$str = str_ireplace($keyword, $replacement, $str);
}
/* Apply Important Style */
$str = str_ireplace(rtrim($vara), "".$keywords."", $str);
return $str;
}
$query = "
select * from ytpoai
where
match (symp,cause,descr,comment) against ('$keyword')
";
$s = (isset($_GET['s'])) ? $_GET['s'] : 0 ;
$numresults=mysql_query($query);
$numrows=mysql_num_rows($numresults);
// get results
$query .= " limit $s,$limit";
$res = mysql_query($query) or die("error");
if ($numrows == 0)
{
echo" The term was not found in symptom vs. cause database.
You can try to search in terms and acronym search.
";
?>
Or try special medical search
|
|
echo"
";
}
else
{
echo" Medical symptoms and causes for $keyword ";
?>|
Special medical search: |
| | Medicine search: |
|
|
echo"
";
$count = 1 + $s;
while($row = MySQL_fetch_array($res)) {
$symp = $row["symp"];
$cause = $row["cause"];
$descr = $row["descr"];
$comment = $row["comment"];
$descr = hightlight($descr, $keyword);
if ($count==1 || $count==5 || $count==8 || $count==1 || $count==1 || $count==11 || $count==16 || $count==19 || $count==21 || $count==26|| $count==29 || $count==31 || $count==36|| $count==39)
{
echo "
|
|
| Symptom: $symp | Cause: $cause |
Find all causes , books and medicines for this symptom special medical search for $symp";
?>
echo " | Find all symptoms , books and medicines of this cause special medical search for $cause";
?>
echo" |
Description: $descr ";
?>
echo" |
";
}
else
{
echo "
|
|
| Symptom: $symp | Cause: $cause |
Find all causes , books and medicines for this symptom special medical search for $symp";
?>
echo " | Find all symptoms , books and medicines of this cause ) special medical search for $cause";
?>
echo" |
Description: $descr
|
";
}
$count++ ;
}
?>
$currPage = (($s/$limit) + 1);
// next we need to do the links to other results
if ($s>=1) {
$prevs=($s-$limit);
print "