Changeset 212 for trunk/action.php
- Timestamp:
- Jun 20, 2009, 3:52:12 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/action.php
r211 r212 49 49 echo('Nahradit: <input type="text" name="replace" /><br />'); 50 50 echo('<input type="submit" value="Najít/nahradit" /><br />'); 51 echo('</form>'); 51 echo('</form><br />'); 52 echo ('<a href="?action=dbkit&Take">Opravit data v sloupci Take</a><br />'); 53 echo ('<a href="?action=dbkit&ShortCut">Opravit data v sloupci ShortCut</a><br />'); 52 54 53 55 if (array_key_exists('find',$_POST)) { … … 87 89 } 88 90 } 91 92 //oprava dat v sloupci Take 93 if (array_key_exists('Take',$_GET)) { 94 echo ('Začínám opravovat Take: <br />'); 95 96 foreach($TranslationTree as $Group) { 97 $Table = $Group['TablePrefix']; 98 echo ($Table.' '); 99 100 $sql = 'SELECT ID,entry as entry_tran, (SELECT ID FROM '.$Table.' WHERE Language = 0 AND entry = entry_tran LIMIT 1) as ID_orig FROM '.$Table.' WHERE (Language <> 0) AND (Take = 0)'; 101 102 $ID = $Database->SQLCommand($sql); 103 while ($Line = mysql_fetch_assoc($ID)) { 104 $sql = 'UPDATE '.$Table.' SET Take = '.$Line['ID_orig'].' WHERE ID = '.$Line['ID']; 105 $Database->SQLCommand($sql); 106 echo ('.'); 107 } 108 109 echo (' <strong>Hotovo</strong> <br />'); 110 if (mysql_num_rows($ID) > 0) { 111 WriteLog('Použita oprava DB na sloupec Take '.mysql_num_rows($ID).' řádků z tabulky '.$Table, 4); 112 echo (' Použita oprava DB na sloupec Take '.mysql_num_rows($ID).' řádků z tabulky '.$Table.'<br />'); 113 } 114 } 115 } 116 //oprava dat ShortCut 117 if (array_key_exists('ShortCut',$_GET)) { 118 echo ('Začínám opravovat Take: <br />'); 119 120 121 $Tables = array ('global_strings','glue_strings'); 122 123 foreach($Tables as $Table) { 124 echo ($Table.' '); 125 $sql = 'SELECT gs_orig.ID, 126 gs_tran.entry, 127 gs_tran.ShortCut as ShortCut_tran, 128 gs_orig.ShortCut as ShortCut_orig 129 FROM '.$Table.' as gs_tran 130 JOIN '.$Table.' as gs_orig ON gs_orig.entry = gs_tran.entry 131 WHERE gs_tran.Language <> 0 AND gs_tran.ShortCut <> gs_orig.ShortCut'; 132 133 $ID = $Database->SQLCommand($sql); 134 while ($Line = mysql_fetch_assoc($ID)) { 135 $sql = 'UPDATE '.$Table.' SET ShortCut = '.$Line['ShortCut_orig'].' WHERE ID = '.$Line['ID']; 136 $Database->SQLCommand($sql); 137 echo ('.'); 138 } 139 140 echo (' <strong>Hotovo</strong> <br />'); 141 if (mysql_num_rows($ID) > 0) { 142 WriteLog('Použita oprava DB na sloupec ShortCut '.mysql_num_rows($ID).' řádků z tabulky '.$Table, 4); 143 echo (' Použita oprava DB na sloupec ShortCut '.mysql_num_rows($ID).' řádků z tabulky '.$Table.'<br />'); 144 } 145 } 146 } 89 147 } 90 148 … … 109 167 else echo('<input type="text" name="user" /><br />'); 110 168 echo('Text zprávy: <br> 111 <textarea name="text" cols="40"></textarea> <br />112 <input type="submit" value=" Uložit" /><br /></fieldset>169 <textarea onkeydown="ResizeTextArea(this)" name="text" cols="40"></textarea> <br /> 170 <input type="submit" value="Odeslat" /><br /></fieldset> 113 171 </form>'); 114 172 } else
Note:
See TracChangeset
for help on using the changeset viewer.