"; $outtext .= ""; $outtext .= ""; $outtext .= "".DogFullName($id, FALSE, FALSE, array('color' => '#ce185d'))."".($addinfo?"
$addinfo
":"").""; $outtext .= ""; $outtext .= ""; return $outtext; } function DogBlockSm ($id, $addinfo = FALSE) { $outtext .= ""; $outtext .= ""; $outtext .= ""; $outtext .= ""; $outtext .= ""; $outtext .= ""; $outtext .= ""; $outtext .= "
".DogFullName($id, FALSE, FALSE, array('color' => '#ce185d'))."".($addinfo?"
$addinfo
":"")."
"; return $outtext; } function DogFullName($id, $withlink=FALSE, $addinfo = FALSE, $params = FALSE) { GLOBAL $if; // ìàññèâ âèçóàëüíûõ ïàðàìåòðîâ if(!$id) $retstr=$if['dog_name_unknown']; else { $row = data_select( array('id' => 0, ($if['id'] == 1)?'name':'engname' => ($if['id'] == 1)?0:'name', 'rkf' => 0, 'owner' => 0, 'breeder' => 0, 'countryid' => 0 , 'active' => 0), array('id' => (int)$id), array('dogs' => 0)); $retstr = str_replace("&", "&", $row['name']?$row['name']:$id); $rkf = $row['rkf']; if($params['upper']) $retstr = "$retstr"; if($params['blank']) $addinfo=" target=_blank>"; else $addinfo=">"; if($withlink && $id && !$params['editlink']) $retstr=""; if($withlink && $id && $params['editlink']) $retstr=""; if(!$withlink && $params['color']) $retstr="$retstr"; if($params['activeness']) $retstr .= ($row['active'] == 1)?" (+)":" (-)"; }; return $retstr; }; function DogSex($sex) { GLOBAL $if; switch($sex) { case 1: $retstr = $if['common_female']; break; case 2: $retstr = $if['common_male']; break; }; return $retstr; } function ShowCompType($id) { GLOBAL $if; $query = "SELECT * FROM comptype WHERE id=$id"; SQLConn(); $row=mysql_fetch_array(mysql_query($query)); if($row['name']) $retstr = $row['name']; else $retstr=$if['dog_name_unknown']; return $retstr; }; function Alted($dtstr) { GLOBAL $if; if($dtstr) $retstr = $dtstr; else $retstr = $if['dog_name_unknown'];; return $retstr; }; function ShowDogPhoto($id,$n,$size = 350, $withlink=FALSE) { switch($n) { case 0: $w=$size; $border=1; break; case 1: $w=$size; $border=1; break; case 2: $w=$size; $border=1; break; case 3: $w=$size; $border=1; break; case 4: $w=$size; $border=1; break; }; if($withlink && file_exists("ph/$id-$n.jpg")) { $before=""; $after=""; }; if(file_exists("ph/$id-$n.jpg")) $retstr=""; else $retstr=""; return $before.$retstr.$after; }; function ShowDogPhotoLB($id,$n,$size = 350, $withlink=FALSE) { switch($n) { case 0: $w=$size; $border=1; break; case 1: $w=$size; $border=1; break; case 2: $w=$size; $border=1; break; case 3: $w=$size; $border=1; break; case 4: $w=$size; $border=1; break; case 5: $w=$size; $border=1; break; case 6: $w=$size; $border=1; break; case 7: $w=$size; $border=1; break; }; if($withlink && file_exists("ph/$id-$n.jpg")) { $before=""; $after=""; }; if(file_exists("ph/$id-$n.jpg")) $retstr=""; else $retstr=""; return $before.$retstr.$after; }; function ShowDogXrays($id,$size = 350, $type=1) { if($type == 1) $n = "hd"; else $n = "ed"; if(file_exists("xrays/$id-$n.jpg")) { // $before=""; $before=""; $after=""; }; if(file_exists("xrays/$id-$n.jpg")) $retstr=""; else $retstr=""; return $before.$retstr.$after; }; function ShowTitles($id,$ebr="
",$limit=FALSE) { GLOBAL $if; $qstr = "select ". (($if['id'] != 1 || $limit)?"engname AS name":"name") .",count,iscount,color,comment from titlestype,titles WHERE titles.dogid=".(int)$id." AND titles.tid=titlestype.id ORDER BY rang,name"; $dta=mysql_query($qstr); $i = 0; if($dta) { while($row=mysql_fetch_array($dta)) { $i++; if($limit>0 && $i > $limit) { $retstr = $retstr . "$ebr..."; break; } if($limit>0) $row['name'] = str_replace("(USSR)", "", $row['name']); if($row['iscount'] && $row['count'] && ($row['count']>1)) $retstr = $retstr.($retstr?"$ebr":"")."{$row['count']} x {$row['name']}".($row['comment']?" {$row['comment']}":"")."\n"; else $retstr = $retstr.($retstr?"$ebr":"")."{$row['name']}".($row['comment']?" {$row['comment']}":"").""; } } return $retstr; }; function ShowCert($id,$ebr="
") { SQLConn(); $qstr = "SELECT name,count from certtype,cert WHERE cert.dogid=".(int)$id." AND cert.certid=certtype.id ORDER BY rang, certid"; $dta=mysql_query($qstr); if($dta) while($row=mysql_fetch_array($dta)) $retstr = $retstr.($retstr?"$ebr":"")."{$row['count']} x {$row['name']}"; return $retstr; }; function ShowRKF($id) { if($id) $retstr = data_select( array('rkf' => 0, 'addrkf' => 0), array('id' => (int)$id), array('dogs'=>0)); return $retstr['rkf']. ($retstr['addrkf']?" / {$retstr['addrkf']}":""); }; function ShowNames($id,$table,$eng = FALSE) { GLOBAL $if; if(!$id) $id="NULL"; $retstr = data_select( array($eng?'engname':'name' => $eng?'name':0), array('id' => (int)$id), $table); if($if[$retstr['name']]) $retstr['name'] = $if[$retstr['name']]; return $retstr['name']; }; function ShowHealth($id,$ebr="
") { GLOBAL $if; $hd = data_select('*', array('dogid' => (int)$id), 'doghealth'); if($hd['pl_left']) $plstr = ShowNames($hd['pl_left'],'pl'); if($hd['pl_right']) $plstr .= ($plstr?"/":"").ShowNames($hd['pl_right'],'pl'); if($hd['tipss']) $tipssstr = $if['dog_title_tipss'].": ".ShowNames($hd['tipss'],'dna'); if($hd['pra']) $prastr = $if['dog_title_pra'].": ".ShowNames($hd['pra'],'dna'); if($hd['pd']) $pdstr = $if['dog_title_pd'].": ".ShowNames($hd['pd'],'dna'); if($hd['ca']) $castr = $if['dog_title_ca'].": ".ShowNames($hd['ca'],'dna'); if($hd['hd_left']) $hdstr = ShowNames($hd['hd_left'],'hd'); if($hd['hd_right']) $hdstr .= ($hdstr?"/":"").ShowNames($hd['hd_right'],'hd'); if($hd['ed_left']) $edstr = ShowNames($hd['ed_left'],'ed'); if($hd['ed_right']) $edstr .= (($edstr != "")?"/":"").ShowNames($hd['ed_right'],'ed'); $hdstr = (($hd['hd_left']||$hd['hd_right'])?"HD-":"").$hdstr; $edstr = (($hd['ed_left']||$hd['ed_right'])?"ED-":"").$edstr; $plstr = (($hd['pl_left']||$hd['pl_right'])?"PL-":"").$plstr; if($plstr) $healthstr .= ($healthstr?$ebr:"").$plstr; if($hdstr) $healthstr .= ($healthstr?$ebr:"").$hdstr; if($edstr) $healthstr .= ($healthstr?$ebr:"").$edstr; if($tipssstr) $healthstr .= ($healthstr?$ebr:"").$tipssstr; if($prastr) $healthstr .= ($healthstr?$ebr:"").$prastr; if($pdstr) $healthstr .= ($healthstr?$ebr:"").$pdstr; if($castr) $healthstr .= ($healthstr?$ebr:"").$castr; return $healthstr; } function ShowStudy($id,$ebr="
") { SQLConn(); $qstr = "select name,level,islevel from studytype,study WHERE study.dogid=".(int)$id." AND study.studyid=studytype.id ORDER BY studyid"; $dta=mysql_query($qstr); if($dta) { while($row=mysql_fetch_array($dta)) if($row['islevel']) $retstr = $retstr. ($retstr?$ebr:"")."{$row['name']} - {$row['level']}"; else $retstr = $retstr.($retstr?$ebr:"")."{$row['name']}"; } return $retstr; }; function Is_admin($uid=FALSE) { SQLConn(); if($uid) $dta = data_select(array('role'=>0), array('id' => (int)$uid), array('users' => 0)); if($dta['role'] == 1) $retstr = TRUE; else $retstr = FALSE; return $retstr; }; function Whois($id,$table) { if(!$id || $id<1 || !$table) $retstr=FALSE; else { $dt = data_select(array('userid'=>0), array('id' => (int)$id), array($table=>0)); $retstr= $dt['userid']; } return $retstr; }; function Is_Vip($userid) { $dt = data_select('vip', array('id' => (int)$userid), 'users'); return $dt['vip'] || is_admin($userid); } function UpdateDate($dogid) { $chk = data_select('date_up', array('dogid' => $dogid), 'upd'); if(!$chk) mysql_query("INSERT INTO upd(dogid, date_up) VALUES($dogid, \"".Date("Ymd")."\")"); else mysql_query("UPDATE upd SET date_up=\"".Date("Ymd")."\" WHERE dogid=".(int)$dogid); }; /* function UpdateDate($dogid) { mysql_query("UPDATE dogs SET dateupd=\"".ConvertDate(Date("d.m.Y"),TRUE)."\" WHERE id=".(int)$dogid); }; */ function IsActive($dogid) { if($dogid == "") $dogid="NULL"; $row = data_select(array('active' => 0), array('id' => (int)$dogid), array('dogs' => 0)); return $row['active']; }; function xs($str) { // $retstr = preg_replace("/\'/","`",$str); // return $retstr; return $str; }; function xz($str) { $retstr = ereg_replace(",",".",$str); return $retstr; }; function xs_a($arr) { foreach($arr as $an => $av) $arr['$an'] = xs($av); return $arr; }; function ShowRights($dogid, $pid) { $dta = data_select(array('value' => 0), array('dogid' => (int)$dogid,'pid' => (int)$pid), array('fotorights'=>0)); $retstr = str_replace("&", "&", $dta['value']); return $retstr; }; function Shield($textstr, $search = FALSE) { $retstr = htmlspecialchars(strip_tags($textstr)); if($search) { $retstr = trim($retstr); $retstr = str_replace("-","%",$retstr); $retstr = str_replace(" ","%",$retstr); $retstr = strtoupper($retstr); } return $retstr; }; function BadPlus($userid) { $bc = mysql_fetch_array(mysql_query("SELECT badcount FROM users WHERE id=$userid")); $bc = $bc['badcount'] + 1; mysql_query("UPDATE users SET badcount=$bc ".(($bc>2)?", active = 0 ":"")." WHERE id=$userid"); } function LoadPhoto($id,$app,$newfoto,$type=1) { GLOBAL $if; if(!$id) $err .= $if['err_dog_not_selected']; $x = GetImageSize($newfoto); if($x['mime'] != "image/jpeg" && $x['mime'] != "image/gif") $err .= $if['err_photo_not_jpeg']; if(!$err) { switch($type) { case 1: $newname = "ph/$id-$app.jpg"; break; case 2: $newname = "xrays/$id-hd.jpg"; break; case 3: $newname = "xrays/$id-ed.jpg"; break; case 4: $newname = "shows/$id-$app.jpg"; break; case 5: $newname = "archive/$id-$app.jpg"; break; case 6: $newname = "docs/$id-$app.jpg"; break; case 7: $newname = "judges/$id-$app.jpg"; break; } $nx = (($x[0]<940) || ($type == 5))?$x[0]:940; $ny = round($nx/$x[0]*$x[1]); if($x['mime'] == "image/jpeg") $b = imageCreateFromJpeg($newfoto); else $b = imageCreateFromGif($newfoto); $a = imagecreatetruecolor($nx, $ny); ImageCopyResized($a, $b, 0, 0, 0, 0, $nx, $ny, $x[0], $x[1]); $errflag = ImageJpeg($a,$newname); } return $err; }; function NormURL($urltxt) { if(substr($urltxt,0,7) != "http://") $urltxt = "http://$urltxt"; return $urltxt; } function AddStatRecord($id) { $ip = $_SERVER['REMOTE_ADDR']; mysql_query("INSERT INTO dogstat VALUES(".(int)$id.", '$ip', '".ConvertDate(Date("d.m.Y"),TRUE)."', '".Date("H:i:s")."')"); } function ShowDogStat($id) { $d = mysql_query("SELECT COUNT(id) as cnt FROM dogstat WHERE id=$id"); if(mysql_num_rows($d)) $r = mysql_fetch_array($d); return "×èñëî ïîñåùåíèé ñòðàíèöû - {$r['cnt']}"; } function DogPhotoUpd($id) { if(file_exists("ph/$id-0.jpg")) $p0 = 1; else $p0 = 0; if(file_exists("ph/$id-1.jpg")) $p1 = 1; else $p1 = 0; if(file_exists("ph/$id-2.jpg")) $p2 = 1; else $p2 = 0; if(file_exists("ph/$id-3.jpg")) $p3 = 1; else $p3 = 0; if(file_exists("ph/$id-4.jpg")) $p4 = 1; else $p4 = 0; if(mysql_num_rows(mysql_query("SELECT id FROM photos WHERE id=".(int)$id))>0) mysql_query("UPDATE photos SET p0=$p0, p1=$p1, p2=$p2, p3=$p3, p4=$p4 WHERE id=".(int)$id); else mysql_query("INSERT INTO photos VALUES(".(int)$id.",$p0,$p1,$p2,$p3,$p4)"); } function DogJointPicsUpd($id) { if(file_exists("xrays/$id-hd.jpg")) $hd = 1; else $hd = 0; if(file_exists("xrays/$id-ed.jpg")) $ed = 1; else $ed = 0; if(mysql_num_rows(mysql_query("SELECT id FROM jointpics WHERE id=".(int)$id))>0) mysql_query("UPDATE jointpics SET hd=$hd, ed=$ed WHERE id=".(int)$id); else mysql_query("INSERT INTO jointpics VALUES(".(int)$id.",$hd,$ed)"); } function BISResults($showid) { GLOBAL $if; $sn = data_select('*', array('id' => (int)$showid), 'shows'); if($sn['br']>0) $outr[$sn['br']] .= (($outr[$sn['br']]<>"")?", ":"")."{$if['show_bis_reproductor']} - {$sn['br_p']}"; if($sn['bpair_m']>0) { $outr[$sn['bpair_m']] .= (($outr[$sn['bpair_m']]<>"")?", ":"")."{$if['show_bis_pair']} - {$sn['bpair_p']}"; $outr[$sn['bpair_f']] .= (($outr[$sn['bpair_f']]<>"")?", ":"")."{$if['show_bis_pair']} - {$sn['bpair_p']}"; } if($sn['bb']>0) $outr[$sn['bb']] .= (($outr[$sn['bb']]<>"")?", ":"")."{$if['show_bis_baby']} - {$sn['bb_p']}"; if($sn['bp']>0) $outr[$sn['bp']] .= (($outr[$sn['bp']]<>"")?", ":"")."{$if['show_bis_puppy']} - {$sn['bp_p']}"; if($sn['bj']>0) $outr[$sn['bj']] .= (($outr[$sn['bj']]<>"")?", ":"")."{$if['show_bis_junior']} - {$sn['bj_p']}"; if($sn['bs']>0) $outr[$sn['bs']] .= (($outr[$sn['bs']]<>"")?", ":"")."{$if['show_bis_senior']} - {$sn['bs_p']}"; if($sn['big']>0) $outr[$sn['big']] .= (($outr[$sn['big']]<>"")?", ":"")."{$if['show_bis_big']} - {$sn['big_p']}"; if($sn['bis']>0) $outr[$sn['bis']] .= (($outr[$sn['bis']]<>"")?", ":"")."{$if['show_bis_bis']} - {$sn['bis_p']}"; return $outr; } function ConvertDate($dt,$rev=FALSE) { // $rev - èç íîðìàëüíîé â MySQL, NOT $rev - èç MySQL â íîðìàëüíóþ if($rev) $retstr = substr($dt,6,4)."-". substr($dt,3,2)."-". substr($dt,0,2); else $retstr = substr($dt,8,2).".". substr($dt,5,2).".". substr($dt,0,4); return $retstr; }; function NormNameString($str) { // ôóíêöèÿ ïðåîáðàçóþùàÿ ñòðîêó - èìÿ (ôàìèëèþ, îò÷åñòâî) â âèä çàãëàâíàÿ-ñòðî÷íûå $retstr = trim($str); $retstr = strtoupper(substr($retstr,0,1)).strtolower(substr($retstr,1,strlen($retstr)-1)); return $retstr; } function NormDogName($str) { while($n = strpos($str, " ")) { $part = substr($str, 0, $n); $retstr .= ($retstr?" ":"") . NormNameString($part); $str = substr($str, $n + 1); } $retstr .= ($retstr?" ":"") . NormNameString($str); $retstr = str_replace(" Z ", " z ", $retstr); $retstr = str_replace(" Ñ ", " ñ ", $retstr); $retstr = str_replace(" S ", " s ", $retstr); $retstr = str_replace(" Vom ", " vom ", $retstr); $retstr = str_replace(" Fci", " FCI", $retstr); $retstr = str_replace(" Von ", " von ", $retstr); $retstr = str_replace(" Von Den ", " von den ", $retstr); $retstr = str_replace(" Von Der ", " von der ", $retstr); $retstr = str_replace(" V.d. ", " v.d. ", $retstr); $retstr = str_replace(" Iz ", " iz ", $retstr); $retstr = str_replace(" Èç ", " èç ", $retstr); $retstr = str_replace(" Ze ", " ze ", $retstr); $retstr = str_replace("-k", "-K", $retstr); $retstr = str_replace("-m", "-M", $retstr); return($retstr); } function UpdateDogField($id, $ra) { GLOBAL $if; SQLConn(); $q = "UPDATE dogs SET "; foreach($ra AS $key => $value) { $value = Shield($value); $ustr .= ($ustr?", ":"") . "$key=\"$value\""; } $q .= $ustr . " WHERE id=".(int)$id." LIMIT 1"; if(mysql_query($q)) { UpdateDate($id); $retstr = FALSE; } else $retstr = "

".mysql_error()."

"; return $retstr; } function ErrMsg($msg) { return "
$msg
"; } ?> "; echo ""; // echo " {$if['main_breed']}" .($id?(" - ".DogFullName($id)." ID: $id"):" - {$if['main_title']}").""; echo " SHIH-TZU" .($id?(" - ".DogFullName($id)." ID: $id"):" - Virtual Breed Database").""; echo " "; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo " "; // echo $jq?$jq:""; echo ""; echo "
"; } function Page_AuthForm($userid = FALSE) { GLOBAL $if; if($userid) { $outtext .= "{$if['mess_user_authorized']} ".ShowNames($userid,'users')."."; } else { $outtext .= "
"; $outtext .= " "; $outtext .= " "; $outtext .= " "; $outtext .= " "; $outtext .= " "; $outtext .= " "; $outtext .= " "; $outtext .= " "; $outtext .= " "; $outtext .= " "; $outtext .= "
{$if['index_reg_login']}:
{$if['index_reg_password']}:
"; $outtext .= "
"; } return $outtext; } function Page_Title($userid = FALSE) { GLOBAL $if; $outtext = "
"; GLOBAL $if; $outtext .= ""; $outtext .= ""; $outtext .= " "; $outtext .= " "; $outtext .= " "; $outtext .= ""; $outtext .= "

{$if['title_header']}

"; $outtext .= "
"; $outtext .= Page_AuthForm($userid); $outtext .= "
"; $outtext .= " "; $outtext .= "
"; $outtext .= "
"; return $outtext; } function LangUrl($urlstr, $langid = 1) { $islang = strpos($urlstr, 'userif'); $isq = strpos($urlstr, '?'); if($islang !== FALSE) $urlstr[$islang+7] = $langid; elseif($isq) $urlstr = $urlstr ."&userif=$langid"; else $urlstr = $urlstr ."?userif=$langid"; return $urlstr; } function Page_Menu($userid = FALSE) { GLOBAL $if; $ustr = "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; $outtext .= "
"; $outtext .= ""; $outtext .= ""; $outtext .= " "; $outtext .= " "; $outtext .= " "; $outtext .= " "; $outtext .= " "; $outtext .= (!$userid?" ":""); // $outtext .= " "; $outtext .= " "; $outtext .= " "; $outtext .= " "; $outtext .= ""; $outtext .= "
{$if['menu_index']} {$if['menu_results']} {$if['menu_kennels']} {$if['menu_judges']} {$if['index_stat']} {$if['menu_registration']} «?» {$if['menu_help']}
"; $outtext .= "
"; return $outtext; } function Page_Alphabet() { $outtext .= "
"; $outtext .= "
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z � Б В Г Д Е Ж З И К Л М � О П Р С Т У Ф Х Ц Ч Ш Щ Э Ю Я
"; $outtext .= "
"; return $outtext; } function Page_Operations($id = FALSE, $userid = FALSE, $div = TRUE) { GLOBAL $if; if($div) $outtext .= "
"; if($userid) { if($id) { $tmp = data_select( array('sex' => 0, 'fatherid' => 0, 'motherid' => 0, 'breeder' => 0, 'kennelid' => 0, 'datebirth' => 0), array('id' => (int)$id), 'dogs'); if($tmp['sex'] == 2) $male = TRUE; else $male=FALSE; $lmstr = ($tmp['fatherid']?"fatherid={$tmp['fatherid']}":""); $lmstr = ($lmstr?"&":"").($tmp['motherid']?"motherid={$tmp['motherid']}":""); } if(is_admin($userid)) $rc = data_select(array('COUNT(id)' => 'cnt'), array('active' => 0), 'dogs'); $outtext .= ""; $outtext .= ""; $outtext .= " "; $outtext .= " "; $outtext .= " "; if(is_admin($userid)) { $outtext .= " "; } $outtext .= " "; $outtext .= ""; $outtext .= "
"; // добавление �обак $outtext .= " "; $outtext .= " "; // вы�тавки $outtext .= " "; $outtext .= " "; // �правочники $outtext .= " "; $outtext .= " "; // �и�темные �правочники $outtext .= " "; $outtext .= " "; // �лужебные $outtext .= " "; $outtext .= "
"; } else $outtext .= ""; if($div) $outtext .= "
"; return $outtext; } function Page_Search () { GLOBAL $if; $outtext .= ""; return $outtext; } function Page_BaseSearch() { GLOBAL $if; $outtext .= ""; $outtext .= ""; $outtext .= " "; $outtext .= " "; $outtext .= ""; $outtext .= "
{$if['search_show_advanced']} ↓
"; return $outtext; } function Page_AdvSearch () { GLOBAL $if; $outtext .= "
"; $outtext .= ""; $outtext .= ""; $outtext .= " "; /* $outtext .= " "; */ $outtext .= " "; $outtext .= " "; $outtext .= " "; $outtext .= ""; $outtext .= ""; $outtext .= " "; $outtext .= " "; $outtext .= " "; $outtext .= " "; $outtext .= ""; $outtext .= ""; $outtext .= " "; $outtext .= " "; $outtext .= " "; $outtext .= ""; $outtext .= ""; $outtext .= " "; $outtext .= " "; $outtext .= ""; $outtext .= "
"; $outtext .= "
ID
"; $outtext .= "
"; $outtext .= "
"; $outtext .= "
{$if['common_owner']}
"; $outtext .= "
"; $outtext .= "
"; $outtext .= "
{$if['title_titles']}
"; $outtext .= "
".FormList('stitleid', 'titlestype', FALSE, array('eng' => TRUE))."
"; $outtext .= "
"; $outtext .= "
{$if['common_country']}
"; $outtext .= "
".FormList('Country','countries',FALSE, array('eng' => ($if['id'] != 1), 'trim' => 28)) ."
"; $outtext .= "
"; $outtext .= "
{$if['common_datebirth']}
"; $outtext .= "
-
"; $outtext .= "
"; $outtext .= "
{$if['common_name']}
"; $outtext .= "
"; $outtext .= "
{$if['common_kennel']} ({$if['common_owner']})
"; $outtext .= "
".FormList('Kennel','kennels',FALSE, array('eng' => ($if['id'] != 1), 'trim' => 28))."
"; $outtext .= "
"; $outtext .= "
{$if['common_address']}
"; $outtext .= "
"; $outtext .= "
"; $outtext .= "
{$if['main_search_byname']}
"; $outtext .= "
{$if['main_search_bykennels']}
"; $outtext .= "
{$if['main_search_bydatebirth']}
"; $outtext .= "
{$if['main_search_byupdate']}
"; $outtext .= "
{$if['main_search_byinsert']}
"; $outtext .= "
 
"; $outtext .= "
"; $outtext .= "
"; $outtext .= "
{$if['common_color']}
"; $outtext .= "
".FormList('Color','colors', FALSE, array('eng' => ($if['id'] != 1)))."
"; $outtext .= "
"; $outtext .= "
{$if['dog_title_pedigree']}
"; $outtext .= "
"; $outtext .= "
"; $outtext .= "
{$if['dog_title_dysp']}
"; $outtext .= "
{$if['search_withfoto']}
"; $outtext .= "
{$if['search_forsale']}
"; $outtext .= "
"; $outtext .= "
{$if['common_sex']}
"; $outtext .= "
"; $outtext .= "
"; $outtext .= "
{$if['dog_title_tattoo']}
"; $outtext .= "
"; $outtext .= "
"; $outtext .= "
"; return $outtext; } function FormHeader($id = FALSE, $userid = FALSE, $jq = FALSE) { GLOBAL $if; LiteHeader($id, $jq); echo Page_Menu($userid); echo Page_Title($userid); echo Page_Operations($id, $userid); echo Page_Alphabet(); echo Page_Search(); echo "
"; }; function FormEnding($userid = FALSE) { GLOBAL $if; echo "
"; /* echo "
"; if($userid) echo "* {$if['feedback_link']}"; else echo "   "; echo "
"; */ echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
"; echo << ЯндекÑ�.Метрика EOT; echo ""; echo "Web scripts ''Virtual breed database 2.0'' - Copyright ©, 2004-".date(Y)." Y.Semenov - All rights reserved. // Site opens 14, august 2018"; echo "
"; echo "
"; LiteEnding(); } function LiteEnding() { echo ""; echo ""; } function FormFeedback() { GLOBAL $if; $outtext .= "
"; $outtext .= ""; $outtext .= ""; $outtext .= " "; $outtext .= " "; $outtext .= ""; $outtext .= "

{$if['sendmail_info']}
"; $outtext .= "
"; return $outtext; } function Title($title, $context) { $retstr .= "
"; $retstr .= " $title
"; if($context <> "") { $retstr .= "
"; $retstr .= " "; $retstr .= " $context"; $retstr .= " "; $retstr .= "
"; } $retstr .= "
"; return $retstr; } function TitleBlock($title, $links, $text = FALSE, $pre_lenght = 86, $cssid = FALSE) { if(is_array($links)) foreach($links as $name => $url) $context .= ($context?" / ":""). "$name"; else $context = $links; $retstr .= title($title, $context); $retstr .= "
$text
"; return $retstr; }; function InfoBlock($title, $links, $text = FALSE, $pre_lenght = FALSE, $cssid = FALSE) { $retstr .= "
"; $retstr .= "

$title"; $retstr .= ($links?"
$links
":""); $retstr .= "

"; $retstr .= $text; $retstr .= "
"; return $retstr; }; function DictBlock($title, $text = FALSE, $cssid = FALSE) { $retstr .= "
\n"; $retstr .= "

$title

\n"; $retstr .= $text; $retstr .= "
\n"; return $retstr; }; function TwoColumns($c1, $c2) { echo ""; echo ""; echo " "; echo " "; echo ""; echo "
$c1 $c2
"; }; ?> {$row['name']} \n"; }; $retstr = "\n"; return $retstr; } function FormList($listname, $tablename, $selid = FALSE, $params = FALSE) { // ôóíêöèÿ ôîðìèðóþùàÿ SELECT íà áàçå ïåðåäàííûõ íàçâàíèÿ, òàáëèöû è ïàðàìåòðîâ // ðåàëüíî ôîðìèðóåò çàïðîñ è ïåðåäàåò åãî â ôóíêöèþ òåõíè÷åñêîãî óðîâíÿ - FormListQuery // ($listname, $tablename, $selid = FALSE, $isdoglist = FALSE, $dogsex = FALSE, $eng = FALSE, $trim = FALSE) SQLConn(); if($params['ordby']) $ordby = $params['ordby']; else $ordby = "name"; switch($params['sex']) { case "male": $sstr = "WHERE sex=2"; break; case "female": $sstr = "WHERE sex=1"; break; default: $sstr = ""; }; $qstr = "SELECT id,".($params['eng']?"engname":"name")." AS name FROM $tablename ORDER BY $ordby"; return FormListQuery($listname, $qstr, $selid, $params); }; function FormAltList($d, $w = '934px') { GLOBAL $if; if($params['edit']) $editlink = TRUE; else $editlink = FALSE; if($params['pre']) $pre_block = $params['pre']; else $pre_block = 86; while($row = mysql_fetch_array($d)) { $hdstr = ShowHealth($row['dogid']); if($hdstr) $hdstr = "$hdstr"; $tstr = ShowTitles($row['dogid'],", ",5); $sstr = ShowStudy($row['dogid'], ", "); $tstr .= (($tstr&&$sstr)?", ":""). $sstr; $rkfstr = ShowRKF($row['dogid']); $rkfstr = $rkfstr?", $rkfstr":""; if(file_exists("xrays/{$row['dogid']}-hd.jpg") || file_exists("xrays/{$row['dogid']}-ed.jpg")) $xrays = "\"Xrays"; else $xrays = ""; $colstr = ShowNames($row['cid'], 'colors', ($if['id']==1)?FALSE:TRUE); $retlst .= "\n"; $retlst .= "\n"; $retlst .= ""; $retlst .= ""; $retlst .= ""; $retlst .= ""; $retlst .= ""; $retlst .= "
"; $retlst .= "".DogFullName($row['dogid'], FALSE, FALSE, array('upper' => TRUE, 'color' => '#ce185d'))."".$rkfstr; $retlst .= "
"; $retlst .= DogFullName($row['fatherid'],FALSE, FALSE, array('color' => '#686868'))." x ".DogFullNAme($row['motherid'],FALSE, FALSE, array('color' => '#686868')); $retlst .= "
"; $retlst .= "
$tstr".(($hdstr && $tstr)?", ":"")."$hdstr
"; $retlst .= "
"; $retlst .= "". ConvertDate($row['datebirth']). ""; $retlst .= "
".DogSex($row['sex'])."
"; $retlst .= "
{$row['tavro']}
"; $retlst .= "
$colstr
"; $retlst .= "
\n"; $retlst .= "
\n"; }; if($retlst) { $retstr .= $retlst; }; $retstr = "
$retstr
"; return $retstr; }; function GetLinkBack($lnk) { $retstr = ""; return $retstr; }; function GetOrderString($ordby,$deford = 'name') { $retstr = "ORDER BY"; switch($ordby) { case 0: $retstr = $retstr . " dogname"; break; case 1: $retstr = $retstr . " kennelid"; break; case 2: $retstr = $retstr . " datebirth"; break; case 3: $retstr = $retstr . " upd.date_up DESC"; break; case 4: $retstr = $retstr . " dogs.id DESC"; break; default: $retstr = $retstr . " $deford"; }; return $retstr; }; function FormDogList($listname, $dta, $selid = FALSE) { if($dta) while($row=mysql_fetch_array($dta)) { $lstdata = $lstdata." \n"; }; $retstr = ""; return $retstr; }; function MakeDateInput($titlename, $fieldname, $fieldvalue, $addcol = "") { GLOBAL $if; $months = array ( '00' => " - - - - - - ", '01' => $if['month_january'], '02' => $if['month_febrary'], '03' => $if['month_march'], '04' => $if['month_april'], '05' => $if['month_may'], '06' => $if['month_june'], '07' => $if['month_july'], '08' => $if['month_august'], '09' => $if['month_september'], '10' => $if['month_october'], '11' => $if['month_november'], '12' => $if['month_december']); if($fieldvalue) { $dd = substr($fieldvalue,0,2); $mm = substr($fieldvalue,3,2); $yy = substr($fieldvalue,6,4); } $retstr = ($titlename?"
$titlename
":"")."
".($addcol?"":"")."
$addcol
"; return $retstr; } function MakeInput($titlename, $fieldname, $fieldvalue, $fieldsize = 20, $cssclass = 'MIPT', $js = "") { $retstr .= "
$titlename
"; $retstr .= "
"; return $retstr; } function ActiveSelect($name, $fieldname, $fieldvalue) { $retstr .= "
{$name}
"; $retstr .= "
"; $retstr .= " "; $retstr .= "
"; return $retstr; } function UserEditForm($dogid, $euserid) { GLOBAL $if; $retstr = "
". FormList('ra[userid]','users',$euserid). " ". "
"; return $retstr; } function SimplyEdit($dogid, $fieldname, $fieldvalue) { GLOBAL $if; $retstr = "
". "". "". "". " ". "
"; return $retstr; } function SimplyEditDate($dogid, $fieldname, $fieldvalue) { GLOBAL $if; $retstr = "
". "". "". "". "". MakeDateInput(FALSE, "indate", $fieldvalue?ConvertDate($fieldvalue):"", ""). "
"; return $retstr; } function NumbersList($name, $n, $start = 1, $sel = FALSE) { $i = $start; $retstr .= ""; return $retstr; } ?>