Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE PROCEDURE [dbo].[dashboard_tst-dashboard_getCounters]
- @username nvarchar(128)
- AS
- BEGIN
- -- панель чисел вверху дашборда
- select
- 'Customers' Title,
- 'Registered customers in the system' Tooltip,
- 'fa fa-user-tie' Icon,
- cast((select count(*) from tst_customers) as nvarchar) Number,
- '<div class="text-danger">VIP - '+cast((select count(*) from tst_customers where vip = 1) as nvarchar)+'</div>' AdditionalNumber,
- 'Go' DownTitle,
- '/tst-customers' DownLink
- union all
- select
- 'Products' Title,
- 'Product count' Tooltip,
- 'fa fas fa-boxes' Icon,
- cast((select count(*) from tst_products where isnull(isVisible,0) != 1) as nvarchar) Number,
- 'Hided - '+cast((select count(*) from tst_products where isnull(isVisible,0) = 0) as nvarchar) AdditionalNumber,
- 'Go' DownTitle,
- '/tst-cardproducts' DownLink
- union all
- select
- 'Sold' Title,
- 'Number of items sold' Tooltip,
- 'fa fas fa-check' Icon,
- cast((select sum(cnt) from tst_orders) as nvarchar) Number,
- 'Products' AdditionalNumber,
- 'Go' DownTitle,
- '/tst-kanban' DownLink
- union all
- select
- 'Sum' Title,
- 'Total order sum' Tooltip,
- 'fa fas fa-rub' Icon,
- '10.465' Number, -- cast((select sum(cnt*price)/1000000 from tst_orders) as nvarchar) Number,
- 'dollars' AdditionalNumber,
- 'Go' DownTitle,
- '/tst-chartbar' DownLink
- -- здесь можно переименовать динамически названия панелей дашборда (panelCode1 - это код соответствующей панели)
- select 'Name 1' panelCode1, 'Name 2' panelCode2
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement