Changeset 142 for minimanager/repair.php
- Timestamp:
- Nov 23, 2007, 11:29:33 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
minimanager/repair.php
r19 r142 16 16 //############################################################################################## 17 17 function repair_form(){ 18 global $lang_global, $lang_repair, $output, $realm_db, $realm_id, $mangos_db ;19 18 global $lang_global, $lang_repair, $output, $realm_db, $realm_id, $mangos_db, $characters_db; 19 20 20 $output .= "<center> 21 <fieldset style=\"width: 700px;\">21 <fieldset class=\"tquarter_frame\"> 22 22 <legend>{$lang_repair['repair_optimize']}</legend> 23 23 <form action=\"repair.php?action=do_repair\" method=\"post\" name=\"form\"> … … 34 34 </table><p>{$lang_repair['select_tables']}</p>"; 35 35 $output .="<script type=\"text/javascript\" src=\"js/check.js\"></script>"; 36 36 37 37 $sql = new SQL; 38 38 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']); 39 39 40 40 $result = $sql->query("SHOW TABLES FROM {$realm_db['name']}"); 41 41 42 42 $output .= "<table class=\"lined\" style=\"width: 550px;\"> 43 43 <tr> … … 48 48 </tr> 49 49 <tr class=\"large_bold\"><td colspan=\"3\" class=\"hidden\" align=\"left\">{$realm_db['name']} {$lang_repair['tables']} :</td></tr>"; 50 50 51 51 while ($table = $sql->fetch_row($result)){ 52 52 $result1 = $sql->query("SELECT count(*) FROM `$table[0]`"); 53 53 $result2 = $sql->query("CHECK TABLE `$table[0]` CHANGED"); 54 54 55 55 $output .= "<tr> 56 56 <td><input type=\"checkbox\" name=\"check[]\" value=\"realm~0~{$realm_db['name']}~$table[0]\" onclick=\"CheckCheckAll(document.form);\" /></td> … … 63 63 foreach ($mangos_db as $db){ 64 64 $output .= "<tr class=\"large_bold\"><td colspan=\"3\" class=\"hidden\" align=\"left\">{$db['name']} Tables :</td></tr>"; 65 65 66 66 $sql->connect($db['addr'], $db['user'], $db['pass'], $db['name']); 67 67 $result = $sql->query("SHOW TABLES FROM {$db['name']}"); … … 70 70 $result1 = $sql->query("SELECT count(*) FROM `$table[0]`"); 71 71 $result2 = $sql->query("CHECK TABLE `$table[0]` CHANGED"); 72 72 73 73 $output .= "<tr> 74 74 <td><input type=\"checkbox\" name=\"check[]\" value=\"world~{$db['id']}~{$db['name']}~$table[0]\" onclick=\"CheckCheckAll(document.form);\" /></td> … … 79 79 } 80 80 } 81 81 82 //$output .= "</table></form></fieldset><br /><br /></center>"; 83 84 foreach ($characters_db as $db){ 85 $output .= "<tr class=\"large_bold\"><td colspan=\"3\" class=\"hidden\" align=\"left\">{$db['name']} Tables :</td></tr>"; 86 87 $sql->connect($db['addr'], $db['user'], $db['pass'], $db['name']); 88 $result = $sql->query("SHOW TABLES FROM {$db['name']}"); 89 90 while ($table = $sql->fetch_row($result)){ 91 $result1 = $sql->query("SELECT count(*) FROM `$table[0]`"); 92 $result2 = $sql->query("CHECK TABLE `$table[0]` CHANGED"); 93 94 $output .= "<tr> 95 <td><input type=\"checkbox\" name=\"check[]\" value=\"world~{$db['id']}~{$db['name']}~$table[0]\" onclick=\"CheckCheckAll(document.form);\" /></td> 96 <td>$table[0]</td> 97 <td>".$sql->result($result2, 0, 'Msg_type')." : ".$sql->result($result2, 0, 'Msg_text')."</td> 98 <td>".$sql->result($result1, 0)."</td> 99 </tr>"; 100 } 101 } 102 82 103 $output .= "</table></form></fieldset><br /><br /></center>"; 83 104 } … … 106 127 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']); 107 128 } else { 129 if ($table_data[0] == "mangos"){ 108 130 $sql->connect($mangos_db[$table_data[1]]['addr'], $mangos_db[$table_data[1]]['user'], $mangos_db[$table_data[1]]['pass']); 131 } else { 132 $sql->connect($characters_db[$table_data[1]]['addr'], $characters_db[$table_data[1]]['user'], $characters_db[$table_data[1]]['pass']); 109 133 } 134 } 110 135 111 136 $result = $sql->query("$table_action TABLE {$table_data[2]}.`{$table_data[3]}`"); 112 137 $action_result = $sql->fetch_row($result); 113 138 114 139 if ($action_result[3] === "OK") $counter++; 115 140 else $err = $action_result[3]; … … 127 152 $num = (isset($_GET['num'])) ? $_GET['num'] : NULL; 128 153 $rep_err = (isset($_GET['rep_err'])) ? $_GET['rep_err'] : NULL; 129 154 130 155 $output .= "<div class=\"top\">"; 131 156 switch ($err) {
Note:
See TracChangeset
for help on using the changeset viewer.