Index: src/system/classes/accounts/AdminBoxContentView.inc.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/system/classes/accounts/AdminBoxContentView.inc.php	(revision 682a1cce45d19fce34f085b778a8264dbe27dad3)
+++ src/system/classes/accounts/AdminBoxContentView.inc.php	(revision )
@@ -142,23 +142,22 @@
 	{
 		$t_result = xtc_db_query("SELECT
 										orders_status_name,
-										orders_status_id
-									FROM " . TABLE_ORDERS_STATUS . "
-									WHERE language_id = '" . (int)$_SESSION['languages_id'] . "'");
+										orders_status_id,
+										count(orders_id) as count
+									FROM " . TABLE_ORDERS_STATUS . ", " .TABLE_ORDERS."
+									WHERE language_id = '" . (int)$_SESSION['languages_id'] . "'
+									AND orders.orders_status = orders_status_id group by orders_status_id
+									");
 		while($t_orders_status_array = xtc_db_fetch_array($t_result))
 		{
-			$t_result2 = xtc_db_query("SELECT count(*) AS count
-													FROM " . TABLE_ORDERS . "
-													WHERE orders_status = '" . $t_orders_status_array['orders_status_id'] . "'");
-			$t_orders_pending_array = xtc_db_fetch_array($t_result2);
 			$t_url = "'".xtc_href_link_admin(FILENAME_ORDERS, 'selected_box=customers&status=' . $t_orders_status_array['orders_status_id'], 'NONSSL')."'";
 			if($_SESSION['style_edit_mode'] == 'edit')
 			{
-				$this->contentsArray[] = '<a href="#" onclick="if(confirm(\'' . ADMIN_LINK_INFO_TEXT . '\')){window.location.href='.$t_url.'; return false;} return false;">' . $t_orders_status_array['orders_status_name'] . '</a>: ' . $t_orders_pending_array['count'];
+				$this->contentsArray[] = '<a href="#" onclick="if(confirm(\'' . ADMIN_LINK_INFO_TEXT . '\')){window.location.href='.$t_url.'; return false;} return false;">' . $t_orders_status_array['orders_status_name'] . '</a>: ' . $t_orders_status_array['count'];
 			}
 			else
 			{
-				$this->contentsArray[] = '<a href="#" onclick="window.location.href='.$t_url.'; return false;">' . $t_orders_status_array['orders_status_name'] . '</a>: ' . $t_orders_pending_array['count'];
+				$this->contentsArray[] = '<a href="#" onclick="window.location.href='.$t_url.'; return false;">' . $t_orders_status_array['orders_status_name'] . '</a>: ' . $t_orders_status_array['count'];
 			}
 		}
 	}
@@ -167,23 +166,23 @@
 	{
 		$t_result = xtc_db_query("SELECT
 										orders_status_name,
-										orders_status_id
-									FROM " . TABLE_ORDERS_STATUS . "
-									WHERE language_id = '" . (int)$_SESSION['languages_id'] . "'");
+										orders_status_id,
+										count(orders_id) as count
+									FROM " . TABLE_ORDERS_STATUS . ", " .TABLE_ORDERS."
+									WHERE language_id = '" . (int)$_SESSION['languages_id'] . "'
+									AND orders.orders_status = orders_status_id group by orders_status_id"
+		);
 		while($t_orders_status_array = xtc_db_fetch_array($t_result))
 		{
-			$t_result2 = xtc_db_query("SELECT count(*) AS count
-													FROM " . TABLE_ORDERS . "
-													WHERE orders_status = '" . $t_orders_status_array['orders_status_id'] . "'");
-			$t_orders_pending_array = xtc_db_fetch_array($t_result2);
+
 			$t_url = "'".xtc_href_link_admin(FILENAME_ORDERS, 'selected_box=customers&status=' . $t_orders_status_array['orders_status_id'], 'NONSSL')."'";
 			if($_SESSION['style_edit_mode'] == 'edit')
 			{
-				$this->contents .= '<a href="#" onclick="if(confirm(\'' . ADMIN_LINK_INFO_TEXT . '\')){window.location.href='.$t_url.'; return false;} return false;">' . $t_orders_status_array['orders_status_name'] . '</a>: ' . $t_orders_pending_array['count'] . '<br />';
+				$this->contents .= '<a href="#" onclick="if(confirm(\'' . ADMIN_LINK_INFO_TEXT . '\')){window.location.href='.$t_url.'; return false;} return false;">' . $t_orders_status_array['orders_status_name'] . '</a>: ' . $t_orders_status_array['count'] . '<br />';
 			}
 			else
 			{
-				$this->contents .= '<a href="#" onclick="window.location.href='.$t_url.'; return false;">' . $t_orders_status_array['orders_status_name'] . '</a>: ' . $t_orders_pending_array['count'] . '<br />';
+				$this->contents .= '<a href="#" onclick="window.location.href='.$t_url.'; return false;">' . $t_orders_status_array['orders_status_name'] . '</a>: ' . $t_orders_status_array['count'] . '<br />';
 			}
 		}
 	}
\ No newline at end of file
