Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
addcpm-json
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Александр Чаплыгин
addcpm-json
Commits
cdcf726b
Commit
cdcf726b
authored
May 27, 2019
by
Александр Чаплыгин
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Правка в логике сортировки по статусам, отключил логику утверждения
parent
0b8e1b47
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
336 additions
and
18 deletions
+336
-18
styles-feeds-stat.css
src/public/css/styles-feeds-stat.css
+45
-5
jquery.table2excel.js
src/public/js/jquery.table2excel.js
+208
-0
script-feeds-stat-table.js
src/public/js/script-feeds-stat-table.js
+21
-8
script-feeds-stat.js
src/public/js/script-feeds-stat.js
+16
-3
Cabinet.php
src/src/App/Action/User/Cabinet.php
+8
-0
cabinet-feed.phtml
src/templates/app/user/cabinet-feed.phtml
+38
-2
No files found.
src/public/css/styles-feeds-stat.css
View file @
cdcf726b
...
@@ -274,11 +274,17 @@ input[type="checkbox"]
...
@@ -274,11 +274,17 @@ input[type="checkbox"]
/* .b-basket-content */
/* .b-basket-content */
.table.table-striped.admin.transactions
thead
tr
th
.status
,
.table.table-striped.admin.transactions
thead
tr
th
.period
.table.table-striped.admin.transactions
thead
tr
th
.period
{
{
width
:
1px
;
width
:
1px
;
}
}
.table.table-striped.admin.transactions
thead
tr
th
.status
b
{
}
.table.table-striped.admin
thead
tr
th
.Timestamp
.table.table-striped.admin
thead
tr
th
.Timestamp
{
{
width
:
1px
;
width
:
1px
;
...
@@ -309,7 +315,7 @@ input[type="checkbox"]
...
@@ -309,7 +315,7 @@ input[type="checkbox"]
.table.table-striped.admin
thead
tr
th
.Basket
.basket-link
.table.table-striped.admin
thead
tr
th
.Basket
.basket-link
{
{
width
:
53
0px
;
width
:
47
0px
;
}
}
.table.table-striped.admin.viewid
thead
tr
th
.Basket
.basket-link
.table.table-striped.admin.viewid
thead
tr
th
.Basket
.basket-link
...
@@ -326,15 +332,26 @@ input[type="checkbox"]
...
@@ -326,15 +332,26 @@ input[type="checkbox"]
.table.table-striped.admin
thead
tr
th
.Basket
.quantity
.table.table-striped.admin
thead
tr
th
.Basket
.quantity
{
{
text-align
:
center
;
text-align
:
left
;
width
:
55px
;
width
:
55px
;
}
}
.table.table-striped.admin
thead
tr
th
.Basket
.price
{
text-align
:
right
;
width
:
45px
;
}
.table.table-striped.admin
td
.Basket
.table.table-striped.admin
td
.Basket
{
{
padding
:
2px
;
padding
:
2px
;
}
}
.table.table-striped.admin.transactions
td
.status
{
text-align
:
center
;
}
.table.table-striped.admin.transactions
td
.OrderSum
.table.table-striped.admin.transactions
td
.OrderSum
{
{
font-weight
:
bold
;
font-weight
:
bold
;
...
@@ -385,7 +402,7 @@ input[type="checkbox"]
...
@@ -385,7 +402,7 @@ input[type="checkbox"]
.b-basket-content
.basket-link
.b-basket-content
.basket-link
{
{
display
:
inline-block
;
display
:
inline-block
;
width
:
54
0px
;
width
:
47
0px
;
}
}
table
.viewid
.b-basket-content
table
table
.viewid
.b-basket-content
table
...
@@ -425,8 +442,8 @@ input[type="checkbox"]
...
@@ -425,8 +442,8 @@ input[type="checkbox"]
.b-basket-content
.price
.b-basket-content
.price
{
{
display
:
inline-block
;
display
:
inline-block
;
width
:
10
0px
;
width
:
7
0px
;
text-align
:
lef
t
;
text-align
:
righ
t
;
}
}
table
.viewid
.b-basket-content
.price
table
.viewid
.b-basket-content
.price
...
@@ -567,4 +584,26 @@ input[type="checkbox"]
...
@@ -567,4 +584,26 @@ input[type="checkbox"]
background-color
:
#009444
;
background-color
:
#009444
;
}
}
#table2excel
{
/*display: none;*/
}
.b-export-xls
{
margin
:
-10px
0
10px
0
;
height
:
30px
;
clear
:
both
;
}
button
#btnExport
{
float
:
right
;
padding
:
4px
12px
;
color
:
#fff
;
border-radius
:
4px
;
background-color
:
#337ab7
;
border-color
:
#2e6da4
;
border
:
0
;
}
\ No newline at end of file
src/public/js/jquery.table2excel.js
0 → 100644
View file @
cdcf726b
//table2excel.js
;(
function
(
$
,
window
,
document
,
undefined
)
{
var
pluginName
=
"table2excel"
,
defaults
=
{
exclude
:
".noExl"
,
name
:
"Table2Excel"
};
// The actual plugin constructor
function
Plugin
(
element
,
options
)
{
this
.
element
=
element
;
// jQuery has an extend method which merges the contents of two or
// more objects, storing the result in the first object. The first object
// is generally empty as we don't want to alter the default options for
// future instances of the plugin
//
this
.
settings
=
$
.
extend
(
{},
defaults
,
options
);
this
.
_defaults
=
defaults
;
this
.
_name
=
pluginName
;
this
.
init
();
}
Plugin
.
prototype
=
{
init
:
function
()
{
var
e
=
this
;
var
utf8Heading
=
"<meta http-equiv=
\"
content-type
\"
content=
\"
application/vnd.ms-excel; charset=UTF-8
\"
>"
;
e
.
template
=
{
head
:
"<html xmlns:o=
\"
urn:schemas-microsoft-com:office:office
\"
xmlns:x=
\"
urn:schemas-microsoft-com:office:excel
\"
xmlns=
\"
http://www.w3.org/TR/REC-html40
\"
>"
+
utf8Heading
+
"<head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets>"
,
sheet
:
{
head
:
"<x:ExcelWorksheet><x:Name>"
,
tail
:
"</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet>"
},
mid
:
"</x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body>"
,
table
:
{
head
:
"<table>"
,
tail
:
"</table>"
},
foot
:
"</body></html>"
};
e
.
tableRows
=
[];
// get contents of table except for exclude
$
(
e
.
element
).
each
(
function
(
i
,
o
)
{
var
tempRows
=
""
;
$
(
o
).
find
(
"tr"
).
not
(
e
.
settings
.
exclude
).
each
(
function
(
i
,
p
)
{
tempRows
+=
"<tr>"
;
$
(
p
).
find
(
"td,th"
).
not
(
e
.
settings
.
exclude
).
each
(
function
(
i
,
q
)
{
// p did not exist, I corrected
var
flag
=
$
(
q
).
find
(
e
.
settings
.
exclude
);
// does this <td> have something with an exclude class
if
(
flag
.
length
>=
1
)
{
tempRows
+=
"<td> </td>"
;
// exclude it!!
}
else
{
tempRows
+=
"<td>"
+
$
(
q
).
html
()
+
"</td>"
;
}
});
tempRows
+=
"</tr>"
;
});
// exclude img tags
if
(
e
.
settings
.
exclude_img
)
{
tempRows
=
exclude_img
(
tempRows
);
}
// exclude link tags
if
(
e
.
settings
.
exclude_links
)
{
tempRows
=
exclude_links
(
tempRows
);
}
// exclude input tags
if
(
e
.
settings
.
exclude_inputs
)
{
tempRows
=
exclude_inputs
(
tempRows
);
}
e
.
tableRows
.
push
(
tempRows
);
});
e
.
tableToExcel
(
e
.
tableRows
,
e
.
settings
.
name
,
e
.
settings
.
sheetName
);
},
tableToExcel
:
function
(
table
,
name
,
sheetName
)
{
var
e
=
this
,
fullTemplate
=
""
,
i
,
link
,
a
;
e
.
format
=
function
(
s
,
c
)
{
return
s
.
replace
(
/{
(\w
+
)
}/g
,
function
(
m
,
p
)
{
return
c
[
p
];
});
};
sheetName
=
typeof
sheetName
===
"undefined"
?
"Sheet"
:
sheetName
;
e
.
ctx
=
{
worksheet
:
name
||
"Worksheet"
,
table
:
table
,
sheetName
:
sheetName
};
fullTemplate
=
e
.
template
.
head
;
if
(
$
.
isArray
(
table
)
)
{
for
(
i
in
table
)
{
//fullTemplate += e.template.sheet.head + "{worksheet" + i + "}" + e.template.sheet.tail;
fullTemplate
+=
e
.
template
.
sheet
.
head
+
sheetName
+
i
+
e
.
template
.
sheet
.
tail
;
}
}
fullTemplate
+=
e
.
template
.
mid
;
if
(
$
.
isArray
(
table
)
)
{
for
(
i
in
table
)
{
fullTemplate
+=
e
.
template
.
table
.
head
+
"{table"
+
i
+
"}"
+
e
.
template
.
table
.
tail
;
}
}
fullTemplate
+=
e
.
template
.
foot
;
for
(
i
in
table
)
{
e
.
ctx
[
"table"
+
i
]
=
table
[
i
];
}
delete
e
.
ctx
.
table
;
var
isIE
=
/*@cc_on!@*/
false
||
!!
document
.
documentMode
;
// this works with IE10 and IE11 both :)
//if (typeof msie !== "undefined" && msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) // this works ONLY with IE 11!!!
if
(
isIE
)
{
if
(
typeof
Blob
!==
"undefined"
)
{
//use blobs if we can
fullTemplate
=
e
.
format
(
fullTemplate
,
e
.
ctx
);
// with this, works with IE
fullTemplate
=
[
fullTemplate
];
//convert to array
var
blob1
=
new
Blob
(
fullTemplate
,
{
type
:
"text/html"
});
window
.
navigator
.
msSaveBlob
(
blob1
,
getFileName
(
e
.
settings
)
);
}
else
{
//otherwise use the iframe and save
//requires a blank iframe on page called txtArea1
txtArea1
.
document
.
open
(
"text/html"
,
"replace"
);
txtArea1
.
document
.
write
(
e
.
format
(
fullTemplate
,
e
.
ctx
));
txtArea1
.
document
.
close
();
txtArea1
.
focus
();
sa
=
txtArea1
.
document
.
execCommand
(
"SaveAs"
,
true
,
getFileName
(
e
.
settings
)
);
}
}
else
{
var
blob
=
new
Blob
([
e
.
format
(
fullTemplate
,
e
.
ctx
)],
{
type
:
"application/vnd.ms-excel"
});
window
.
URL
=
window
.
URL
||
window
.
webkitURL
;
link
=
window
.
URL
.
createObjectURL
(
blob
);
a
=
document
.
createElement
(
"a"
);
a
.
download
=
getFileName
(
e
.
settings
);
a
.
href
=
link
;
document
.
body
.
appendChild
(
a
);
a
.
click
();
document
.
body
.
removeChild
(
a
);
}
return
true
;
}
};
function
getFileName
(
settings
)
{
return
(
settings
.
filename
?
settings
.
filename
:
"table2excel"
);
}
// Removes all img tags
function
exclude_img
(
string
)
{
var
_patt
=
/
(\s
+alt
\s
*=
\s
*"
([^
"
]
*
)
"|
\s
+alt
\s
*=
\s
*'
([^
'
]
*
)
'
)
/i
;
return
string
.
replace
(
/<img
[^
>
]
*>/gi
,
function
myFunction
(
x
){
var
res
=
_patt
.
exec
(
x
);
if
(
res
!==
null
&&
res
.
length
>=
2
)
{
return
res
[
2
];
}
else
{
return
""
;
}
});
}
// Removes all link tags
function
exclude_links
(
string
)
{
return
string
.
replace
(
/<a
[^
>
]
*>|<
\/
a>/gi
,
""
);
}
// Removes input params
function
exclude_inputs
(
string
)
{
var
_patt
=
/
(\s
+value
\s
*=
\s
*"
([^
"
]
*
)
"|
\s
+value
\s
*=
\s
*'
([^
'
]
*
)
'
)
/i
;
return
string
.
replace
(
/<input
[^
>
]
*>|<
\/
input>/gi
,
function
myFunction
(
x
){
var
res
=
_patt
.
exec
(
x
);
if
(
res
!==
null
&&
res
.
length
>=
2
)
{
return
res
[
2
];
}
else
{
return
""
;
}
});
}
$
.
fn
[
pluginName
]
=
function
(
options
)
{
var
e
=
this
;
e
.
each
(
function
()
{
if
(
!
$
.
data
(
e
,
"plugin_"
+
pluginName
)
)
{
$
.
data
(
e
,
"plugin_"
+
pluginName
,
new
Plugin
(
this
,
options
)
);
}
});
// chain jQuery functions
return
e
;
};
})(
jQuery
,
window
,
document
);
src/public/js/script-feeds-stat-table.js
View file @
cdcf726b
...
@@ -37,11 +37,18 @@ $(document).ready(function(){
...
@@ -37,11 +37,18 @@ $(document).ready(function(){
' <span><%=data.date %></span><br />
\
n'
+
' <span><%=data.date %></span><br />
\
n'
+
''
);
''
);
// Шаблон ячейки status
var
templateOrderStatusContent
=
_
.
template
(
'
\
n'
+
' <span class="order-id" data-order-id="<%=data.orderId %>" data-feed-id="<%=data.feedId %>">
\
n'
+
' <input type="checkbox" name="order-id" <%=data.confirmed %> <%=data.approved %>>
\
n'
+
' </span>
\
n'
+
''
);
// Шаблон ячейки OrderID
// Шаблон ячейки OrderID
var
templateOrderIDContent
=
_
.
template
(
'
\
n'
+
var
templateOrderIDContent
=
_
.
template
(
'
\
n'
+
' <span class="order-id" data-order-id="<%=data.orderId %>" data-feed-id="<%=data.feedId %>">
\
n'
+
' <span class="order-id" data-order-id="<%=data.orderId %>" data-feed-id="<%=data.feedId %>">
\
n'
+
' <input type="checkbox" name="order-id" <%=data.confirmed %> <%=data.approved %>>
\
n'
+
' <a class="orderid-link" href="orderid/<%=data.feedId %>/<%=data.orderId %>" target="_blank"><%=data.orderId %></a>
\
n'
+
' <a class="orderid-link" href="orderid/<%=data.feedId %>/<%=data.orderId %>" target="_blank"><%=data.orderId %></a>
\
n'
+
' </span>
\
n'
+
' </span>
\
n'
+
''
);
''
);
...
@@ -51,7 +58,6 @@ $(document).ready(function(){
...
@@ -51,7 +58,6 @@ $(document).ready(function(){
''
);
''
);
function
valueFormat
(
value
)
function
valueFormat
(
value
)
{
{
var
var
...
@@ -119,10 +125,6 @@ $(document).ready(function(){
...
@@ -119,10 +125,6 @@ $(document).ready(function(){
}
}
//console.log('AAA sortField = ', sortField, ' isDesc = ', isDesc);
//console.log('AAA sortField = ', sortField, ' isDesc = ', isDesc);
if
(
dataLineChartStat
.
report
==
'transactions'
)
{
console
.
log
(
'AAA dataLineChartStat = '
,
dataLineChartStat
.
ordersStatus
);
}
// Подготовка данных для сортировки:
// Подготовка данных для сортировки:
dataPeriod
.
forEach
(
function
(
dataTableItem
,
ind
){
dataPeriod
.
forEach
(
function
(
dataTableItem
,
ind
){
var
dataTableSortItem
=
{};
var
dataTableSortItem
=
{};
...
@@ -173,7 +175,7 @@ $(document).ready(function(){
...
@@ -173,7 +175,7 @@ $(document).ready(function(){
$row
=
$
(
'<tr class="transaction-item '
+
trClass
+
'">'
);
$row
=
$
(
'<tr class="transaction-item '
+
trClass
+
'">'
);
$row
.
append
(
$
(
'<td class="
OrderID">'
).
append
(
templateOrderID
Content
({
$row
.
append
(
$
(
'<td class="
status">'
).
append
(
templateOrderStatus
Content
({
data
:
{
data
:
{
feedId
:
item
[
'ViewID'
][
0
],
feedId
:
item
[
'ViewID'
][
0
],
orderId
:
item
[
'period'
],
orderId
:
item
[
'period'
],
...
@@ -181,6 +183,15 @@ $(document).ready(function(){
...
@@ -181,6 +183,15 @@ $(document).ready(function(){
approved
:
(
orderStatus
&&
orderStatus
.
approved
)
?
'disabled'
:
''
,
approved
:
(
orderStatus
&&
orderStatus
.
approved
)
?
'disabled'
:
''
,
}
}
})));
})));
$row
.
append
(
$
(
'<td class="OrderID">'
).
append
(
templateOrderIDContent
({
data
:
{
feedId
:
item
[
'ViewID'
][
0
],
orderId
:
item
[
'period'
],
//confirmed: (orderStatus && !orderStatus.confirmed) ? '' : 'checked',
//approved: (orderStatus && orderStatus.approved) ? 'disabled' : '',
}
})));
}
else
{
}
else
{
$row
=
$
(
'<tr>'
);
$row
=
$
(
'<tr>'
);
$row
.
append
(
$
(
'<td>'
).
html
(
item
[
'period'
]));
$row
.
append
(
$
(
'<td>'
).
html
(
item
[
'period'
]));
...
@@ -235,6 +246,7 @@ $(document).ready(function(){
...
@@ -235,6 +246,7 @@ $(document).ready(function(){
if
(
dataLineChartStat
.
report
==
'transactions'
)
{
if
(
dataLineChartStat
.
report
==
'transactions'
)
{
$row
=
$
(
'<tr class="total-orders all">'
);
$row
=
$
(
'<tr class="total-orders all">'
);
$row
.
append
(
$
(
'<td>'
));
$row
.
append
(
$
(
'<td>'
).
html
(
"Всего заказов: "
+
dataPeriod
.
length
));
$row
.
append
(
$
(
'<td>'
).
html
(
"Всего заказов: "
+
dataPeriod
.
length
));
activeLines
.
forEach
(
function
(
item
){
activeLines
.
forEach
(
function
(
item
){
...
@@ -257,6 +269,7 @@ $(document).ready(function(){
...
@@ -257,6 +269,7 @@ $(document).ready(function(){
// Добавляем total-строки для статусов заказов:
// Добавляем total-строки для статусов заказов:
ordersStatuses
.
forEach
(
function
(
item
){
ordersStatuses
.
forEach
(
function
(
item
){
$row
=
$
(
'<tr class="total-orders '
+
item
+
'">'
);
$row
=
$
(
'<tr class="total-orders '
+
item
+
'">'
);
$row
.
append
(
$
(
'<td>'
));
$row
.
append
(
$
(
'<td class="count">'
).
html
(
"Заказов: <span></span>"
));
$row
.
append
(
$
(
'<td class="count">'
).
html
(
"Заказов: <span></span>"
));
activeLines
.
forEach
(
function
(
activeLine
){
activeLines
.
forEach
(
function
(
activeLine
){
$row
.
append
(
$
(
'<td class="'
+
activeLine
+
'">'
));
$row
.
append
(
$
(
'<td class="'
+
activeLine
+
'">'
));
...
...
src/public/js/script-feeds-stat.js
View file @
cdcf726b
...
@@ -45,6 +45,7 @@ $(document).ready(function(){
...
@@ -45,6 +45,7 @@ $(document).ready(function(){
$chartStatErrorMessage
=
$
(
'.chart-graph-stat-error .message'
),
$chartStatErrorMessage
=
$
(
'.chart-graph-stat-error .message'
),
periodStatsData
,
periodStatsData
,
//campaignStatsData,
//campaignStatsData,
$exportExcelButton
=
$
(
"#btnExport"
),
dataLineChartStat
;
dataLineChartStat
;
...
@@ -221,6 +222,8 @@ $(document).ready(function(){
...
@@ -221,6 +222,8 @@ $(document).ready(function(){
//$('.main-cat').addClass('selected');
//$('.main-cat').addClass('selected');
renderLineChart
();
renderLineChart
();
renderHourTable
();
renderHourTable
();
$
.
TableStat
.
OrdersStatusReCalc
();
}
}
},
},
error
:
function
(
e
)
{
error
:
function
(
e
)
{
...
@@ -273,6 +276,16 @@ $(document).ready(function(){
...
@@ -273,6 +276,16 @@ $(document).ready(function(){
$chartTable
.
show
();
$chartTable
.
show
();
}
}
// Выгрузка таблицы в Excel
$exportExcelButton
.
click
(
function
(){
var
$tableToExcel
=
$
(
"#table2excel"
);
$tableToExcel
.
table2excel
({
exclude
:
".noExl"
,
name
:
"Worksheet Name"
,
filename
:
$tableToExcel
.
data
(
'content'
)
+
'.xls'
});
});
// Обработка контролов для таблицы transactions:
// Обработка контролов для таблицы transactions:
(
function
(){
(
function
(){
...
@@ -296,7 +309,7 @@ $(document).ready(function(){
...
@@ -296,7 +309,7 @@ $(document).ready(function(){
});
});
// Клик на галочку подтверждения заказа:
// Клик на галочку подтверждения заказа:
$tableStat
.
on
(
'change'
,
'td.
OrderID
input'
,
function
(
e
)
{
$tableStat
.
on
(
'change'
,
'td.
status
input'
,
function
(
e
)
{
var
var
$this
=
$
(
this
),
$this
=
$
(
this
),
...
@@ -335,6 +348,7 @@ $(document).ready(function(){
...
@@ -335,6 +348,7 @@ $(document).ready(function(){
});
});
// Клик на Утвердить заказы:
// Клик на Утвердить заказы:
/*
$('a.btn.approve').on('click', function(){
$('a.btn.approve').on('click', function(){
if (!confirm("Утвердить заказы за выбранный период?")) return false;
if (!confirm("Утвердить заказы за выбранный период?")) return false;
...
@@ -382,10 +396,9 @@ $(document).ready(function(){
...
@@ -382,10 +396,9 @@ $(document).ready(function(){
}
}
});
});
return false;
return false;
});
});
*/
// Пересчет кол-ва заказов по группам
// Пересчет кол-ва заказов по группам
function
OrdersStatusReCalc
()
function
OrdersStatusReCalc
()
...
...
src/src/App/Action/User/Cabinet.php
View file @
cdcf726b
...
@@ -95,6 +95,13 @@ class Cabinet extends Common
...
@@ -95,6 +95,13 @@ class Cabinet extends Common
$auth
=
$this
->
container
->
get
(
UserService
::
class
);
$auth
=
$this
->
container
->
get
(
UserService
::
class
);
$userId
=
$auth
->
getIdentity
()
->
getId
();
$userId
=
$auth
->
getIdentity
()
->
getId
();
/** @var \App\Model\Feeds\Shops $shopsModel */
$shopsModel
=
$this
->
container
->
get
(
\App\Model\Feeds\Shops
::
class
);
$shop
=
$shopsModel
->
findOne
([
'users_id'
=>
$userId
]);
if
(
$shop
)
{
$shop_title
=
$shop
->
getTitle
();
}
/** @var \App\Model\Feeds $feedsModel */
/** @var \App\Model\Feeds $feedsModel */
$feedsModel
=
$this
->
container
->
get
(
Feeds
::
class
);
$feedsModel
=
$this
->
container
->
get
(
Feeds
::
class
);
$feeds
=
$feedsModel
->
findAll
([
'clientid'
=>
$userId
])
->
toArray
();
$feeds
=
$feedsModel
->
findAll
([
'clientid'
=>
$userId
])
->
toArray
();
...
@@ -154,6 +161,7 @@ class Cabinet extends Common
...
@@ -154,6 +161,7 @@ class Cabinet extends Common
$periodStats
[
'ordersStatus'
]
=
$statuses
;
$periodStats
[
'ordersStatus'
]
=
$statuses
;
}
}
$data
[
'shop_title'
]
=
$shop_title
;
$data
[
'feeds'
]
=
$feeds
;
$data
[
'feeds'
]
=
$feeds
;
$data
[
'current_report'
]
=
$report_type
;
$data
[
'current_report'
]
=
$report_type
;
$data
[
'current_period'
]
=
$current_period
;
$data
[
'current_period'
]
=
$current_period
;
...
...
src/templates/app/user/cabinet-feed.phtml
View file @
cdcf726b
...
@@ -32,6 +32,7 @@ $this->headScript()
...
@@ -32,6 +32,7 @@ $this->headScript()
->
appendFile
(
'/js/c3.min.js'
)
->
appendFile
(
'/js/c3.min.js'
)
->
appendFile
(
'/js/d3.min.js'
)
->
appendFile
(
'/js/d3.min.js'
)
->
appendFile
(
'/js/datepicker.min.js'
)
->
appendFile
(
'/js/datepicker.min.js'
)
->
appendFile
(
'/js/jquery.table2excel.js'
)
->
appendFile
(
'/js/script-feeds-stat-charts.js'
)
->
appendFile
(
'/js/script-feeds-stat-charts.js'
)
->
appendFile
(
'/js/script-feeds-stat-table.js'
)
->
appendFile
(
'/js/script-feeds-stat-table.js'
)
->
appendFile
(
'/js/script-feeds-stat.js'
)
->
appendFile
(
'/js/script-feeds-stat.js'
)
...
@@ -69,6 +70,7 @@ if (!$error) {
...
@@ -69,6 +70,7 @@ if (!$error) {
$reports_list
=
$this
->
reports_list
;
$reports_list
=
$this
->
reports_list
;
$periods_list
=
$this
->
periods_list
;
$periods_list
=
$this
->
periods_list
;
$colors_active_lines
=
$this
->
colors_active_lines
;
$colors_active_lines
=
$this
->
colors_active_lines
;
$shop_title
=
$this
->
shop_title
;
$data_request_link
=
$this
->
url
(
'user.cabinet'
,
[
'lang'
=>
$this
->
lang
,
'report'
=>
$current_report
]);
$data_request_link
=
$this
->
url
(
'user.cabinet'
,
[
'lang'
=>
$this
->
lang
,
'report'
=>
$current_report
]);
$system_link
=
$this
->
url
(
'adm.system.actions'
);
$system_link
=
$this
->
url
(
'adm.system.actions'
);
...
@@ -176,8 +178,10 @@ if (!$error) {
...
@@ -176,8 +178,10 @@ if (!$error) {
<?php
/* Переключатель статусов заказов */
?>
<?php
/* Переключатель статусов заказов */
?>
<div
class=
"b-filter__switch category-orders"
>
<div
class=
"b-filter__switch category-orders"
>
<span
class=
"b-filter__switch-item text all m-filter__switch-item_active"
data-order-category=
"all"
>
<?=
_t
(
'Все'
)
?>
</span>
<span
class=
"b-filter__switch-item text all m-filter__switch-item_active"
data-order-category=
"all"
>
<?=
_t
(
'Все'
)
?>
</span>
<?php
/* ?>
<span class="b-filter__switch-item text approved" data-order-category="approved"><?= _t('Согласованны')?></span>
<span class="b-filter__switch-item text approved" data-order-category="approved"><?= _t('Согласованны')?></span>
<span
class=
"b-filter__switch-item text confirmed"
data-order-category=
"confirmed"
>
<?=
_t
(
'Приняты'
)
?>
</span>
<?php */
?>
<span
class=
"b-filter__switch-item text confirmed"
data-order-category=
"confirmed"
>
<?=
_t
(
'Подтверждены'
)
?>
</span>
<span
class=
"b-filter__switch-item text rejected"
data-order-category=
"rejected"
>
<?=
_t
(
'Отклонены'
)
?>
</span>
<span
class=
"b-filter__switch-item text rejected"
data-order-category=
"rejected"
>
<?=
_t
(
'Отклонены'
)
?>
</span>
</div>
</div>
<?php
endif
?>
<?php
endif
?>
...
@@ -187,6 +191,9 @@ if (!$error) {
...
@@ -187,6 +191,9 @@ if (!$error) {
<table
id=
"table-line"
class=
"table table-striped admin
<?=
$current_report
?>
all"
data-link=
"
<?=
$data_request_link
?>
"
>
<table
id=
"table-line"
class=
"table table-striped admin
<?=
$current_report
?>
all"
data-link=
"
<?=
$data_request_link
?>
"
>
<thead
class=
"metric sortable"
>
<thead
class=
"metric sortable"
>
<tr>
<tr>
<th
class=
"status"
>
<b
class=
"not-sorted"
>
Подтвержден
</b>
</th>
<th
class=
"period"
data-id=
"period"
>
<th
class=
"period"
data-id=
"period"
>
<b
class=
"main-cat selected
<?php
if
(
!
$main_cat
[
'isSorted'
])
:
?>
not-sorted
<?php
endif
;
?>
"
data-cat=
"
<?=
$main_cat
[
'name'
]
?>
"
>
<?=
_t
(
$main_cat
[
'title'
])
?>
</b>
<b
class=
"main-cat selected
<?php
if
(
!
$main_cat
[
'isSorted'
])
:
?>
not-sorted
<?php
endif
;
?>
"
data-cat=
"
<?=
$main_cat
[
'name'
]
?>
"
>
<?=
_t
(
$main_cat
[
'title'
])
?>
</b>
</th>
</th>
...
@@ -215,10 +222,39 @@ if (!$error) {
...
@@ -215,10 +222,39 @@ if (!$error) {
</tbody>
</tbody>
</table>
</table>
<?php
if
(
$current_report
==
'transactions'
)
:
?>
<?php
/*
if($current_report == 'transactions'): ?>
<div class="b-orders_controls">
<div class="b-orders_controls">
<a class="btn btn-primary approve" href="<?= $system_link ?>">Утвердить заказы</a>
<a class="btn btn-primary approve" href="<?= $system_link ?>">Утвердить заказы</a>
</div>
</div>
<?php endif; */
?>
<?php
if
(
$current_report
==
'transactions'
)
:
?>
<table
id=
"table2excel"
data-content=
"shop-
<?=
$shop_title
?>
"
width=
"100%"
>
<?php
/* ?>
<thead class="metric sortable">
<tr>
<th>
<b><?= _t($report_main_cat[0]['title'])?></b>
</th>
<?php foreach($report_cats as $name => $title): ?>
<?php if ($name == 'Timestamp'): ?>
<th><b><?= _t('Дата время')?></b></th>
<?php else: ?>
<?php if (!in_array($name, ['ViewID', 'Basket'])): ?>
<th><b><?= _t($title)?></b></th>
<?php endif; ?>
<?php endif; ?>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
</tbody>
<?php */
?>
</table>
<div
class=
"b-export-xls"
>
<button
id=
"btnExport"
>
EXPORT to Excel
</button>
</div>
<?php
endif
;
?>
<?php
endif
;
?>
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment