1 |
6daefa8c
|
Petr Lukašík
|
<HTML>
|
2 |
|
|
<HEAD>
|
3 |
|
|
<META content=text/html; http-equiv=Content-Type>
|
4 |
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
|
5 |
|
|
<TITLE></TITLE>
|
6 |
|
|
</HEAD>
|
7 |
|
|
|
8 |
|
|
<BODY>
|
9 |
|
|
|
10 |
|
|
<h1><center> Vkladani dat do databaze do tabulky graf02</center></h1>
|
11 |
|
|
<br>
|
12 |
|
|
<FONT FACE='Arial Unicode MS' SIZE=3>
|
13 |
|
|
<?
|
14 |
|
|
if ( ($file1 == ""))
|
15 |
|
|
{
|
16 |
|
|
|
17 |
|
|
echo ("Nebylo zadano jmeno souboru!<br>\n");
|
18 |
|
|
echo ("<br><br><a href=\"./vlozeni11gr.php3\"> Zpet</a>");
|
19 |
|
|
echo ("</BODY>");
|
20 |
|
|
echo ("</HTML>");
|
21 |
|
|
exit;
|
22 |
|
|
}
|
23 |
|
|
if ( ($typdat != 1) && ($typdat != 2))
|
24 |
|
|
{
|
25 |
|
|
|
26 |
|
|
echo ("Nebyl zadan typ vkladanych dat!<br>\n");
|
27 |
|
|
echo ("<br><br><a href=\"./vlozeni11gr.php3\"> Zpet</a>");
|
28 |
|
|
echo ("</BODY>");
|
29 |
|
|
echo ("</HTML>");
|
30 |
|
|
exit;
|
31 |
|
|
}
|
32 |
|
|
$file1="/home/webowner/data-in/".$file1;
|
33 |
|
|
if ( ($fr1 = FOpen ($file1, "r")) == false )
|
34 |
|
|
{
|
35 |
|
|
echo ("Nepodarilo se otevrit soubor!<br> Jmeno ".$file1."\n");
|
36 |
|
|
echo ("<br><br><a href=\"../index.php3\"> Zpet na administraci klinopis.cz</a>");
|
37 |
|
|
echo ("</BODY>");
|
38 |
|
|
echo ("</HTML>");
|
39 |
|
|
exit;
|
40 |
|
|
}
|
41 |
|
|
$konec = false;
|
42 |
|
|
$pocethesel = $heseldobre = $heselnevlozeno = $heselbezweb = $heselzdroj = $heselbezasc = 0;
|
43 |
|
|
$spojeni = Pg_Connect("user=vadmin dbname=klinopis");
|
44 |
|
|
|
45 |
|
|
//vlozeni FCI pro konverzi
|
46 |
|
|
require "./fcek2u2.php";
|
47 |
|
|
define ("MAXREAD", 50000);
|
48 |
|
|
do
|
49 |
|
|
{
|
50 |
|
|
if (($text = FGetS ($fr1, MAXREAD)) != false )
|
51 |
|
|
{
|
52 |
|
|
if ($typdat == 1) //nova hesla
|
53 |
|
|
$number = StrTok ($text, "^");
|
54 |
|
|
$editionabbreviation = StrTok ("^");
|
55 |
|
|
$editionnumber1 = StrTok ("^");
|
56 |
|
|
$editionnumber2 = StrTok ("^");
|
57 |
|
|
$dateyear = StrTok ("^");
|
58 |
|
|
$datemonth = StrTok ("^");
|
59 |
|
|
$dateday = StrTok ("^");
|
60 |
|
|
$ancientplace = StrTok ("^");
|
61 |
|
|
$documenttype = StrTok ("^");
|
62 |
|
|
$transliteration = StrTok ("^");
|
63 |
|
|
$ancientruler = StrTok ("^");
|
64 |
|
|
$ancientyear = StrTok ("^");
|
65 |
|
|
// include "./convertk2u2.php";
|
66 |
|
|
// $klic = MD5 ($transliteration);
|
67 |
|
|
echo ($transliteration." \n");
|
68 |
|
|
$pocethesel++;
|
69 |
|
|
if (($pocethesel % 100) == 0) echo ("<hr>".$pocethesel."<br><hr>\n");
|
70 |
|
|
//vkladani dat do DB graf02
|
71 |
|
|
if ($typdat == 1)
|
72 |
|
|
{ //nova hesla
|
73 |
|
|
if (@Pg_Exec ($spojeni, "INSERT INTO graf01 (number, editionabbreviation, editionnumber, dateyear, datemonth, dateday, ancientplace, documenttype, transliteration, ancientruler, ancientyear) VALUES ('$number', '$editionabbreviation', '$editionnumber', '$dateyear', '$datemonth', '$dateday', '$ancientplace', '$documenttype', '$transliteration', '$ancientruler', '$ancientyear')") )
|
74 |
|
|
$heseldobre++;
|
75 |
|
|
else
|
76 |
|
|
{
|
77 |
|
|
echo ("<b>Heslo nevlozeno jednim SQL prikazem.</b>");
|
78 |
|
|
$heselnevlozeno++;
|
79 |
|
|
}
|
80 |
|
|
}
|
81 |
|
|
}
|
82 |
|
|
else $konec = true;
|
83 |
|
|
|
84 |
|
|
echo (" ");
|
85 |
|
|
} while (! $konec);
|
86 |
|
|
|
87 |
|
|
FClose ($fr1);
|
88 |
|
|
|
89 |
|
|
Pg_Close ($spojeni);
|
90 |
|
|
|
91 |
|
|
echo ("<hr>Celkovy pocet nactenych hesel: $pocethesel<br>\n");
|
92 |
|
|
echo ("Pocet hesel, ktere byly vlozeny: $heseldobre<br>\n");
|
93 |
|
|
echo ("Pocet hesel, ktere byly moc dlouhe (nevlozeny): $heselnevlozeno<br>\n");
|
94 |
|
|
echo ("Pocet hesel, ktere nemaji WEB cast: $heselbezweb<br>\n");
|
95 |
|
|
?>
|
96 |
|
|
<form action="../index.php3">
|
97 |
|
|
<input type=submit value="Zpet na administraci klinopis.cz">
|
98 |
|
|
</form>
|
99 |
|
|
</FONT>
|
100 |
|
|
</BODY>
|
101 |
|
|
</HTML>
|