From b4c58cd09ff3251041d9cd6f946f7875608a132c Mon Sep 17 00:00:00 2001 From: Thomas Mudrunka Date: Sat, 20 Aug 2011 02:51:11 +0200 Subject: [PATCH] Ve statistikach umozneno zobrazeni podle mesice --- assistants/stats.inc.php | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/assistants/stats.inc.php b/assistants/stats.inc.php index 404a601..bd84300 100644 --- a/assistants/stats.inc.php +++ b/assistants/stats.inc.php @@ -1,9 +1,29 @@ db->quote($_GET['month']); +} +?> + +
+ YYYY-MM: + +
+ 'SELECT COUNT(item_id),SUM(item_price_in) FROM item WHERE item_valid_till=0', - 'Použito celkem' => 'SELECT COUNT(item_id),SUM(item_price_in) FROM item WHERE item_valid_till=0 AND status_id = 2', - 'Prodáno celkem' => 'SELECT COUNT(item_id),SUM(item_price_in) FROM item WHERE item_valid_till=0 AND status_id = 3', - 'Počet kusů skladem' => 'SELECT room_id,room_name,model_id,model_name,model_barcode,COUNT(item_id)'. + "Nakoupeno celkem $month" + => 'SELECT COUNT(item_id),SUM(item_price_in) FROM item WHERE item_valid_till=0'.$month_sql, + "Použito celkem $month" + => 'SELECT COUNT(item_id),SUM(item_price_in) FROM item WHERE item_valid_till=0 AND status_id = 2'.$month_sql, + "Prodáno celkem $month" + => 'SELECT COUNT(item_id),SUM(item_price_in) FROM item WHERE item_valid_till=0 AND status_id = 3'.$month_sql, + "Počet kusů skladem" + => 'SELECT room_id,room_name,model_id,model_name,model_barcode,COUNT(item_id)'. ' FROM item LEFT JOIN model USING(model_id) LEFT JOIN room USING(room_id)'. ' WHERE item_valid_till=0 AND status_id=1'. ' GROUP BY model_id,room_id'. -- 2.30.2