Advertisement
Guest User

Untitled

a guest
Jun 11th, 2013
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.98 KB | None | 0 0
  1. DBI::getInstance()->reconnect($host, $user, $pass, "hw_db");
  2.  
  3. $states = new STH("SELECT * FROM tech_settings_state");
  4.  
  5. $sth_count = new STH();
  6. $sth_count->prepare("SELECT count(id) AS count, regions.description region_desc FROM hw_manager hw_ma J
  7. OIN tech_settings_regions regions ON regions.region=hw_ma.region WHERE hw_status=? GROUP BY hw_ma.region");
  8.  
  9. $center.="<table class=\"statistic_table\">
  10. <tr class=\"header_tr\">
  11. <td>Статус</td>
  12. <td>Регион</td>
  13. <td>Количество</td>
  14. </tr>";
  15.  
  16. while($state_row = $states->fetch_assoc()) {
  17.  
  18.         $sth_count->q_prepared($state_row['state']);
  19.  
  20.         while ($count_info = $sth_count->fetch_assoc()) {
  21.                 $center.="<tr><td>"
  22.                 .$state_row['description']."
  23.                </td>";
  24.                 $center.="<td>
  25.                ".$count_info['region_desc']."
  26.                </td>
  27.                <td>
  28.                ".$count_info['count']."
  29.                </td></tr>";
  30.         }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement