From: Thomas Mudrunka Date: Sat, 20 Aug 2011 00:51:11 +0000 (+0200) Subject: Ve statistikach umozneno zobrazeni podle mesice X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=b4c58cd09ff3251041d9cd6f946f7875608a132c;p=mirrors%2FSokoMan.git Ve statistikach umozneno zobrazeni podle mesice --- 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'.