source: trunk/comparison.php@ 78

Last change on this file since 78 was 78, checked in by maron, 16 years ago

Porovnání více textů vedle sebe.

File size: 2.1 KB
Line 
1<?php
2
3include('includes/global.php');
4
5ShowPage();
6
7 function CompareString($String1, $String2) {
8 //TODO: barevné porovnání
9 //echo $String2;
10 }
11
12if(array_key_exists('group', $_GET)) $GroupId = $_GET['group']; else $GroupId = 1;
13$Table = $TranslationTree[$GroupId]['TablePrefix'];
14if(array_key_exists('action', $_GET)) $Action = $_GET['action']; else $Action = '';
15
16if(array_key_exists('entry', $_GET))
17{
18 $Textentry = $_GET['entry'];
19
20 $DataID = $Database->SQLCommand('SELECT * FROM '.$Table.' Where entry = '.$Textentry);
21 $i = 0;
22 while($Line = mysql_fetch_assoc($DataID)) {
23 $BuffLine[$i] = $Line;
24 $i = $i+1;
25 }
26 // if(!$Line) die('Překlad nenalezen.');
27 $Line = $BuffLine;
28 $i = $i-1;
29 echo('Počet verzí: <b>'.$i.'</b><br> ');
30
31 echo('
32 <b>Číslo textu: <a href="http://www.wowhead.com/?quest='.$Textentry.'">'.$Textentry.'</a></b>
33
34 <table border="1" cellpadding="1" cellspacing="0">
35 <tr>');
36 echo (' <th>Přeložil</th>');
37 foreach($Line as $Index => $LineItem) {
38 $LineUser = mysql_fetch_array($Database->SQLCommand('SELECT * FROM user WHERE id = '.$LineItem['User']));
39 echo ('<th>'.$LineUser['user'].'</th>');
40 }
41 echo('</tr>');
42 echo (' <th>Jazyk</th>');
43 foreach($Line as $Index => $LineItem) {
44 echo ('<td>'); WriteLanguagesWithoutSel($LineItem['Language']); echo('</td>');
45 }
46 echo('</tr>');
47 foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
48 {
49 if ($Line[0][$TextItem['Column']] <> '') {
50 echo('<tr>
51 <th>'.$TextItem['Name'].'</th>');
52 foreach($Line as $Index => $LineItem) {
53 echo ('<td>'.htmlspecialchars($LineItem[$TextItem['Column']]).'</td>');
54 if ($Index > 1)
55 CompareString(htmlspecialchars($Line[$Index][$TextItem['Column']]),htmlspecialchars($Line[$Index-1][$TextItem['Column']]));
56 }
57 echo ('</tr>');
58 }
59 }
60 echo('</table></div>');
61
62
63
64} else
65{
66 // include 'ListQuests.php';
67 echo('Nebylo zadáno ID <a href="index.php">zpět</a>');
68}
69
70ShowFooter();
71
72?>
73
Note: See TracBrowser for help on using the repository browser.