Projekt

Obecné

Profil

Stáhnout (2.57 KB) Statistiky
| Větev: | Tag: | Revize:
1
<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
<FONT FACE='Unicode Arial MS' SIZE=3>
13
<?
14
  if ( ($file1 == ""))
15
  {
16

    
17
    echo ("Nebylo zadano jmeno souboru!<br>\n");
18
		echo ("<br><br><a href=\"./vlozeni1png.php\"> Zpet</a>");
19
    echo ("</BODY>");
20
    echo ("</HTML>");
21
    exit;
22
  }
23
  $file1="/home/webowner/data-in/".$file1;
24
  if ( ($fr1 = FOpen ($file1, "r")) == false )
25
  {
26
    echo ("Nepodarilo se otevrit soubor!<br> Jmeno ".$file1."\n");
27
		echo ("<br><br><a href=\"../index.php3\"> Zpet na administraci klinopis.cz</a>");
28
    echo ("</BODY>");
29
    echo ("</HTML>");
30
    exit;
31
  }
32
	$konec = false;
33
	@$spojeni = Pg_Connect ("user=vviewer dbname=klinopis");
34
//vlozeni FCI pro konverzi
35
	require "./fcek2u2.php";
36
	define ("MAXPOLOZKA", 31690);
37
	define ("MAXREAD", 50000);
38
	$datum = Date ("Y-m-d H:00:00");
39
  do
40
  {
41
    if (($text = FGetS ($fr1, MAXREAD)) != false )
42
    {
43
		if ($typdat == 1)	//nova hesla
44
	      $editionabbreviation = StrTok ($text, "^");
45
	      $editionnumber1 = StrTok ("^");
46
	      $editionnumber2 = StrTok ("^");
47
	      $dateyear = StrTok ("^");
48
	      $datemonth = StrTok ("^");
49
	      $dateday = StrTok ("^");
50
	      $ancientplace = StrTok ("^");
51
	      $documenttype = StrTok ("^");
52
	      $transliteration = StrTok ("^");
53
	      $ancientruler = StrTok ("^");
54
	      $ancientyear = StrTok ("^");
55
			include "./convertk2u2.php";
56
			echo ($editionabbreviation." \n");
57
			$pocethesel++;
58
			if (($pocethesel % 100) == 0) echo ("<hr>".$pocethesel."<br><hr>\n");
59
			//vkladani dat do DB graf01
60
			if (StrLen ($item) <= MAXPOLOZKA)
61
			{
62
		if (@$msg = Pg_Exec ($spojeni, "INSERT INTO graf02 (editionabbreviation, editionnumber1, editionnumber2, dateyear, datemonth, dateday, ancientplace, documenttype, transliteration, ancientruler, ancientyear) VALUES ('$editionabbreviation', '$editionnumber1', '$editionnumber2', '$dateyear', '$datemonth', '$dateday', '$ancientplace', '$documenttype', '$transliteration', '$ancientruler', '$ancientyear')"))
63
					{
64
						$heseldobre++;
65
					}
66
			}
67
    }
68
    else
69
		$konec = true;
70
		echo (" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
71
	} while (! $konec);
72
  FClose ($fr1);
73
	Pg_Close ($spojeni);
74
	echo ("<hr>Celkovy pocet nactenych hesel: $pocethesel<br>\n");
75
	echo ("Pocet hesel, ktere byly vlozeny: $heseldobre<br>\n");
76
	echo ("Pocet hesel, ktere byly moc dlouhe (nevlozeny): $heselnevlozeno<br>\n");
77
?>
78
	<form action="../index.php3">
79
		<input type=submit value="Zpet na administraci klinopis.cz">
80
	</form>
81
</FONT>
82
</BODY>
83
</HTML>
(30-30/38)