$max or $height > $max){
if($width > $height){
$height = round(($max/$width)*$height);
$width = $max;
}elseif($width < $height){
$width = round(($max/$height)*$width);
$height = $max;
}else{
$width = $max;
$height = $max;
}
}
return 'width = "'.$width.'" height = "'.$height.'"';
}
/* end of picture measures */
$address = 'images/userdog';
?>
';
} else {
echo '
';
}
echo '
';
/*koera nimi*/
echo $row['dog_name'];
echo '
';
/*koera sugu*/
echo $row['breed'];
echo '
';
/*koera vanus*/
$agestamp = time()-$row['dog_age'];
echo date('d.m.Y',$row['dog_age']).' ('.ceil($agestamp/60/60/24/365).' a.)';
echo '
Kaal:
';
/*koera kaal*/
echo $row['dog_weight'];
echo ' kg
';
/*koera mikrokiip*/
if($row['microchip']!=''){
echo '
Mikrokiip:
';
echo $row['microchip'];
echo '
';
} else {
echo '
Mikrokiip:
Puudub
';
}
/*koera allergiad*/
if($row['allergies']!=''){
echo '
Allergiate info:
';
echo $row['allergies'];
echo '
';
}
/*koera toitumisalane info*/
if($row['nutrition_info']!=''){
echo '
Toitumislaane info:
';
echo $row['nutrition_info'];
echo '
';
}
/*koera vaktsiin*/
if($row['vaccine']!=''){
echo '
Vaktsineerimiste info:
';
echo $row['vaccine'];
echo '
';
}
/*koera sugu*/
if($row['sex']!=''){
echo '
Sugu:
';
echo $row['sex'];
echo '
';
}
/*koera asukoht*/
if($row['location']!=''){
echo '
Asukoht:
';
echo $row['location'];
echo '
';
}
/*koera eluviis*/
if($row['lifestyle']!=''){
echo '
Eluviis:
';
echo $row['lifestyle'];
echo '
';
}
/*koera lühikirjeldus*/
if($row['description']!=''){
echo '
Lühikirjeldus:
';
echo $row['description'];
echo '
';
}
/*koera värvus*/
if($row['color']!=''){
echo '
Värvus:
';
echo $row['color'];
echo '
';
}
/*koera tiinus*/
if($row['dog_pregnant']==1){
echo '
Tiine:
Jah
';
} else {
echo '
Tiine:
Ei
';
}
echo '
';
/*koera omaniku nimi*/
$queryownername = mysql_query('SELECT * FROM wp_dog_base AS wdb INNER JOIN wp_users AS wu ON wu.ID='.$row['owners_id'].'');
$row = mysql_fetch_array($queryownername);
if($row['display_name']!=''){
echo '
Omaniku nimi:
'.$row['display_name'].'
';
}
/*koera omaniku aadress*/
if($row['owners_address']!=''){
echo '
Omaniku aadress:
';
echo $row['owners_address'];
echo '
';
}
echo '
Koera saavutused
';
$querydogevents = mysql_query('SELECT * FROM wp_dog_events WHERE dog_id="'.$dogid.'" ORDER BY event_date DESC');
if(mysql_num_rows($querydogevents)!=0){
while($row = mysql_fetch_array($querydogevents)){
echo '
Üritus:
'.$row['event'].'
Ürituse lühikirjeldus:
'.$row['event_description'].'
Ürituse aeg:
'.date('d.m.Y',$row['event_date']).'
';
}
} else {
echo 'Üritusi ja näitusi pole.
';
}
} else {
echo 'Koera omanik on valinud, et ei näita selle koera CV-d!';
}
?>