GetADODBConnection(); $orders_table = $application->getUnitOption('ord', 'TableName'); $totals = Array(); $sql_template = 'SELECT COUNT(*) FROM '.$orders_table.' WHERE Status = %s'; $totals['total'] = $db->GetOne('SELECT COUNT(*) FROM '.$orders_table); $statuses = Array( ORDER_STATUS_INCOMPLETE, ORDER_STATUS_PENDING, ORDER_STATUS_BACKORDERS, ORDER_STATUS_TOSHIP, ORDER_STATUS_PROCESSED, ORDER_STATUS_DENIED, ORDER_STATUS_ARCHIVED); foreach($statuses as $status) { $totals[$status] = $db->GetOne( sprintf($sql_template, $status) ); } $phrases = Array('la_tab_Orders','la_tab_Incomplete','la_tab_Pending','la_tab_BackOrders','la_tab_ToShip','la_tab_Processed','la_tab_Denied','la_tab_Archived'); $translation = Array(); foreach($phrases as $phrase_name) { $translation[$phrase_name] = $application->Phrase($phrase_name); } $module_path = $application->getUnitOption('ord', 'ModuleFolder'); $module_img_path = $application->BaseURL('/'.$module_path.'/admin_templates/img'); $img_path = $application->BaseURL('/kernel/admin_templates/img'); function kLink($t) { echo $GLOBALS['application']->HREF($t, '', Array(), 'index.php'); } function orderIcon($status = ORDER_STATUS_INCOMPLETE) { $status_map = Array(ORDER_STATUS_PENDING => '_pending', ORDER_STATUS_DENIED => '_disabled'); $icon = 'icon16_orders'.( isset($status_map[$status]) ? $status_map[$status] : '').'.gif'; echo $GLOBALS['module_img_path'].'itemicons/'.$icon; } ?>