web/lingvigilo-korekti.php
author viric <viriketo@gmail.com>
Mon, 03 Sep 2012 23:35:31 +0200
branchgo
changeset 7 d5750f4e6e8c
parent 0 6371497b4e53
permissions -rw-r--r--
Adding a first attempt at go code
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
     1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
     2
<html>
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
     3
<head>
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
     4
	<title>Lingvigilo - Korekta kvizo</title>
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
     5
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
     6
	<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
     7
	<META HTTP-EQUIV="Expires" CONTENT="-1">
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
     8
</head>
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
     9
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    10
<body>
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    11
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    12
<?php
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    13
include('./getdb.inc');
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    14
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    15
$konekto=konekti();
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    16
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    17
$frazoj = preni_frazojn($konekto,0)
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    18
?>
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    19
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    20
<h1>Korektilo por programo <em>lingvigilo</em></h1>
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    21
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    22
<?php
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    23
if (isset($_POST["korektu"]))
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    24
{
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    25
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    26
	// Konservi datumojn.
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    27
	
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    28
	$body = "";
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    29
	// OJU!!!! Aquí falla indentació per mantenir 80 columnes.
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    30
	if ($frazoj != 0)
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    31
	{
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    32
	foreach($frazoj as $key => $f)
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    33
	{
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    34
		//echo "<p> Key: $key. ";
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    35
		if(isset($_POST["korekto"][$key]))
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    36
			//echo "farita.";
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    37
			if($_POST["korekto"][$key] != 0)
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    38
			{
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    39
				$query = "UPDATE " . $frazotablo .
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    40
					" SET korekta=" .
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    41
					$_POST["korekto"][$key] .
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    42
					",klarigo='" .
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    43
					strtosql($_POST["klarigo"][$key]) .
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    44
					"',korektisto='" .
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    45
					strtosql($_POST["korektisto"]) .
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    46
					"' WHERE id=".  $key . ";";
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    47
				mysql_query($query, $konekto);
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    48
				// Por retletero
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    49
				$body = $body .
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    50
					"Vorto: " . $f["vorto"] . "\n" .
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    51
					"Frazo: " . $f["frazo"] . "\n" .
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    52
					"Korekteco: " .
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    53
					teksto_korekto($_POST["korekto"][$key])
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    54
					. "\n" .
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    55
					"Klarigo: " . $_POST["klarigo"][$key] .
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    56
					"\n" .  "Korektist(in)o: " .
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    57
					$_POST["korektisto"] .
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    58
					"\n\n";
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    59
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    60
				
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    61
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    62
			}
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    63
		//echo "</p>\n";
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    64
	}
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    65
	// Sendi retleteron
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    66
	mail("viric@vicerveza.homeunix.net","Korektado de frazoj", $body,
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    67
	"Content-Type: text/plain; charset=utf-8\r\n" .
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    68
	"Content-Transfer-Encoding: 8bit");
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    69
	}
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    70
	
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    71
?>
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    72
	<p>Dankon pro la korektado!<p>
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    73
	<p>Vi povas reiri al frazaro korektenda alitage, ĉiam je la
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    74
	<a HREF="http://vicerveza.homeunix.net/~viric/lingvigilo/lingvigilo-korekti">Sama
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    75
	adreso</a>.</p>
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    76
<?php
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    77
}
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    78
else
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    79
{
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    80
?>
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    81
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    82
<h2>Frazoj korektendaj</h2>
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    83
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    84
<form action="lingvigilo-korekti" method="post">
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    85
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    86
<TABLE BORDER=1>
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    87
<TR>
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    88
        <TH>ID
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    89
        <TH>Vorto
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    90
        <TH>Frazo
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    91
        <TH>Korekto
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    92
        <TH>Klarigo
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    93
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    94
<?php
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    95
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    96
function select_korekto($id_frazo)
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    97
{
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    98
	echo "<SELECT name=\"korekto[$id_frazo]\">\n";
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    99
	echo "<OPTION value=0 selected>Ne korektita\n";
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   100
	echo "<OPTION value=1>Ĝusta\n";
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   101
	echo "<OPTION value=2>Malĝusta\n";
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   102
	echo "<OPTION value=3>Nekutima\n";
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   103
	echo "</SELECT>\n";
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   104
}
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   105
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   106
$numfrazoj = 0;
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   107
if ($frazoj != 0)
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   108
	foreach($frazoj as $key => $f)
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   109
	{
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   110
		echo "<tr>\n";
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   111
		echo "\t<td>". $key . "\n";
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   112
		echo "\t<td>". $f["vorto"] . "\n";
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   113
		echo "\t<td>". $f["frazo"] . "\n";
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   114
		echo "\t<td>";
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   115
		select_korekto($key);
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   116
		echo "\t<td><input type=text name=\"klarigo[$key]\" size=30 " .
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   117
			"maxlength=254>";
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   118
		$numfrazoj++;
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   119
	}
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   120
?>
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   121
</table>
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   122
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   123
<p><strong>Estas <?php echo $numfrazoj;?> nekorektitaj frazoj en datumbazo.
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   124
</strong></p>
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   125
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   126
<h2>Prepari sendon</h2>
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   127
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   128
<p>Alklaku <em>Sendu korektaĵojn</em> por sendi ilin. Vi povas igi ĉiujn frazojn
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   129
al elekto <em>Ne korektita</em> kaj forviŝi ĉiujn klarigojn, alklakante butonon
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   130
<em>Forgesu</em>.</p>
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   131
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   132
<p>Antaŭ enmetu datumojn, bonvolu skribi ian nomon por ke mi sciu kiu korektis
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   133
tion ĉi (t.e. kiun demandi)</p>
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   134
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   135
<p><strong>Korektist(in)o:</strong>
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   136
<input type=text name=korektisto size=10 maxlength=30>
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   137
</p>
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   138
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   139
<input type=submit value="Sendu korektaĵojn" name=korektu>
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   140
<input type=reset value="Forgesu">
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   141
</form>
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   142
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   143
<?php
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   144
} // Fino de normala paĝo
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   145
?>
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   146
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   147
<p>Iru al <a href="index">ĉefa paĝo</a>.</p>
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   148
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
   149
</body>