Changeset 19 for minimanager/repair.php
- Timestamp:
- Aug 13, 2007, 9:05:34 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
minimanager/repair.php
r5 r19 35 35 $output .="<script type=\"text/javascript\" src=\"js/check.js\"></script>"; 36 36 37 $ mysql = new MySQL;38 $ mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);37 $sql = new SQL; 38 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']); 39 39 40 $result = $ mysql->query("SHOW TABLES FROM {$realm_db['name']}");40 $result = $sql->query("SHOW TABLES FROM {$realm_db['name']}"); 41 41 42 42 $output .= "<table class=\"lined\" style=\"width: 550px;\"> 43 43 <tr> 44 <t d width=\"5%\" class=\"head\"><input name=\"allbox\" type=\"checkbox\" value=\"Check All\" onclick=\"CheckAll(document.form);\" /></td>45 <t d width=\"25%\" class=\"head\">{$lang_repair['table_name']}</td>46 <t d width=\"35%\" class=\"head\">{$lang_repair['status']}</td>47 <t d width=\"15%\" class=\"head\">{$lang_repair['num_records']}</td>44 <th width=\"5%\"><input name=\"allbox\" type=\"checkbox\" value=\"Check All\" onclick=\"CheckAll(document.form);\" /></th> 45 <th width=\"25%\">{$lang_repair['table_name']}</th> 46 <th width=\"35%\">{$lang_repair['status']}</th> 47 <th width=\"15%\">{$lang_repair['num_records']}</th> 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 while ($table = $ mysql->fetch_row($result)){52 $result1 = $ mysql->query("SELECT count(*) FROM `$table[0]`");53 $result2 = $ mysql->query("CHECK TABLE `$table[0]` CHANGED");51 while ($table = $sql->fetch_row($result)){ 52 $result1 = $sql->query("SELECT count(*) FROM `$table[0]`"); 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> 57 57 <td>$table[0]</td> 58 <td>".$ mysql->result($result2, 0, 'Msg_type')." : ".$mysql->result($result2, 0, 'Msg_text')."</td>59 <td>".$ mysql->result($result1, 0)."</td>58 <td>".$sql->result($result2, 0, 'Msg_type')." : ".$sql->result($result2, 0, 'Msg_text')."</td> 59 <td>".$sql->result($result1, 0)."</td> 60 60 </tr>"; 61 61 } … … 64 64 $output .= "<tr class=\"large_bold\"><td colspan=\"3\" class=\"hidden\" align=\"left\">{$db['name']} Tables :</td></tr>"; 65 65 66 $ mysql->connect($db['addr'], $db['user'], $db['pass'], $db['name']);67 $result = $ mysql->query("SHOW TABLES FROM {$db['name']}");66 $sql->connect($db['addr'], $db['user'], $db['pass'], $db['name']); 67 $result = $sql->query("SHOW TABLES FROM {$db['name']}"); 68 68 69 while ($table = $ mysql->fetch_row($result)){70 $result1 = $ mysql->query("SELECT count(*) FROM `$table[0]`");71 $result2 = $ mysql->query("CHECK TABLE `$table[0]` CHANGED");69 while ($table = $sql->fetch_row($result)){ 70 $result1 = $sql->query("SELECT count(*) FROM `$table[0]`"); 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> 75 75 <td>$table[0]</td> 76 <td>".$ mysql->result($result2, 0, 'Msg_type')." : ".$mysql->result($result2, 0, 'Msg_text')."</td>77 <td>".$ mysql->result($result1, 0)."</td>76 <td>".$sql->result($result2, 0, 'Msg_type')." : ".$sql->result($result2, 0, 'Msg_text')."</td> 77 <td>".$sql->result($result1, 0)."</td> 78 78 </tr>"; 79 79 } … … 97 97 } 98 98 99 $ mysql = new MySQL;99 $sql = new SQL; 100 100 $counter = 0; 101 101 … … 104 104 $table_data = explode("~", $table); 105 105 if ($table_data[0] == "realm"){ 106 $ mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass']);106 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']); 107 107 } else { 108 $ mysql->connect($mangos_db[$table_data[1]]['addr'], $mangos_db[$table_data[1]]['user'], $mangos_db[$table_data[1]]['pass']);108 $sql->connect($mangos_db[$table_data[1]]['addr'], $mangos_db[$table_data[1]]['user'], $mangos_db[$table_data[1]]['pass']); 109 109 } 110 110 111 $result = $ mysql->query("$table_action TABLE {$table_data[2]}.`{$table_data[3]}`");112 $action_result = $ mysql->fetch_row($result);111 $result = $sql->query("$table_action TABLE {$table_data[2]}.`{$table_data[3]}`"); 112 $action_result = $sql->fetch_row($result); 113 113 114 114 if ($action_result[3] === "OK") $counter++;
Note:
See TracChangeset
for help on using the changeset viewer.