Projekt

Obecné

Profil

Stáhnout (2.01 KB) Statistiky
| Větev: | Tag: | Revize:
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</center></h1>
11
<br>
12
<?
13
  if ( ($file1 == ""))
14
  {
15
16
    echo ("Nebylo zadano jmeno souboru!<br>\n");
17
		echo ("<br><br><a href=\"./vlozeni1obdict.php\"> Zpet</a>");
18
    echo ("</BODY>");
19
    echo ("</HTML>");
20
    exit;
21
  }
22
  $file1="/home/webowner/data-in/bybsrc/".$file1;
23
  if ( ($fr1 = FOpen ($file1, "r")) == false )
24
  {
25
    echo ("Nepodarilo se otevrit soubor!<br> Jmeno ".$file1."\n");
26
		echo ("<br><br><a href=\"../index.php3\"> Zpet na administraci klinopis.cz</a>");
27
    echo ("</BODY>");
28
    echo ("</HTML>");
29
    exit;
30
  }
31
	$konec = false;
32
	@$spojeni = Pg_Connect ("user=dbowner dbname=klinopis");
33
//vlozeni FCI pro konverzi
34
	require "./fcek2u2.php";
35
	define ("MAXPOLOZKA", 164333);
36
	define ("MAXREAD", 164000);
37
	$datum = Date ("Y-m-d");
38
  do
39
  {
40
    if (($text = FGetS ($fr1, MAXREAD)) != false )
41
    {
42
		if ($typdat == 1)	//nova hesla
43
	      $volume = StrTok ($text, "^");
44
	      $page = StrTok ("^");
45
	      $dicttext = StrTok ("^");
46
	      $nic = StrTok ("^");
47
			include "./convertk2u2.php";
48
			echo ("<FONT FACE=\"Unicode Arial MS\" SIZE=3>");
49
			echo ($page." \n");
50
			echo ("</FONT>");
51
			$pocethesel++;
52
			if (($pocethesel % 100) == 0) echo ("<hr>".$pocethesel."<br><hr>\n");
53
			if (StrLen ($dicttext) <= MAXPOLOZKA)
54
			{
55
		if (@$msg = Pg_Exec ($spojeni, "INSERT INTO cad (volume, page, dicttext, nic) VALUES ('$volume', '$page', '$webdicttext', '$nic')"))
56
					{
57
						$heseldobre++;
58
					}
59
			}
60
    }
61
    else
62
		$konec = true;
63
		echo (" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
64
	} while (! $konec);
65
  FClose ($fr1);
66
Pg_Close ($spojeni);
67
	echo ("<hr>Celkovy pocet nactenych hesel: $pocethesel<br>\n");
68
	echo ("Pocet hesel, ktere byly vlozeny: $heseldobre<br>\n");
69
	echo ("Pocet hesel, ktere byly moc dlouhe (nevlozeny): $heselnevlozeno<br>\n");
70
?>
71
	<form action="./ktools.html">
72
		<input type=submit value="Zpet na administraci klinopis.cz">
73
	</form>
74
</BODY>
75
</HTML>