Changeset 79 for trunk/comparison.php
- Timestamp:
- Feb 9, 2009, 11:02:09 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/comparison.php
r78 r79 5 5 ShowPage(); 6 6 7 echo ('Text je porovnáván vždy ku předešlému (vlevo). Změny jsou zvýrazněny <span id="edit">barvou.</span><br><br>'); 8 7 9 function CompareString($String1, $String2) { 8 10 //TODO: barevné porovnání 9 //echo $String2; 11 //strcasecmp($String1, $String2) == 0 je totožné 12 // echo $String1.'<br><br>'; 13 $ArrStr1 = explode(' ',$String1); 14 $ArrStr2 = explode(' ',$String2); 15 16 for($i = 0;$i<count($ArrStr1);$i++) { 17 if (isset($ArrStr2[$i])) { 18 if ($ArrStr1[$i] == $ArrStr2[$i]) { 19 echo $ArrStr1[$i].' '; 20 } else { 21 $find = false; 22 for($j = 0;$j<count($ArrStr2);$j++) { 23 if ($ArrStr1[$i] == $ArrStr2[$j]) { 24 echo $ArrStr1[$i].' '; 25 $find = true; 26 } 27 } 28 if ($find == false) 29 echo '<span id="edit">'.$ArrStr1[$i].' </span>'; 30 } 31 } else echo '<span id="edit">'.$ArrStr1[$i].' </span>'; 32 } 33 // echo $ArrStr1[0]; 34 10 35 } 11 36 … … 34 59 <table border="1" cellpadding="1" cellspacing="0"> 35 60 <tr>'); 61 echo (' <th>ID textu</th>'); 62 foreach($Line as $Index => $LineItem) { 63 echo ('<td><a href="form.php?group='.$GroupId.'&ID='.$LineItem['ID'].'">'.$LineItem['ID'].'</a></td>'); 64 } 65 echo('</tr>'); 66 echo (' <th>Převzato</th>'); 67 foreach($Line as $Index => $LineItem) { 68 echo ('<td><a href="form.php?group='.$GroupId.'&ID='.$LineItem['Take'].'">'.$LineItem['Take'].'</a></td>'); 69 } 70 echo('</tr>'); 36 71 echo (' <th>Přeložil</th>'); 37 72 foreach($Line as $Index => $LineItem) { … … 50 85 echo('<tr> 51 86 <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']])); 87 for ($i = 0; $i < count($Line); $i++) { 88 if ($i >= 1) { 89 echo ('<td>'); 90 CompareString($Line[$i][$TextItem['Column']],$Line[$i-1][$TextItem['Column']]); 91 echo ('</td>'); 92 } else echo ('<td>'.$Line[$i][$TextItem['Column']].'</td>'); 56 93 } 57 94 echo ('</tr>');
Note:
See TracChangeset
for help on using the changeset viewer.