Projekt

Obecné

Profil

Stáhnout (1.87 KB) Statistiky
| Větev: | Tag: | Revize:
1
<html>
2
<head>
3
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
4
  <title>vkladani dat do obdict</title>
5
</head>
6
<body>
7
<h1><center> Vkladani dat do databaze</center></h1>
8
<br>
9
<?
10
  if ( ($file1 == ""))
11
  {
12

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