1 |
6daefa8c
|
Petr Lukašík
|
<html>
|
2 |
|
|
<body>
|
3 |
|
|
<?
|
4 |
|
|
@$spojeni = Pg_PConnect("user=vviewer dbname=klinopis");
|
5 |
|
|
if ($spojeni)
|
6 |
|
|
{
|
7 |
|
|
$pod1 = ("transliteration like '$chain%'");
|
8 |
|
|
$dotaz1 = "SELECT oid, paragraph, transliteration FROM abtexts WHERE ($pod1)";
|
9 |
|
|
// $dotaz1 = "SELECT oid, klic, wapnazev FROM hledani WHERE ($pod1)";
|
10 |
|
|
|
11 |
|
|
@$vysledek = Pg_Exec($spojeni, "$dotaz1");
|
12 |
|
|
if ($vysledek)
|
13 |
|
|
{
|
14 |
|
|
$pocethesel = Pg_NumRows ($vysledek);
|
15 |
|
|
if ($pocethesel == 0)
|
16 |
|
|
echo ("Nenasli!<br/><br/>\n");
|
17 |
|
|
else
|
18 |
|
|
{
|
19 |
|
|
echo ("Items: \n");
|
20 |
|
|
$rozsah = 8;
|
21 |
|
|
if (($pocethesel - $start) > $rozsah)
|
22 |
|
|
$konec = $start + $rozsah;
|
23 |
|
|
else
|
24 |
|
|
$konec = $pocethesel;
|
25 |
|
|
|
26 |
|
|
$start++;
|
27 |
|
|
echo ("$start - $konec from $pocethesel<br/><br/>\n");
|
28 |
|
|
$start--;
|
29 |
|
|
|
30 |
|
|
for ($i=$start; $i < $konec; $i++)
|
31 |
|
|
{
|
32 |
|
|
list ($oid, $paragraph, $transliteration) = Pg_Fetch_Array($vysledek, $i);
|
33 |
|
|
$transliteration = StripSlashes ($transliteration);
|
34 |
|
|
$paragraph=$paragraph.$oid;
|
35 |
|
|
|
36 |
|
|
echo ("Nic5<br/>\n");
|
37 |
|
|
echo ("$paragraph<br/>TADY\n");
|
38 |
|
|
// Vypis popisu
|
39 |
|
|
$konec2 = ($paragraph+5);
|
40 |
|
|
for ($j=$paragraph; $j < $konec2; $j++)
|
41 |
|
|
{
|
42 |
|
|
|
43 |
|
|
$len1 = StrLen ($transliteration);
|
44 |
|
|
$pocradek = 10;
|
45 |
|
|
if (StrLen ($transliteration) > ($pocradek+$len1) )
|
46 |
|
|
{
|
47 |
|
|
while ($transliteration[$len1+$pocradek] != " ") $pocradek--;
|
48 |
|
|
echo (SubStr ($transliteration, $len1, $pocradek)." ...<br/>\n");
|
49 |
|
|
}
|
50 |
|
|
else
|
51 |
|
|
echo (SubStr ($transliteration, $len1, StrLen ($transliteration)-$len1)."<br/>\n");
|
52 |
|
|
// konec popisu
|
53 |
|
|
}
|
54 |
|
|
}
|
55 |
|
|
// TADYXXx
|
56 |
|
|
if ($start != 0)
|
57 |
|
|
{
|
58 |
|
|
$cis = $start - $rozsah;
|
59 |
|
|
echo ("Nic4<br/>\n");
|
60 |
|
|
}
|
61 |
|
|
if ( ($pocethesel - $start) > $rozsah)
|
62 |
|
|
{
|
63 |
|
|
$cis = $start + $rozsah;
|
64 |
|
|
echo ("Nic3<br/>\n");
|
65 |
|
|
}
|
66 |
|
|
}
|
67 |
|
|
}
|
68 |
|
|
else
|
69 |
|
|
echo ("Nic2!<br/>\n");
|
70 |
|
|
}
|
71 |
|
|
else
|
72 |
|
|
echo ("Nic1!<br/>\n");
|
73 |
|
|
?>
|
74 |
|
|
</body>
|
75 |
|
|
</html>
|