Query("SELECT * FROM $tAuthors"); for ($i=0;$i<$dAuthors->NumRows();$i++) { $dAuthors->NextResult(); $xId=$dAuthors->Get("id"); $xName=$dAuthors->Get("name"); $xAuthors[$xId]=$xName; } $xCaths=array(); $dCaths=$dbMain->Query("SELECT * FROM $tCath"); for ($i=0;$i<$dCaths->NumRows();$i++) { $dCaths->NextResult(); $xId=$dCaths->Get("id"); $xName=$dCaths->Get("name"); $xCaths[$xId]=$xName; } $xParts=array(); $dParts=$dbMain->Query("SELECT * FROM $tPart"); for ($i=0;$i<$dParts->NumRows();$i++) { $dParts->NextResult(); $xId=$dParts->Get("id"); $xName=$dParts->Get("name"); $xParts[$xId]=$xName; } function quotes($a) { return str_replace("'","\'",$a); } $tid=round($tid); $fL = substr($fL, 0, 3); Head("Глоссарий | $fL","glossary"); echo ""; echo "
"; if ($tid) { $dTerm=$dbMain->Query("SELECT * FROM $tGloss WHERE id=$tid"); if ($dTerm->NumRows()) { $dTerm->NextResult(); echo "

".$dTerm->Get("name")."

"; echo "
".nl2br($dTerm->Get("description"))."
"; } echo "
"; } $xSearch=quotes($fSearch); $ad=""; if ($fSearch) $ad="WHERE name LIKE '%$xSearch%'"; else { if ($fL && $fL!="%") $ad="WHERE UPPER(name) LIKE '$fL%'"; else $ad="WHERE SUBSTRING(UPPER(name),1,1)<'А' OR SUBSTRING(UPPER(name),1,1)>'Я'"; } $dChars=$dbMain->Query("SELECT * FROM $tGloss $ad ORDER BY name"); $xChars=$dChars->NumRows(); echo "

Термины:

"; echo "
    "; if ($fPage) $dChars->Seek($fPage); for ($i=0;$i<$cRecsPerPage;$i++) { if ($fPage+$i>=$xChars) break; $dChars->NextResult(); $xId=$dChars->Get("id"); echo "
  • ".$dChars->Get("name")."\n"; } echo "
"; echo "
"; LetterPages("code=$code&fL",$fL,$tGloss); $f=new Form(array("formname"=>"CathSearch","action"=>"$ps","method"=>"POST","enctype"=>"","size"=>"20","cols"=>"50","rows"=>"10",""=>"",""=>"",""=>"")); $f->SetStyle("elements","id=small"); $f->Hidden(array("name"=>"go","value"=>"caths")); $f->Hidden(array("name"=>"code","value"=>$code)); $f->Text(array("name"=>"fSearch","value"=>$fSearch,"title"=>"Поиск:
","after"=>"")); $f->SubmitReset(array("submittitle"=>" найти ")); // $f->PrintForm(); echo "
"; echo "
"; Foot(); ?>