42)extract($_REQUEST); $uni=get_unicode($host); if ($uni==0) { $term_1=fromunicode($term_1,"rus"); $term_2=fromunicode($term_2,"rus"); $term_3=fromunicode($term_3,"rus"); $term_4=fromunicode($term_4,"rus"); $term_5=fromunicode($term_5,"rus"); } #echo "
host="; #echo $host; #echo "
term="; #echo $term; #echo "
position="; #echo $pos; #echo "
"; #echo "
$format"; # header("Content-type: text/marc"); #echo ""; #echo "Content-type: text/marc"; # include ("func.php"); # $term="@attr 1=1003 @attr 5=1 christie"; #$term1=str_replace("\"",' ',$term); #$term1=str_replace("","\\",$term1); #$term=$term1; if (!empty($term_1) && ($trun1=="0")) { $term = "@attr 1=" . $use_1 . " \"". trim($term_1) . "\" "; } if (!empty($term_1) && ($trun1=="1")) { $term = "@attr 1=" . $use_1 . " @attr 5=1 \"". trim($term_1) . "\" "; } if (!empty($term_1) && ($trun1=="2")) { $term = "@attr 1=" . $use_1 . " @attr 5=2 \"". trim($term_1) . "\" "; } if (!empty($term_2) && ($trun2=="0")) { $term = $term . " @attr 1=" . $use_2 . " \"". trim($term_2) . "\" "; }; if (!empty($term_2) && ($trun2=="1")) { $term = $term . " @attr 1=" . $use_2 . " @attr 5=1 \"". trim($term_2) . "\" "; }; if (!empty($term_2) && ($trun2=="2")) { $term = $term . " @attr 1=" . $use_2 . " @attr 5=2 \"". trim($term_2) . "\" "; }; if (!empty($term_3) && ($trun3=="0")) { $term = $term . " @attr 1=" . $use_3 . " \"". trim($term_3) . "\" "; }; if (!empty($term_3) && ($trun3=="1")) { $term = $term . " @attr 1=" . $use_3 . " @attr 5=1 \"". trim($term_3). "\" "; }; if (!empty($term_3) && ($trun3=="2")) { $term = $term . " @attr 1=" . $use_3 . " @attr 5=2 \"". trim($term_3). "\" "; }; if (!empty($term_4) && ($trun4=="0")) { $term = $term . " @attr 1=" . $use_4 . " \"". trim($term_4) . "\" "; }; if (!empty($term_4) && ($trun4=="1")) { $term = $term . " @attr 1=" . $use_4 . " @attr 5=1 \"". trim($term_4). "\" "; }; if (!empty($term_4) && ($trun4=="2")) { $term = $term . " @attr 1=" . $use_4 . " @attr 5=2 \"". trim($term_4). "\" "; }; if (!empty($term_5) && ($trun5=="0")) { $term = $term . " @attr 1=" . $use_5 . " \"". trim($term_5) . "\" "; }; if (!empty($term_5) && ($trun5=="1")) { $term = $term . " @attr 1=" . $use_5 . " @attr 5=1 \"". trim($term_5). "\" "; }; if (!empty($term_5) && ($trun5=="2")) { $term = $term . " @attr 1=" . $use_5 . " @attr 5=2 \"". trim($term_5). "\" "; }; if (!empty($term_1) && !empty($term_2) ) { $term = "@" . $bop_1 . " " . $term; }; if (!empty($term_3)) { $term = "@" . $bop_2 . " " . $term; } if (!empty($term_4)) { $term = "@" . $bop_3 . " " . $term; } if (!empty($term_5)) { $term = "@" . $bop_4 . " " . $term; } //echo $term; $sout = ""; $pk="n"; if ($host == "olsc3.unilib.neva.ru/books") { $pk="y"; } if ($host == "195.178.205.8/All") { $pk="y"; } if ($pk == "y") { $termn=convert_cyr_string($term,"w","k"); $term=$termn; } $i=0; $id[] = yaz_connect($host); yaz_syntax($id[$i],$format); yaz_range($id[$i],$pos,1); yaz_element($id[$i],"F"); yaz_search($id[$i],"rpn",$term); yaz_wait(); $error = yaz_error($id[$i]); $add = yaz_addinfo($id[$i]); # echo $add; if (!empty($error)) { echo "Error: $error"; } else { $hits = yaz_hits($id[$i]); # echo " : " . $hits; # echo "
"; # echo $term; # echo "
"; # echo $host; } for ($p = $pos; $p <= $pos; $p++) { $rec = yaz_record($id[$i],$p,"raw"); # if (empty($rec)) continue; echo $rec; } exit; ?>