Projekt

Obecné

Profil

Stáhnout (2.29 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 input into database table obtextp</center></h1>
14
<br>
15
<FONT FACE='Unicode Arial MS' SIZE=3>
16
<?
17
  if ( ($file1 == ""))
18
  {
19

    
20
    echo ("Filename not given!<br>\n");
21
		echo ("<br><br><a href=\"./vlozeni1obtextp.php\"> back</a>");
22
    echo ("</BODY>");
23
    echo ("</HTML>");
24
    exit;
25
  }
26
  $file1="/home/webowner/data-in/bybsrc/".$file1;
27
  if ( ($fr1 = FOpen ($file1, "r")) == false )
28
  {
29
    echo ("Impossible to open the file, is it read-only? Check it!<br> Name: ".$file1."\n");
30
		echo ("<br><br><a href=\"../index.php3\"> back to tools menu of klinopis.cz</a>");
31
    echo ("</BODY>");
32
    echo ("</HTML>");
33
    exit;
34
  }
35
	$konec = false;
36
	@$spojeni = Pg_Connect ("user=dbowner dbname=klinopis");
37
//vlozeni FCI pro konverzi
38
	require "./fcek2u2.php";
39
	define ("MAXPOLOZKA", 31690);
40
	define ("MAXREAD", 50000);
41
//	$datum = Date ("Y-m-d");
42
	$datum = '2003-08-07';
43
  do
44
  {
45
    if (($text = FGetS ($fr1, MAXREAD)) != false )
46
    {
47
		if ($typdat == 1)	//nova hesla
48
	      $book = StrTok ($text, "^");
49
	      $descriptionp = StrTok ("^");
50
	      $chapter = StrTok ("^");
51
	      $bookandchapterp = StrTok ("^");
52
	      $origin = StrTok ("^");
53

    
54
			include "./convertk2u2.php";
55
			echo ($book." \n");
56
			$pocethesel++;
57
			if (($pocethesel % 100) == 0) echo ("&nbsp;".$pocethesel."&nbsp;");
58
			if (StrLen ($book) <= MAXPOLOZKA)
59
			{
60
		if (@$msg = Pg_Exec ($spojeni, "INSERT INTO obtextp (book, descriptionp, bookandchapterp, chapter, autor, datum, type, origin) VALUES ('$book', '$webdescriptionp', '$webbookandchapterp', '$webchapter', '$auth_userkod', '$datum', '$type', '$origin')"))
61
					{
62
						$heseldobre++;
63
					}
64
			}
65
    }
66
    else
67
		$konec = true;
68
		echo (" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
69
	} while (! $konec);
70
  FClose ($fr1);
71
	Pg_Close ($spojeni);
72
	echo ("<hr>Total number of inserted lines: $pocethesel<br>\n");
73
	echo ("Number of lines inserted: $heseldobre<br>\n");
74
	echo ("Number of lines which were too long (not inserted): $heselnevlozeno<br>\n");
75
?>
76
	<form action="/utf/ktools.php">
77
		<input type=submit value="back to tools menu of klinopis.cz">
78
	</form>
79
</FONT>
80
</BODY>
81
</HTML>
(34-34/38)