Projekt

Obecné

Profil

Stáhnout (2.13 KB) Statistiky
| Větev: | Tag: | Revize:
1
<?
2
include "autorizace.inc.php";
3
ksa_authorize();
4
if ($auth_level == 0) ksa_unauthorized();
5
?>
6
<HTML>
7
<HEAD>
8
<META content=text/html; http-equiv=Content-Type>
9
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
10
<TITLE></TITLE>
11
</HEAD>
12
<BODY>
13
<h1><center> Data insert into database table obtexts</center></h1>
14
<br>
15
<FONT FACE='Unicode Arial MS' SIZE=3>
16
<?
17
  if ( ($file1 == ""))
18
  {
19
    echo ("Filename not given!<br>\n");
20
		echo ("<br><br><a href=\"./ktools.html\"> back</a>");
21
    echo ("</BODY>");
22
    echo ("</HTML>");
23
    exit;
24
  }
25
  $file1="/home/webowner/data-in/bybsrc/".$file1;
26
  if ( ($fr1 = FOpen ($file1, "r")) == false )
27
  {
28
    echo ("The file is probably read-only, check it!<br> Name: ".$file1."\n");
29
		echo ("<br><br><a href=\"../index.php3\"> Back to tools menu</a>");
30
    echo ("</BODY>");
31
    echo ("</HTML>");
32
    exit;
33
  }
34
	$konec = false;
35
	@$spojeni = Pg_Connect("user=dbowner dbname=klinopis");
36
	require "./fcek2u2.php";
37
	define ("MAXPOLOZKA", 62690);
38
	define ("MAXREAD", 62000);
39
	$date = Date ("Y-m-d");
40
  do
41
  {
42
    if (($text = FGetS ($fr1, MAXREAD)) != false )
43
    {
44
		if ($typdat == 1)	//nova hesla
45
	      $bookandchapter = StrTok ($text, "^");
46
	      $paragraph = StrTok ("^");
47
	      $transliteration = StrTok ("^");
48
	      $zmena = StrTok ("^");
49
//      $text = "";
50
			include "./convertk2u2.php";
51
			$pocethesel++;
52
			if (($pocethesel % 100) == 0) echo ("&nbsp;".$pocethesel."&nbsp;");
53
			if (StrLen ($number) <= MAXPOLOZKA)
54
			{
55
				if (Pg_Exec ("INSERT INTO obtexts (bookandchapter, paragraph, transliteration, stransliteration, autor, date) VALUES ('$bookandchapter', '$paragraph', '$webtransliteration', '$stransliteration', '$auth_userkod', '$date')"))
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>Total number of inserted lines: $pocethesel<br>\n");
68
	echo ("Number of lines inserted: $heseldobre<br>\n");
69
	echo ("Number of lines which were too long (not inserted): $heselnevlozeno<br>\n");
70
?>
71
	<form action="/utf/ktools.php">
72
		<input type=submit value="back to ktools">
73
	</form>
74
</FONT>
75
</BODY>
76
</HTML>
(36-36/38)