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
55f619f4
Commit
55f619f4
authored
Nov 16, 2018
by
Александр Чаплыгин
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Названия фидов в статистике вместо id, почистил проект
parent
9b2d5f7d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
13 additions
and
3814 deletions
+13
-3814
acl.global.php
src/config/autoload/acl.global.php
+0
-3
blog.global.php
src/config/autoload/blog.global.php
+0
-32
dependencies.global.php
src/config/autoload/dependencies.global.php
+0
-112
routes.global.php
src/config/autoload/routes.global.php
+2
-122
script-codestat.js
src/public/js/script-codestat.js
+0
-0
Blog.php
src/src/App/Action/Blog.php
+0
-131
Examples.php
src/src/App/Action/Examples.php
+0
-47
Site.php
src/src/App/Action/Site.php
+0
-117
Statistics.php
src/src/App/Action/Statistics.php
+0
-0
Cabinet.php
src/src/App/Action/User/Cabinet.php
+11
-2
Codestat.php
src/src/App/Action/User/Codestat.php
+0
-190
ApplyVacancy.php
src/src/App/Entity/ApplyVacancy.php
+0
-100
Article.php
src/src/App/Entity/Article.php
+0
-201
Provider.php
src/src/App/Entity/Provider.php
+0
-55
ProviderDomain.php
src/src/App/Entity/ProviderDomain.php
+0
-60
Site.php
src/src/App/Entity/Site.php
+0
-369
Slot.php
src/src/App/Entity/Slot.php
+0
-289
Blockers.php
src/src/App/Entity/Statistic/Blockers.php
+0
-128
Data.php
src/src/App/Entity/Statistic/Data.php
+0
-98
Site.php
src/src/App/Entity/Statistic/Site.php
+0
-247
Zone.php
src/src/App/Entity/Zone.php
+0
-328
ZoneAddition.php
src/src/App/Entity/ZoneAddition.php
+0
-96
Blockers.php
src/src/App/Hydrator/Blockers.php
+0
-63
Site.php
src/src/App/Hydrator/Site.php
+0
-65
Data.php
src/src/App/Hydrator/Strategy/Data.php
+0
-96
Providers.php
src/src/App/Model/Providers.php
+0
-68
ProvidersDomains.php
src/src/App/Model/ProvidersDomains.php
+0
-80
Sites.php
src/src/App/Model/Sites.php
+0
-191
Slots.php
src/src/App/Model/Slots.php
+0
-79
Zones.php
src/src/App/Model/Zones.php
+0
-184
ZonesAdditions.php
src/src/App/Model/ZonesAdditions.php
+0
-93
examples.phtml
src/templates/app/examples.phtml
+0
-41
add-site.phtml
src/templates/app/popup/add-site.phtml
+0
-45
statistics.phtml
src/templates/app/statistics.phtml
+0
-79
cabinet-feed.phtml
src/templates/app/user/cabinet-feed.phtml
+0
-2
cabinet.phtml
src/templates/app/user/cabinet.phtml
+0
-0
layout-main.phtml
src/templates/layout/layout-main.phtml
+0
-1
No files found.
src/config/autoload/acl.global.php
View file @
55f619f4
...
...
@@ -34,11 +34,8 @@ return [
->
allow
(
Roles
::
ROLE_GUEST
,
'user.mail.sent.password'
)
->
allow
(
Roles
::
ROLE_USER
,
'user.cabinet'
,
null
,
new
\App\Acl\Assertion\UserActive
())
->
allow
(
Roles
::
ROLE_USER
,
'user.cabinet.profile'
,
null
,
new
\App\Acl\Assertion\UserActive
())
->
allow
(
Roles
::
ROLE_USER
,
'site.add'
,
null
,
new
\App\Acl\Assertion\UserActive
())
->
allow
(
Roles
::
ROLE_USER
,
'site.remove'
,
null
,
new
\App\Acl\Assertion\UserActive
())
->
allow
(
Roles
::
ROLE_USER
,
'install.counter'
,
null
,
new
\App\Acl\Assertion\UserActive
())
->
allow
(
Roles
::
ROLE_USER
,
'download.counter'
,
null
,
new
\App\Acl\Assertion\UserActive
())
->
allow
(
Roles
::
ROLE_USER
,
'codestat'
)
->
allow
(
Roles
::
ROLE_GUEST
,
'email.counter'
)
->
allow
(
Roles
::
ROLE_GUEST
,
'adm.system.actions'
)
...
...
src/config/autoload/blog.global.php
deleted
100644 → 0
View file @
9b2d5f7d
<?php
/**
* Copyright (c) 2017 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
return
[
'blog'
=>
[
'articlesPerPage'
=>
12
,
]
];
\ No newline at end of file
src/config/autoload/dependencies.global.php
View file @
55f619f4
...
...
@@ -41,7 +41,6 @@ return [
$hpm
->
setService
(
\App\Entity\User
::
class
,
new
\Zend\Hydrator\ClassMethods
());
$hpm
->
setService
(
\App\Entity\UserType
::
class
,
new
\Zend\Hydrator\ClassMethods
());
$hpm
->
setService
(
\App\Entity\Caterogy
::
class
,
new
\Zend\Hydrator\ClassMethods
());
$hpm
->
setService
(
\App\Entity\UserCategory
::
class
,
new
\Zend\Hydrator\ClassMethods
());
$hpm
->
setService
(
\App\Entity\Country
::
class
,
new
\Zend\Hydrator\ClassMethods
());
$hpm
->
setService
(
\App\Entity\Currency
::
class
,
new
\Zend\Hydrator\ClassMethods
());
...
...
@@ -53,19 +52,7 @@ return [
//TODO: Delete this?
$hpm
->
setService
(
\App\Entity\Statistic\Site
::
class
,
new
\App\Hydrator\Site
());
$hpm
->
setService
(
\App\Entity\Statistic\Blockers
::
class
,
new
\App\Hydrator\Blockers
());
$hpm
->
setService
(
\App\Entity\Site
::
class
,
new
\Zend\Hydrator\ClassMethods
());
$hpm
->
setService
(
\App\Entity\Zone
::
class
,
new
\Zend\Hydrator\ClassMethods
());
$hpm
->
setService
(
\App\Entity\Provider
::
class
,
new
\Zend\Hydrator\ClassMethods
());
$hpm
->
setService
(
\App\Entity\ProviderDomain
::
class
,
new
\Zend\Hydrator\ClassMethods
());
$hpm
->
setService
(
\App\Entity\Code
::
class
,
new
\Zend\Hydrator\ClassMethods
());
$hpm
->
setService
(
\App\Entity\Slot
::
class
,
new
\Zend\Hydrator\ClassMethods
());
$hpm
->
setService
(
\App\Entity\RtbParam
::
class
,
new
\Zend\Hydrator\ClassMethods
());
$hpm
->
setService
(
\App\Entity\ZoneAddition
::
class
,
new
\Zend\Hydrator\ClassMethods
());
$hpm
->
setService
(
\App\Entity\Feeds\Feed
::
class
,
new
\Zend\Hydrator\ClassMethods
());
$hpm
->
setService
(
\App\Entity\Feeds\StatsDay
::
class
,
new
\Zend\Hydrator\ClassMethods
());
...
...
@@ -74,9 +61,7 @@ return [
$hpm
->
setService
(
\App\Entity\Contacts
::
class
,
new
\Zend\Hydrator\ClassMethods
());
$hpm
->
setService
(
\App\Entity\Feedback
::
class
,
new
\Zend\Hydrator\ClassMethods
());
$hpm
->
setService
(
\App\Entity\ApplyVacancy
::
class
,
new
\Zend\Hydrator\ClassMethods
());
$hpm
->
setService
(
\App\Entity\Article
::
class
,
new
\Zend\Hydrator\ClassMethods
());
$hpm
->
setService
(
\App\Entity\Tag
::
class
,
new
\Zend\Hydrator\ClassMethods
());
return
$hpm
;
...
...
@@ -163,103 +148,6 @@ return [
$container
->
get
(
\Monolog\Logger
::
class
)
);
},
\App\Model\Sites
::
class
=>
function
(
ContainerInterface
$container
)
{
return
new
\App\Model\Sites
(
new
Zend\Db\TableGateway\TableGateway
(
'sites'
,
$container
->
get
(
Zend\Db\Adapter\Adapter
::
class
),
new
\Zend\Db\TableGateway\Feature\MetadataFeature
(),
new
\Zend\Db\ResultSet\HydratingResultSet
(
$container
->
get
(
\Zend\Hydrator\DelegatingHydrator
::
class
),
new
\App\Entity\Site
())
),
$container
->
get
(
\Zend\Hydrator\DelegatingHydrator
::
class
),
$container
->
get
(
\Monolog\Logger
::
class
)
);
},
\App\Model\Zones
::
class
=>
function
(
ContainerInterface
$container
)
{
return
new
\App\Model\Zones
(
new
Zend\Db\TableGateway\TableGateway
(
'zones'
,
$container
->
get
(
Zend\Db\Adapter\Adapter
::
class
),
new
\Zend\Db\TableGateway\Feature\MetadataFeature
(),
new
\Zend\Db\ResultSet\HydratingResultSet
(
$container
->
get
(
\Zend\Hydrator\DelegatingHydrator
::
class
),
new
\App\Entity\Zone
())
),
$container
->
get
(
\Zend\Hydrator\DelegatingHydrator
::
class
),
$container
->
get
(
\Monolog\Logger
::
class
)
);
},
\App\Model\Providers
::
class
=>
function
(
ContainerInterface
$container
)
{
return
new
\App\Model\Providers
(
new
Zend\Db\TableGateway\TableGateway
(
'providers'
,
$container
->
get
(
Zend\Db\Adapter\Adapter
::
class
),
new
\Zend\Db\TableGateway\Feature\MetadataFeature
(),
new
\Zend\Db\ResultSet\HydratingResultSet
(
$container
->
get
(
\Zend\Hydrator\DelegatingHydrator
::
class
),
new
\App\Entity\Provider
())
),
$container
->
get
(
\Zend\Hydrator\DelegatingHydrator
::
class
),
$container
->
get
(
\Monolog\Logger
::
class
)
);
},
\App\Model\ProvidersDomains
::
class
=>
function
(
ContainerInterface
$container
)
{
return
new
\App\Model\ProvidersDomains
(
new
Zend\Db\TableGateway\TableGateway
(
'providers_domains'
,
$container
->
get
(
Zend\Db\Adapter\Adapter
::
class
),
new
\Zend\Db\TableGateway\Feature\MetadataFeature
(),
new
\Zend\Db\ResultSet\HydratingResultSet
(
$container
->
get
(
\Zend\Hydrator\DelegatingHydrator
::
class
),
new
\App\Entity\ProviderDomain
())
),
$container
->
get
(
\Zend\Hydrator\DelegatingHydrator
::
class
),
$container
->
get
(
\Monolog\Logger
::
class
)
);
},
\App\Model\Codes
::
class
=>
function
(
ContainerInterface
$container
)
{
return
new
\App\Model\Codes
(
new
Zend\Db\TableGateway\TableGateway
(
'codes'
,
$container
->
get
(
Zend\Db\Adapter\Adapter
::
class
),
new
\Zend\Db\TableGateway\Feature\MetadataFeature
(),
new
\Zend\Db\ResultSet\HydratingResultSet
(
$container
->
get
(
\Zend\Hydrator\DelegatingHydrator
::
class
),
new
\App\Entity\Code
())
),
$container
->
get
(
\Zend\Hydrator\DelegatingHydrator
::
class
),
$container
->
get
(
\Monolog\Logger
::
class
)
);
},
\App\Model\ZonesAdditions
::
class
=>
function
(
ContainerInterface
$container
)
{
return
new
\App\Model\ZonesAdditions
(
new
Zend\Db\TableGateway\TableGateway
(
'zones_additions'
,
$container
->
get
(
Zend\Db\Adapter\Adapter
::
class
),
new
\Zend\Db\TableGateway\Feature\MetadataFeature
(),
new
\Zend\Db\ResultSet\HydratingResultSet
(
$container
->
get
(
\Zend\Hydrator\DelegatingHydrator
::
class
),
new
\App\Entity\ZoneAddition
())
),
$container
->
get
(
\Zend\Hydrator\DelegatingHydrator
::
class
),
$container
->
get
(
\Monolog\Logger
::
class
)
);
},
\App\Model\Slots
::
class
=>
function
(
ContainerInterface
$container
)
{
return
new
\App\Model\Slots
(
new
Zend\Db\TableGateway\TableGateway
(
'slots'
,
$container
->
get
(
Zend\Db\Adapter\Adapter
::
class
),
new
\Zend\Db\TableGateway\Feature\MetadataFeature
(),
new
\Zend\Db\ResultSet\HydratingResultSet
(
$container
->
get
(
\Zend\Hydrator\DelegatingHydrator
::
class
),
new
\App\Entity\Slot
())
),
$container
->
get
(
\Zend\Hydrator\DelegatingHydrator
::
class
),
$container
->
get
(
\Monolog\Logger
::
class
)
);
},
\App\Model\RtbParams
::
class
=>
function
(
ContainerInterface
$container
)
{
return
new
\App\Model\RtbParams
(
new
Zend\Db\TableGateway\TableGateway
(
'rtb_params'
,
$container
->
get
(
Zend\Db\Adapter\Adapter
::
class
),
new
\Zend\Db\TableGateway\Feature\MetadataFeature
(),
new
\Zend\Db\ResultSet\HydratingResultSet
(
$container
->
get
(
\Zend\Hydrator\DelegatingHydrator
::
class
),
new
\App\Entity\RtbParam
())
),
$container
->
get
(
\Zend\Hydrator\DelegatingHydrator
::
class
),
$container
->
get
(
\Monolog\Logger
::
class
)
);
},
\App\Model\Feeds\Feeds
::
class
=>
function
(
ContainerInterface
$container
)
{
return
new
\App\Model\Feeds\Feeds
(
new
Zend\Db\TableGateway\TableGateway
(
...
...
src/config/autoload/routes.global.php
View file @
55f619f4
...
...
@@ -43,13 +43,7 @@ return [
$container
);
},
App\Action\Examples
::
class
=>
function
(
ContainerInterface
$container
)
{
return
new
App\Action\Examples
(
$container
->
get
(
\Zend\Expressive\Router\RouterInterface
::
class
),
$container
->
get
(
\Zend\Expressive\Template\TemplateRendererInterface
::
class
),
$container
);
},
App\Action\FAQ
::
class
=>
function
(
ContainerInterface
$container
)
{
return
new
App\Action\FAQ
(
$container
->
get
(
\Zend\Expressive\Router\RouterInterface
::
class
),
...
...
@@ -64,13 +58,6 @@ return [
$container
);
},
App\Action\User\Codestat
::
class
=>
function
(
ContainerInterface
$container
)
{
return
new
App\Action\User\Codestat
(
$container
->
get
(
\Zend\Expressive\Router\RouterInterface
::
class
),
$container
->
get
(
\Zend\Expressive\Template\TemplateRendererInterface
::
class
),
$container
);
},
App\Action\User\Profile
::
class
=>
function
(
ContainerInterface
$container
)
{
return
new
App\Action\User\Profile
(
$container
->
get
(
\Zend\Expressive\Router\RouterInterface
::
class
),
...
...
@@ -288,20 +275,6 @@ return [
]
],
],
[
'name'
=>
'examples'
,
'path'
=>
'/[:lang/]examples/'
,
'middleware'
=>
App\Action\Examples
::
class
,
'allowed_methods'
=>
[
'GET'
],
'options'
=>
[
'constraints'
=>
[
'lang'
=>
'[a-z]{2,3}'
,
],
'defaults'
=>
[
'lang'
=>
\App\Model\Locales
::
DEFAULT_LANG
,
]
],
],
[
'name'
=>
'faq'
,
'path'
=>
'/[:lang/]faq/'
,
...
...
@@ -333,21 +306,6 @@ return [
]
],
],
[
'name'
=>
'codestat'
,
'path'
=>
'/[:lang/]codestat/:provider'
,
'middleware'
=>
App\Action\User\Codestat
::
class
,
'allowed_methods'
=>
[
'POST'
,
'GET'
],
'options'
=>
[
'constraints'
=>
[
'lang'
=>
'[a-z]{2,3}'
,
'provider'
=>
'\w+'
,
],
'defaults'
=>
[
'lang'
=>
\App\Model\Locales
::
DEFAULT_LANG
,
]
],
],
[
'name'
=>
'user.cabinet.profile'
,
'path'
=>
'/[:lang/]cabinet/profile/'
,
...
...
@@ -376,54 +334,7 @@ return [
]
],
],
[
'name'
=>
'common.blog'
,
'path'
=>
'/[:lang/]blog/list/[:tag]'
,
'middleware'
=>
App\Action\Blog
::
class
,
'allowed_methods'
=>
[
'GET'
],
'options'
=>
[
'constraints'
=>
[
'lang'
=>
'[a-z]{2,3}'
,
],
'defaults'
=>
[
'lang'
=>
\App\Model\Locales
::
DEFAULT_LANG
,
'action'
=>
\App\Action\Blog
::
ACTION_LIST
,
'tag'
=>
''
,
]
],
],
[
'name'
=>
'common.blog.article'
,
'path'
=>
'/[:lang/]blog/:article'
,
'middleware'
=>
App\Action\Blog
::
class
,
'allowed_methods'
=>
[
'POST'
,
'GET'
],
'options'
=>
[
'constraints'
=>
[
'lang'
=>
'[a-z]{2,3}'
,
'article'
=>
'\d+'
,
],
'defaults'
=>
[
'lang'
=>
\App\Model\Locales
::
DEFAULT_LANG
,
'action'
=>
\App\Action\Blog
::
ACTION_ARTICLE
,
]
],
],
[
'name'
=>
'common.blog.json'
,
'path'
=>
'/[:lang/]blog/list/:format/[:tag]'
,
'middleware'
=>
App\Action\Blog
::
class
,
'allowed_methods'
=>
[
'POST'
],
'options'
=>
[
'constraints'
=>
[
'lang'
=>
'[a-z]{2,3}'
,
],
'defaults'
=>
[
'lang'
=>
\App\Model\Locales
::
DEFAULT_LANG
,
'action'
=>
\App\Action\Blog
::
ACTION_LIST
,
'format'
=>
\App\Action\Blog
::
FORMAT_JSON
,
]
],
],
[
'name'
=>
'download.counter'
,
'path'
=>
'/[:lang/]download-counter/[:siteId]'
,
...
...
@@ -468,36 +379,5 @@ return [
]
],
],
[
'name'
=>
'site.add'
,
'path'
=>
'/[:lang/]site-add/'
,
'middleware'
=>
App\Action\Site
::
class
,
'allowed_methods'
=>
[
'GET'
,
'POST'
],
'options'
=>
[
'constraints'
=>
[
'lang'
=>
'[a-z]{2,3}'
,
],
'defaults'
=>
[
'lang'
=>
\App\Model\Locales
::
DEFAULT_LANG
,
'method'
=>
App\Action\Site
::
ADD
,
]
],
],
[
'name'
=>
'site.remove'
,
'path'
=>
'/[:lang/]site-remove/:id'
,
'middleware'
=>
App\Action\Site
::
class
,
'allowed_methods'
=>
[
'GET'
,
'POST'
],
'options'
=>
[
'constraints'
=>
[
'lang'
=>
'[a-z]{2,3}'
,
// 'id' => '\d+',
],
'defaults'
=>
[
'lang'
=>
\App\Model\Locales
::
DEFAULT_LANG
,
'method'
=>
App\Action\Site
::
REMOVE
,
]
],
],
],
];
src/public/js/script-codestat.js
deleted
100644 → 0
View file @
9b2d5f7d
This diff is collapsed.
Click to expand it.
src/src/App/Action/Blog.php
deleted
100644 → 0
View file @
9b2d5f7d
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
namespace
App\Action
;
use
App\Model\Articles
;
use
App\Model\Tags
;
use
Psr\Http\Message\ResponseInterface
;
use
Psr\Http\Message\ServerRequestInterface
;
use
Zend\Diactoros\Response\HtmlResponse
;
use
Zend\Diactoros\Response\JsonResponse
;
use
Zend\Http\Response
;
/**
* Class Blog
* @package App\Action
*/
class
Blog
extends
Common
{
const
ACTION_LIST
=
'blog article list'
;
const
ACTION_ARTICLE
=
'blog article'
;
const
FORMAT_JSON
=
'json'
;
/**
* @param ServerRequestInterface $request
* @param ResponseInterface $response
* @param callable|null $next
* @return ResponseInterface|HtmlResponse
* @throws \Exception
*/
function
__invoke
(
ServerRequestInterface
$request
,
ResponseInterface
$response
,
callable
$next
=
null
)
{
$this
->
initInfo
(
$request
);
switch
(
$request
->
getAttribute
(
'action'
))
{
case
self
::
ACTION_ARTICLE
:
$articleId
=
$request
->
getAttribute
(
'article'
);
if
(
$articleId
)
{
/** @var Articles $articlesModel */
$articlesModel
=
$this
->
container
->
get
(
Articles
::
class
);
$article
=
$articlesModel
->
findById
(
$articleId
);
if
(
$article
)
{
$response
=
new
HtmlResponse
(
$this
->
template
->
render
(
"app::blog-article"
,
[
'lang'
=>
$request
->
getAttribute
(
'layoutInfo'
)
->
getLang
(),
'article'
=>
$article
,
]));
}
else
{
$response
->
withStatus
(
Response
::
STATUS_CODE_404
);
}
}
else
{
$response
->
withStatus
(
Response
::
STATUS_CODE_404
);
}
break
;
case
self
::
ACTION_LIST
:
$page
=
$request
->
getParsedBody
()[
'page'
]
??
1
;
$tag
=
$request
->
getAttribute
(
'tag'
,
''
);
$perPage
=
$this
->
container
->
get
(
'config'
)[
'blog'
][
'articlesPerPage'
];
/** @var Articles $articlesModel */
$articlesModel
=
$this
->
container
->
get
(
Articles
::
class
);
/** @var Tags $tagsModel */
$tagsModel
=
$this
->
container
->
get
(
Tags
::
class
);
$data
=
$tag
?
$articlesModel
->
findLimitWithTag
([
Articles
::
PLACEHOLDER_LIMIT
=>
$perPage
,
Articles
::
PLACEHOLDER_OFFSET
=>
(
$page
-
1
)
*
$perPage
,
],
$tag
)
:
$articlesModel
->
findLimit
([
Articles
::
PLACEHOLDER_LIMIT
=>
$perPage
,
Articles
::
PLACEHOLDER_OFFSET
=>
(
$page
-
1
)
*
$perPage
,
]);
$totalArticles
=
$articlesModel
->
foundRows
();
$pageNumbers
=
ceil
(
$totalArticles
/
$perPage
);
$tags
=
$tagsModel
->
findAll
();
if
(
$request
->
getAttribute
(
'format'
)
==
self
::
FORMAT_JSON
)
{
$response
=
new
JsonResponse
([
'data'
=>
$data
,
'lang'
=>
$request
->
getAttribute
(
'layoutInfo'
)
->
getLang
(),
'pageNumbers'
=>
$pageNumbers
,
'currentPage'
=>
$page
,
'tag'
=>
$tag
,
'tags'
=>
$tags
,
]);
}
else
{
$response
=
new
HtmlResponse
(
$this
->
template
->
render
(
"app::blog-list"
,
[
'lang'
=>
$request
->
getAttribute
(
'layoutInfo'
)
->
getLang
(),
'pageNumbers'
=>
$pageNumbers
,
'currentPage'
=>
$page
,
'tag'
=>
$tag
,
'tags'
=>
$tags
,
]));
}
break
;
default
:
throw
new
\Exception
(
'Unknown blog action'
);
break
;
}
return
$response
;
}
}
\ No newline at end of file
src/src/App/Action/Examples.php
deleted
100644 → 0
View file @
9b2d5f7d
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
namespace
App\Action
;
use
Psr\Http\Message\ResponseInterface
;
use
Psr\Http\Message\ServerRequestInterface
;
use
Zend\Diactoros\Response\HtmlResponse
;
class
Examples
extends
Common
{
/**
* @param ServerRequestInterface $request
* @param ResponseInterface $response
* @param callable|null $next
* @return HtmlResponse
*/
function
__invoke
(
ServerRequestInterface
$request
,
ResponseInterface
$response
,
callable
$next
=
null
)
{
return
new
HtmlResponse
(
$this
->
template
->
render
(
'app::examples'
,
[]));
}
}
\ No newline at end of file
src/src/App/Action/Site.php
deleted
100644 → 0
View file @
9b2d5f7d
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
namespace
App\Action
;
use
App\Authentication\UserService
;
use
App\Model\Sites
;
use
Psr\Http\Message\ResponseInterface
;
use
Psr\Http\Message\ServerRequestInterface
;
use
Zend\Diactoros\Response\JsonResponse
;
use
Zend\Hydrator\DelegatingHydrator
;
use
Zend\Validator\Uri
;
/**
* Class Site
* @package App\Action
*/
class
Site
extends
Common
{
const
ADD
=
'add-site'
;
const
REMOVE
=
'remove-site'
;
/**
* @param ServerRequestInterface $request
* @param ResponseInterface $response
* @param callable|null $next
* @return JsonResponse
* @throws \Exception
*/
function
__invoke
(
ServerRequestInterface
$request
,
ResponseInterface
$response
,
callable
$next
=
null
)
{
$this
->
initInfo
(
$request
);
$method
=
$request
->
getAttribute
(
'method'
);
//@todo add validation
/** @var Sites $sites */
$sites
=
$this
->
container
->
get
(
Sites
::
class
);
/** @var UserService $auth */
$auth
=
$this
->
container
->
get
(
UserService
::
class
);
/** @var DelegatingHydrator $hydrator */
$hydrator
=
$this
->
container
->
get
(
DelegatingHydrator
::
class
);
$result
=
false
;
$msg
[
'text'
]
=
'Unknown error'
;
$redirect
=
false
;
switch
(
$method
)
{
case
self
::
ADD
:
$domain
=
$request
->
getParsedBody
()[
'site'
];
$site
=
$sites
->
findOne
([
'domain'
=>
$domain
]);
if
(
$site
)
{
$result
=
false
;
$msg
=
'Domain \''
.
$domain
.
'\' already registered'
;
}
else
{
$validator
=
new
Uri
();
if
(
$validator
->
isValid
(
$domain
))
{
$site
=
$hydrator
->
hydrate
([
'users_id'
=>
$auth
->
getIdentity
()
->
getId
(),
'domain'
=>
$domain
],
new
\App\Entity\Site
());
/** @noinspection PhpParamsInspection */
$result
=
(
bool
)
$sites
->
save
(
$site
);
if
(
$result
)
{
$msg
[
'text'
]
=
'Success'
;
$site
=
$sites
->
findOne
([
'domain'
=>
$domain
]);
if
(
!
$site
)
{
$site
=
new
\App\Entity\Site
();
}
$redirect
=
$this
->
router
->
generateUri
(
'install.counter'
,
[
'siteId'
=>
$site
->
getId
()]);
}
else
{
$msg
[
'text'
]
=
'DB error'
;
}
}
else
{
throw
new
\Exception
(
implode
(
PHP_EOL
,
$validator
->
getMessages
()));
}
}
break
;
case
self
::
REMOVE
:
$id
=
$request
->
getAttribute
(
'id'
);
$result
=
(
bool
)
$sites
->
delete
(
$id
,
$auth
->
getIdentity
()
->
getId
());
if
(
!
$result
)
{
$msg
[
'text'
]
=
'not deleted'
;
}
break
;
default
:
$result
=
false
;
break
;
}
$data
=
[
'result'
=>
$result
,
'msg'
=>
$msg
,
'redirect'
=>
$redirect
];
return
new
JsonResponse
(
$data
);
}
}
\ No newline at end of file
src/src/App/Action/Statistics.php
deleted
100644 → 0
View file @
9b2d5f7d
This diff is collapsed.
Click to expand it.
src/src/App/Action/User/Cabinet.php
View file @
55f619f4
...
...
@@ -118,13 +118,22 @@ class Cabinet extends Common
$periodStats
=
$transactionsModel
->
getStatsByDate
(
$feed_id_list
,
$dates
);
$companyStats
=
$transactionsModel
->
getStatsByFeeds
(
$feed_id_list
,
$dates
);
$cats
=
[
'localmoney'
,
'usdollarmoney'
];
//return new JsonResponse($periodStats);
break
;
default
:
$data
[
'error'
]
=
_t
(
'Извините, тип отчета "'
.
$report_type
.
'" недоступен'
);
break
;
}
if
(
$companyStats
||
count
(
$companyStats
[
'period'
])
>
0
)
{
$feeds_names
=
[];
foreach
(
$companyStats
[
'period'
]
as
$feed_id
)
{
$feed
=
$feedsModel
->
findById
(
$feed_id
);
$feeds_names
[]
=
$feed
->
getTitle
();
}
$companyStats
[
'period'
]
=
$feeds_names
;
}
//return new JsonResponse($companyStats);
$periodStats
[
'type'
]
=
'interval'
;
$periodStats
[
'report'
]
=
$report_type
;
...
...
src/src/App/Action/User/Codestat.php
deleted
100644 → 0
View file @
9b2d5f7d
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
namespace
App\Action\User
;
use
App\Action\Common
;
use
App\Authentication\UserService
;
use
App\Model\Users
;
use
App\Model\Sites
;
use
App\Model\Statistics
;
use
App\Model\Providers
;
use
App\Model\Codes
;
use
Psr\Http\Message\ResponseInterface
;
use
Psr\Http\Message\ServerRequestInterface
;
use
Zend\Diactoros\Response\HtmlResponse
;
/**
* Class Codestat
* @package App\Action\User
*/
class
Codestat
extends
Common
{
/**
* @param ServerRequestInterface $request
* @param ResponseInterface $response
* @param callable|null $next
* @return HtmlResponse
*/
function
__invoke
(
ServerRequestInterface
$request
,
ResponseInterface
$response
,
callable
$next
=
null
)
{
$provider_name
=
$request
->
getAttribute
(
'provider'
);
try
{
/** @var Sites $sitesModel */
$sitesModel
=
$this
->
container
->
get
(
Sites
::
class
);
/** @var UserService $authUser */
$authUser
=
$this
->
container
->
get
(
UserService
::
class
);
$userAuth
=
$authUser
->
getIdentity
();
/** @var Statistics $stats */
$stats
=
$this
->
container
->
get
(
Statistics
::
class
);
/** @var Users $usersModel */
$usersModel
=
$this
->
container
->
get
(
Users
::
class
);
/** @var \App\Model\Providers $providerModel */
$providerModel
=
$this
->
container
->
get
(
Providers
::
class
);
$provider
=
$providerModel
->
findOne
([
'name'
=>
$provider_name
]);
// Проверяем наличие провайдера в системе:
if
(
$provider
)
{
$provider_id
=
$provider
->
getId
();
if
(
$userAuth
)
{
$data
[
'adminStats'
]
=
false
;
$user_id
=
$userAuth
->
getId
();
$user
=
$usersModel
->
findById
(
$user_id
);
$userCodeProviderId
=
json_decode
(
$user
->
getCodeProvider
(),
true
);
// Проверяем наличие у данного юзера кода провайдера:
if
(
!
in_array
(
$provider_id
,
$userCodeProviderId
))
{
$data
[
'error'
]
=
_t
(
'У вас нет доступа к этой странице'
);
}
}
else
{
$data
[
'adminStats'
]
=
true
;
$this
->
container
->
get
(
'layout'
)
->
setTemplate
(
'layout/support'
);
}
}
else
{
if
(
$userAuth
)
{
$data
[
'error'
]
=
_t
(
'У вас нет доступа к этой странице'
);
}
else
{
$data
[
'error'
]
=
_t
(
'Извините, провайдера: '
.
$provider_name
.
' нет в системе'
);
}
}
if
(
!
$data
[
'error'
])
{
/** @var \App\Model\Codes $codeModel */
$codeModel
=
$this
->
container
->
get
(
Codes
::
class
);
$codes
=
$codeModel
->
findAll
([
'provider'
=>
$provider_id
])
->
toArray
();
if
(
$codes
)
{
$sites_id
=
[];
foreach
(
$codes
as
$code
)
{
$code_site_id
=
(
int
)
$code
[
'site_id'
];
if
(
!
in_array
(
$code_site_id
,
$sites_id
)
&&
$code_site_id
<
59990
)
{
$sites_id
[]
=
$code_site_id
;
}
}
if
(
count
(
$sites_id
))
{
$listSites
=
$sitesModel
->
findAll
([
'id'
=>
$sites_id
])
->
buffer
();
$listDomains
=
[];
foreach
(
$listSites
as
$site
)
{
$listDomains
[
$site
->
getId
()]
=
$site
->
getDomain
();
}
$listSites
->
rewind
();
asort
(
$listDomains
);
/** @var \App\Model\Currencies $currencyModel */
$currencyModel
=
$this
->
container
->
get
(
\App\Model\Currencies
::
class
);
$currentCurencyCode
=
'USD'
;
$currencies
=
array
();
foreach
(
$currencyModel
->
findAll
()
as
$currency
)
{
$currencies
[
$currency
->
getCode
()]
=
$currency
->
getName
();
}
$summaryReport
=
$stats
->
getCodestatGlobalReport
(
$sites_id
,
[
$provider_name
]);
list
(
$periodStats
,
$periodDates
)
=
$stats
->
getCodestatReport
(
date
(
'Y-m'
),
$sites_id
,
[
$provider_name
]);
$dateIterval
=
new
\DateInterval
(
'P1M'
);
$dateStart
=
\DateTime
::
createFromFormat
(
'Y-m-d'
,
$periodDates
[
'min'
]
?:
date
(
'Y-m-01'
));
$dateEnd
=
\DateTime
::
createFromFormat
(
'Y-m-d'
,
$periodDates
[
'max'
]
?:
date
(
'Y-m-01'
));
$dateRange
=
[];
if
(
$dateStart
!=
$dateEnd
)
{
$_dateRange
=
new
\DatePeriod
(
$dateStart
,
$dateIterval
,
$dateEnd
);
foreach
(
$_dateRange
as
$dt
)
{
$dateRange
[]
=
$dt
;
}
}
$dateRange
[]
=
$dateEnd
;
$dateRange
=
array_reverse
(
$dateRange
);
//$data['sites'] = $listSites;
$data
[
'listDomains'
]
=
$listDomains
;
$data
[
'summaryReport'
]
=
$summaryReport
;
$data
[
'periodStats'
]
=
$periodStats
;
$data
[
'dateRange'
]
=
$dateRange
;
$data
[
'codeProvider'
]
=
$provider_name
;
}
else
{
if
(
$userAuth
)
{
$data
[
'error'
]
=
_t
(
'У вас нет доступа к этой странице'
);
}
else
{
$data
[
'error'
]
=
_t
(
'Извините, отсутствуют сайты с кодом данного провайдера'
);
}
}
}
}
}
catch
(
\Exception
$e
)
{
$data
[
'error'
]
=
_t
(
'Извините, статистика недоступна'
);
}
$data
=
array_merge
(
$data
,
[
'lang'
=>
$request
->
getAttribute
(
'layoutInfo'
)
->
getLang
(),
'layoutInfo'
=>
$request
->
getAttribute
(
'layoutInfo'
),
]);
return
new
HtmlResponse
(
$this
->
template
->
render
(
'app::codestat'
,
$data
));
}
}
\ No newline at end of file
src/src/App/Entity/ApplyVacancy.php
deleted
100644 → 0
View file @
9b2d5f7d
<?php
/**
* Copyright (c) 2017 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
namespace
App\Entity
;
/**
* Class ApplyVacancy
* used on form of applying vacancies
*
* @package App\Entity
*/
class
ApplyVacancy
{
protected
$name
;
protected
$mail
;
protected
$phone
;
/**
* @return mixed
*/
public
function
getName
()
{
return
$this
->
name
;
}
/**
* @param mixed $name
* @return ApplyVacancy
*/
public
function
setName
(
$name
)
{
$this
->
name
=
$name
;
return
$this
;
}
/**
* @return mixed
*/
public
function
getMail
()
{
return
$this
->
mail
;
}
/**
* @param mixed $mail
* @return ApplyVacancy
*/
public
function
setMail
(
$mail
)
{
$this
->
mail
=
$mail
;
return
$this
;
}
/**
* @return mixed
*/
public
function
getPhone
()
{
return
$this
->
phone
;
}
/**
* @param mixed $phone
* @return ApplyVacancy
*/
public
function
setPhone
(
$phone
)
{
$this
->
phone
=
$phone
;
return
$this
;
}
}
\ No newline at end of file
src/src/App/Entity/Article.php
deleted
100644 → 0
View file @
9b2d5f7d
<?php
/**
* Copyright (c) 2017 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
namespace
App\Entity
;
use
App\Model\HideableInterface
;
/**
* Class Article
* @package App\Entity
*/
class
Article
extends
Common
implements
HideableInterface
{
protected
$title
;
protected
$desc
;
protected
$content
;
protected
$date_create
;
protected
$date_update
;
protected
$hidden
=
0
;
protected
$title_img_url
;
/**
* @var Tag[]
*/
protected
$tags
=
[];
/**
* @return mixed
*/
public
function
getTitle
()
{
return
$this
->
title
;
}
/**
* @param mixed $title
* @return Article
*/
public
function
setTitle
(
$title
)
{
$this
->
title
=
$title
;
return
$this
;
}
/**
* @return mixed
*/
public
function
getDesc
()
{
return
$this
->
desc
;
}
/**
* @param mixed $desc
* @return Article
*/
public
function
setDesc
(
$desc
)
{
$this
->
desc
=
$desc
;
return
$this
;
}
/**
* @return mixed
*/
public
function
getContent
()
{
return
$this
->
content
;
}
/**
* @param mixed $content
* @return Article
*/
public
function
setContent
(
$content
)
{
$this
->
content
=
$content
;
return
$this
;
}
/**
* @return mixed
*/
public
function
getDateCreate
()
{
return
$this
->
date_create
;
}
/**
* @param mixed $date_create
* @return Article
*/
public
function
setDateCreate
(
$date_create
)
{
$this
->
date_create
=
$date_create
;
return
$this
;
}
/**
* @return mixed
*/
public
function
getDateUpdate
()
{
return
$this
->
date_update
;
}
/**
* @param mixed $date_update
* @return Article
*/
public
function
setDateUpdate
(
$date_update
)
{
$this
->
date_update
=
$date_update
;
return
$this
;
}
/**
* @return int
*/
public
function
getHidden
()
:
int
{
return
$this
->
hidden
;
}
/**
* @param int $hidden
* @return Article
*/
public
function
setHidden
(
int
$hidden
)
:
Article
{
$this
->
hidden
=
$hidden
;
return
$this
;
}
/**
* @return mixed
*/
public
function
getTitleImgUrl
()
{
return
$this
->
title_img_url
;
}
/**
* @param mixed $title_img_url
* @return Article
*/
public
function
setTitleImgUrl
(
$title_img_url
)
{
$this
->
title_img_url
=
$title_img_url
;
return
$this
;
}
/**
* @return Tag[]
*/
public
function
getTags
()
{
return
$this
->
tags
;
}
/**
* @param Tag[] $tags
* @return Article
*/
public
function
setTags
(
$tags
)
:
Article
{
$this
->
tags
=
$tags
;
return
$this
;
}
}
\ No newline at end of file
src/src/App/Entity/Provider.php
deleted
100644 → 0
View file @
9b2d5f7d
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
namespace
App\Entity
;
/**
* Class Provider
* @package App\Entity
*/
class
Provider
extends
Common
{
/**
* @return string
*/
public
function
getName
()
{
return
$this
->
name
;
}
/**
* @param string $name
* @return Provider
*/
public
function
setName
(
$name
)
{
$this
->
name
=
$name
;
return
$this
;
}
}
\ No newline at end of file
src/src/App/Entity/ProviderDomain.php
deleted
100644 → 0
View file @
9b2d5f7d
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
namespace
App\Entity
;
/**
* Class Provider
* @package App\Entity
*/
class
ProviderDomain
extends
Common
{
/**
* @var string
*/
/**
* @return string
*/
public
function
getName
()
{
return
$this
->
name
;
}
/**
* @param string $name
* @return ProviderDomain
*/
public
function
setName
(
$name
)
{
$this
->
name
=
$name
;
return
$this
;
}
}
\ No newline at end of file
src/src/App/Entity/Site.php
deleted
100644 → 0
View file @
9b2d5f7d
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
namespace
App\Entity
;
/**
* Class Site
* @package App\Entity
*/
class
Site
extends
Common
{
/**
* @var string
*/
protected
$domain
;
protected
$usersId
;
protected
$alias
;
protected
$category
;
/**
* @return string
*/
public
function
getDomain
()
{
return
$this
->
domain
;
}
/**
* @param string $domain
* @return Site
*/
public
function
setDomain
(
$domain
)
{
$this
->
domain
=
$domain
;
return
$this
;
}
/**
* @return int
*/
public
function
getUsersId
()
{
return
$this
->
usersId
;
}
/**
* @param int $usersId
* @return Site
*/
public
function
setUsersId
(
$usersId
)
{
$this
->
usersId
=
$usersId
;
return
$this
;
}
/**
* @return string
*/
public
function
getAlias
()
{
return
$this
->
alias
;
}
/**
* @param string $alias
* @return Site
*/
public
function
setAlias
(
$alias
)
{
$this
->
alias
=
$alias
;
return
$this
;
}
/**
* @return string
*/
public
function
getCategory
()
{
return
$this
->
category
;
}
/**
* @param string $category
* @return Site
*/
public
function
setCategory
(
$category
)
{
$this
->
category
=
$category
;
return
$this
;
}
/**
* Set dateCreate
*
* @param string $dateCreate
*
* @return User
*/
public
function
setDateCreate
(
$dateCreate
)
{
$this
->
dateCreate
=
$dateCreate
;
return
$this
;
}
/**
* Get dateCreate
*
* @return string
*/
public
function
getDateCreate
()
{
return
$this
->
dateCreate
??
(
new
\DateTimeImmutable
())
->
format
(
'Y-m-d'
);
}
/**
*
* @return int
*/
public
function
getTraffic
()
:
int
{
return
(
int
)
$this
->
traffic
;
}
/**
*
* @param int $traffic
* @return $this
*/
public
function
setTraffic
(
$traffic
)
{
$this
->
traffic
=
$traffic
;
return
$this
;
}
/**
* @param bool $onlyNative
* @return Site
*/
public
function
setOnlyNative
(
$onlyNative
)
{
$this
->
onlyNative
=
$onlyNative
;
return
$this
;
}
/**
* @return bool
*/
public
function
getOnlyNative
()
{
return
$this
->
onlyNative
;
}
/**
* @param bool $forcedStart
* @return Site
*/
public
function
setForcedStart
(
$forcedStart
)
{
$this
->
forcedStart
=
$forcedStart
;
return
$this
;
}
/**
* @return bool
*/
public
function
getForcedStart
()
{
return
$this
->
forcedStart
;
}
/**
* @param bool $payBlock
* @return Site
*/
public
function
setPayBlock
(
$payBlock
)
{
$this
->
payBlock
=
$payBlock
;
return
$this
;
}
/**
* @return bool
*/
public
function
getPayBlock
()
{
return
$this
->
payBlock
;
}
/**
* @param bool $onlyGoods
* @return Site
*/
public
function
setOnlyGoods
(
$onlyGoods
)
{
$this
->
onlyGoods
=
$onlyGoods
;
return
$this
;
}
/**
* @return bool
*/
public
function
getOnlyGoods
()
{
return
$this
->
onlyGoods
;
}
/**
* @return string
*/
public
function
getHidezones
()
{
return
$this
->
hidezones
;
}
/**
* @param string $hidezones
* @return Site
*/
public
function
setHidezones
(
$hidezones
)
{
$this
->
hidezones
=
$hidezones
;
return
$this
;
}
/**
* @return string
*/
public
function
getStophide
()
{
return
$this
->
stophide
;
}
/**
* @param string $stophide
* @return Site
*/
public
function
setStophide
(
$stophide
)
{
$this
->
stophide
=
$stophide
;
return
$this
;
}
/**
* @return string
*/
public
function
getProvidersId
()
{
return
$this
->
providersId
;
}
/**
* @param string $providersId
* @return Site
*/
public
function
setProvidersId
(
$providersId
)
{
$this
->
providersId
=
$providersId
;
return
$this
;
}
/**
* @return string
*/
public
function
getCodezones
()
{
return
$this
->
codezones
;
}
/**
* @param string $codezones
* @return Site
*/
public
function
setCodezones
(
$codezones
)
{
$this
->
codezones
=
$codezones
;
return
$this
;
}
/**
* @return string
*/
public
function
getTempState
()
{
return
$this
->
tempState
;
}
/**
* @param string $tempState
* @return Site
*/
public
function
setTempState
(
$tempState
)
{
$this
->
tempState
=
$tempState
;
return
$this
;
}
/**
* @return int
*/
public
function
getEnabled
()
{
return
$this
->
enabled
;
}
/**
* @param int $is_enable
* @return Zone
*/
public
function
setEnabled
(
$is_enable
)
{
$this
->
enabled
=
$is_enable
;
return
$this
;
}
/**
* @return string
*/
public
function
getServerData
()
{
return
$this
->
serverData
;
}
/**
* @param string $serverData
* @return Site
*/
public
function
setServerData
(
$serverData
)
{
$this
->
serverData
=
$serverData
;
return
$this
;
}
}
\ No newline at end of file
src/src/App/Entity/Slot.php
deleted
100644 → 0
View file @
9b2d5f7d
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
namespace
App\Entity
;
/**
* Class Slot
* @package App\Entity
*/
class
Slot
extends
Common
{
/**
* @return string
*/
public
function
getSiteId
()
{
return
$this
->
siteId
;
}
/**
* @param string $siteId
* @return Slot
*/
public
function
setSiteId
(
$siteId
)
{
$this
->
siteId
=
$siteId
;
return
$this
;
}
/**
* @return int
*/
public
function
getDisabled
()
{
return
$this
->
disabled
;
}
/**
* @param int $is_disabled
* @return Slot
*/
public
function
setDisabled
(
$is_disabled
)
{
$this
->
disabled
=
$is_disabled
;
return
$this
;
}
/**
* @return string
*/
public
function
getName
()
{
return
$this
->
name
;
}
/**
* @param string $name
* @return Slot
*/
public
function
setName
(
$name
)
{
$this
->
name
=
$name
;
return
$this
;
}
/**
* @return string
*/
public
function
getNode
()
{
return
$this
->
node
;
}
/**
* @param string $node
* @return Slot
*/
public
function
setNode
(
$node
)
{
$this
->
node
=
$node
;
return
$this
;
}
/**
* @return string
*/
public
function
getOffset
()
{
return
$this
->
offset
;
}
/**
* @param string $offset
* @return Slot
*/
public
function
setOffset
(
$offset
)
{
$this
->
offset
=
$offset
;
return
$this
;
}
/**
* @return string
*/
public
function
getMargin
()
{
return
$this
->
margin
;
}
/**
* @param string $margin
* @return Slot
*/
public
function
setMargin
(
$margin
)
{
$this
->
margin
=
$margin
;
return
$this
;
}
/**
* @return int
*/
public
function
getSyncheight
()
{
return
$this
->
syncheight
;
}
/**
* @param int $is_syncheight
* @return Slot
*/
public
function
setSyncheight
(
$is_syncheight
)
{
$this
->
syncheight
=
$is_syncheight
;
return
$this
;
}
/**
* @return int
*/
public
function
getClearbefore
()
{
return
$this
->
clearbefore
;
}
/**
* @param int $is_clearbefore
* @return Slot
*/
public
function
setClearbefore
(
$is_clearbefore
)
{
$this
->
clearbefore
=
$is_clearbefore
;
return
$this
;
}
/**
* @return string
*/
public
function
getHalign
()
{
return
$this
->
halign
;
}
/**
* @param string $halign
* @return Slot
*/
public
function
setHalign
(
$halign
)
{
$this
->
halign
=
$halign
;
return
$this
;
}
/**
* @return string
*/
public
function
getStyles
()
{
return
$this
->
styles
;
}
/**
* @param string $styles
* @return Slot
*/
public
function
setStyles
(
$styles
)
{
$this
->
styles
=
$styles
;
return
$this
;
}
/**
* @return string
*/
public
function
getAddstyles
()
{
return
$this
->
addstyles
;
}
/**
* @param string $addstyles
* @return Slot
*/
public
function
setAddstyles
(
$addstyles
)
{
$this
->
addstyles
=
$addstyles
;
return
$this
;
}
/**
* @return string
*/
public
function
getZones
()
{
return
$this
->
zones
;
}
/**
* @param string $zones
* @return Slot
*/
public
function
setZones
(
$zones
)
{
$this
->
zones
=
$zones
;
return
$this
;
}
/**
* @return string
*/
public
function
getFixed
()
{
return
$this
->
fixed
;
}
/**
* @param string $fixed
* @return Slot
*/
public
function
setFixed
(
$fixed
)
{
$this
->
fixed
=
$fixed
;
return
$this
;
}
/**
* @return string
*/
public
function
getComment
()
{
return
$this
->
comment
;
}
/**
* @param string $comment
* @return Slot
*/
public
function
setComment
(
$comment
)
{
$this
->
comment
=
$comment
;
return
$this
;
}
}
\ No newline at end of file
src/src/App/Entity/Statistic/Blockers.php
deleted
100644 → 0
View file @
9b2d5f7d
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
namespace
App\Entity\Statistic
;
class
Blockers
{
const
PROP_FIRST
=
0
;
const
PROP_SECOND
=
1
;
const
PROP_THIRD
=
2
;
const
PROP_FORTH
=
3
;
/**
* @var Data
*/
protected
$first
;
/**
* @var Data
*/
protected
$second
;
/**
* @var Data
*/
protected
$third
;
/**
* @var Data
*/
protected
$forth
;
/**
* @return Data
*/
public
function
getFirst
()
:
Data
{
return
$this
->
first
;
}
/**
* @param Data $first
* @return Blockers
*/
public
function
setFirst
(
Data
$first
)
:
Blockers
{
$this
->
first
=
$first
;
return
$this
;
}
/**
* @return Data
*/
public
function
getSecond
()
:
Data
{
return
$this
->
second
;
}
/**
* @param Data $second
* @return Blockers
*/
public
function
setSecond
(
Data
$second
)
:
Blockers
{
$this
->
second
=
$second
;
return
$this
;
}
/**
* @return Data
*/
public
function
getThird
()
:
Data
{
return
$this
->
third
;
}
/**
* @param Data $third
* @return Blockers
*/
public
function
setThird
(
Data
$third
)
:
Blockers
{
$this
->
third
=
$third
;
return
$this
;
}
/**
* @return Data
*/
public
function
getForth
()
:
Data
{
return
$this
->
forth
;
}
/**
* @param Data $forth
* @return Blockers
*/
public
function
setForth
(
Data
$forth
)
:
Blockers
{
$this
->
forth
=
$forth
;
return
$this
;
}
}
\ No newline at end of file
src/src/App/Entity/Statistic/Data.php
deleted
100644 → 0
View file @
9b2d5f7d
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
namespace
App\Entity\Statistic
;
/**
* Class Data
* @package App\Entity\Statistic
*/
class
Data
{
const
PROP_VALUE
=
0
;
const
PROP_PERCENT
=
1
;
const
PROP_TITLE
=
2
;
protected
$value
;
protected
$percent
;
protected
$title
;
/**
* @return mixed
*/
public
function
getValue
()
{
return
$this
->
value
;
}
/**
* @param mixed $value
* @return Data
*/
public
function
setValue
(
$value
)
{
$this
->
value
=
$value
;
return
$this
;
}
/**
* @return mixed
*/
public
function
getPercent
()
{
return
$this
->
percent
;
}
/**
* @param mixed $percent
* @return Data
*/
public
function
setPercent
(
$percent
)
{
$this
->
percent
=
$percent
;
return
$this
;
}
/**
* @return mixed
*/
public
function
getTitle
()
{
return
$this
->
title
;
}
/**
* @param mixed $title
* @return Data
*/
public
function
setTitle
(
$title
)
{
$this
->
title
=
$title
;
return
$this
;
}
}
\ No newline at end of file
src/src/App/Entity/Statistic/Site.php
deleted
100644 → 0
View file @
9b2d5f7d
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
namespace
App\Entity\Statistic
;
/**
* Class Site
*
* @package App\Entity\Statistic
*/
class
Site
{
const
PROP_USERS_WITH_ADBLOCKER
=
0
;
const
PROP_USERS_WITHOUT_ADBLOCKER
=
1
;
const
PROP_LOSS_TOTAL
=
2
;
const
PROP_LOSS_DAY
=
3
;
const
PROP_LOSS_WEEK
=
4
;
const
PROP_LOSS_PER1000VIEWS
=
5
;
const
PROP_RECOVERED
=
6
;
const
PATTERN_USERS_WITH_ADBLOCKER
=
'%s пользователей блокируют рекламу'
;
const
PATTERN_USERS_WITHOUT_ADBLOCKER
=
'%s пользователей не устанавливали блокировщик'
;
const
TITLE_LOSS_TOTAL
=
'Всего потери'
;
const
TITLE_LOSS_DAY
=
'За день'
;
const
TITLE_LOSS_WEEK
=
'За неделю'
;
const
TITLE_LOSS_PER1000VIEWS
=
'За 1000 показов'
;
const
TITLE_RECOVERED
=
'Восстановлено'
;
/**
* @var Data
*/
protected
$usersWithAdBlocker
;
/**
* @var Data
*/
protected
$usersWithoutAdBlocker
;
/**
* @var Data
*/
protected
$lossTotal
;
/**
* @var Data
*/
protected
$lossDay
;
/**
* @var Data
*/
protected
$lossWeek
;
/**
* @var Data
*/
protected
$lossPer1000views
;
/**
* @var Data
*/
protected
$recovered
;
/**
*
* @var int
*/
protected
$sitesCount
;
/**
* @return Data
*/
public
function
getUsersWithAdBlocker
()
:
Data
{
if
(
is_null
(
$this
->
usersWithAdBlocker
))
{
$this
->
usersWithAdBlocker
=
new
Data
();
}
return
$this
->
usersWithAdBlocker
;
}
/**
* @param Data $usersWithAdBlocker
* @return Site
*/
public
function
setUsersWithAdBlocker
(
Data
$usersWithAdBlocker
)
:
Site
{
$this
->
usersWithAdBlocker
=
$usersWithAdBlocker
;
return
$this
;
}
/**
* @return Data
*/
public
function
getUsersWithoutAdBlocker
()
:
Data
{
if
(
is_null
(
$this
->
usersWithoutAdBlocker
))
{
$this
->
usersWithoutAdBlocker
=
new
Data
();
}
return
$this
->
usersWithoutAdBlocker
;
}
/**
* @param Data $usersWithoutAdBlocker
* @return Site
*/
public
function
setUsersWithoutAdBlocker
(
Data
$usersWithoutAdBlocker
)
:
Site
{
$this
->
usersWithoutAdBlocker
=
$usersWithoutAdBlocker
;
return
$this
;
}
/**
* @return Data
*/
public
function
getLossTotal
()
:
Data
{
if
(
is_null
(
$this
->
lossTotal
))
{
$this
->
lossTotal
=
new
Data
();
}
return
$this
->
lossTotal
;
}
/**
* @param Data $lossTotal
* @return Site
*/
public
function
setLossTotal
(
Data
$lossTotal
)
:
Site
{
$this
->
lossTotal
=
$lossTotal
;
return
$this
;
}
/**
* @return Data
*/
public
function
getLossDay
()
:
Data
{
if
(
is_null
(
$this
->
lossDay
))
{
$this
->
lossDay
=
new
Data
();
}
return
$this
->
lossDay
;
}
/**
* @param Data $lossDay
* @return Site
*/
public
function
setLossDay
(
Data
$lossDay
)
:
Site
{
$this
->
lossDay
=
$lossDay
;
return
$this
;
}
/**
* @return Data
*/
public
function
getLossWeek
()
:
Data
{
if
(
is_null
(
$this
->
lossWeek
))
{
$this
->
lossWeek
=
new
Data
();
}
return
$this
->
lossWeek
;
}
/**
* @param Data $lossWeek
* @return Site
*/
public
function
setLossWeek
(
Data
$lossWeek
)
:
Site
{
$this
->
lossWeek
=
$lossWeek
;
return
$this
;
}
/**
* @return Data
*/
public
function
getLossPer1000views
()
:
Data
{
if
(
is_null
(
$this
->
lossPer1000views
))
{
$this
->
lossPer1000views
=
new
Data
();
}
return
$this
->
lossPer1000views
;
}
/**
* @param Data $lossPer1000views
* @return Site
*/
public
function
setLossPer1000views
(
Data
$lossPer1000views
)
:
Site
{
$this
->
lossPer1000views
=
$lossPer1000views
;
return
$this
;
}
/**
* @return Data
*/
public
function
getRecovered
()
:
Data
{
if
(
is_null
(
$this
->
recovered
))
{
$this
->
recovered
=
new
Data
();
}
return
$this
->
recovered
;
}
/**
* @param Data $recovered
* @return Site
*/
public
function
setRecovered
(
Data
$recovered
)
:
Site
{
$this
->
recovered
=
$recovered
;
return
$this
;
}
public
function
getSitesCount
()
{
return
$this
->
sitesCount
;
}
public
function
setSitesCount
(
$sites
)
{
$this
->
sitesCount
=
$sites
;
return
$this
;
}
}
\ No newline at end of file
src/src/App/Entity/Zone.php
deleted
100644 → 0
View file @
9b2d5f7d
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
namespace
App\Entity
;
/**
* Class Zone
* @package App\Entity
*/
class
Zone
extends
Common
{
const
NOT_HIDDEN
=
0
;
const
HIDDEN
=
1
;
/**
* @var string
*/
protected
$siteId
;
protected
$width
;
protected
$height
;
/**
* @var boolean
*/
protected
$hidden
=
0
;
/**
* @return string
*/
public
function
getSiteId
()
{
return
$this
->
siteId
;
}
/**
* @param string $siteId
* @return Zone
*/
public
function
setSiteId
(
$siteId
)
{
$this
->
siteId
=
$siteId
;
return
$this
;
}
/**
* @return string
*/
public
function
getWidth
()
{
return
$this
->
width
;
}
/**
* @param string $width
* @return Zone
*/
public
function
setWidth
(
$width
)
{
$this
->
width
=
$width
;
return
$this
;
}
/**
* @return string
*/
public
function
getHeight
()
{
return
$this
->
height
;
}
/**
* @param string $height
* @return Zone
*/
public
function
setHeight
(
$height
)
{
$this
->
height
=
$height
;
return
$this
;
}
/**
* @return string
*/
public
function
getMinWindowWidth
()
{
return
$this
->
minWindowWidth
;
}
/**
* @param string $minwindowwidth
* @return Zone
*/
public
function
setMinWindowWidth
(
$minwindowwidth
)
{
$this
->
minWindowWidth
=
$minwindowwidth
;
return
$this
;
}
/**
* @return int
*/
public
function
getHidden
()
{
return
$this
->
hidden
;
}
/**
* @param int $is_hidden
* @return Zone
*/
public
function
setHidden
(
$is_hidden
)
{
$this
->
hidden
=
$is_hidden
;
return
$this
;
}
/**
* @return int
*/
public
function
getDisabled
()
{
return
$this
->
disabled
;
}
/**
* @param int $is_disable
* @return Zone
*/
public
function
setDisabled
(
$is_disable
)
{
$this
->
disabled
=
$is_disable
;
return
$this
;
}
/**
* @return string
*/
public
function
getSelectors
()
{
return
$this
->
selectors
;
}
/**
* @param string $selectors
* @return Zone
*/
public
function
setSelectors
(
$selectors
)
{
$this
->
selectors
=
$selectors
;
return
$this
;
}
/**
* @return string
*/
public
function
getMoreSelectors
()
{
return
$this
->
moreSelectors
;
}
/**
* @param string $more_selectors
* @return Zone
*/
public
function
setMoreSelectors
(
$more_selectors
)
{
$this
->
moreSelectors
=
$more_selectors
;
return
$this
;
}
/**
* @return string
*/
public
function
getTargets
()
{
return
$this
->
targets
;
}
/**
* @param string $targets
* @return Zone
*/
public
function
setTargets
(
$targets
)
{
$this
->
targets
=
$targets
;
return
$this
;
}
/**
* @return string
*/
public
function
getStyles
()
{
return
$this
->
styles
;
}
/**
* @param string $styles
* @return Zone
*/
public
function
setStyles
(
$styles
)
{
$this
->
styles
=
$styles
;
return
$this
;
}
/**
* @return string
*/
public
function
getSeq
()
{
return
$this
->
seq
;
}
/**
* @param string $seq
* @return Zone
*/
public
function
setSeq
(
$seq
)
{
$this
->
seq
=
$seq
;
return
$this
;
}
/**
* @return string
*/
public
function
getTpl
()
{
return
$this
->
tpl
;
}
/**
* @param string $tpl
* @return Zone
*/
public
function
setTpl
(
$tpl
)
{
$this
->
tpl
=
$tpl
;
return
$this
;
}
/**
* @return string
*/
public
function
getAddition
()
{
return
$this
->
addition
;
}
/**
* @param string $addition
* @return Zone
*/
public
function
setAddition
(
$addition
)
{
$this
->
addition
=
$addition
;
return
$this
;
}
/**
* @return string
*/
public
function
getComment
()
{
return
$this
->
comment
;
}
/**
* @param string $comment
* @return Zone
*/
public
function
setComment
(
$comment
)
{
$this
->
comment
=
$comment
;
return
$this
;
}
/**
* @return string
*/
public
function
getMinCpm
()
{
return
$this
->
minCpm
;
}
/**
* @param string $minCpm
* @return Zone
*/
public
function
setMinCpm
(
$minCpm
)
{
$this
->
minCpm
=
$minCpm
;
return
$this
;
}
}
\ No newline at end of file
src/src/App/Entity/ZoneAddition.php
deleted
100644 → 0
View file @
9b2d5f7d
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
namespace
App\Entity
;
/**
* Class ZoneAddition
* @package App\Entity
*/
class
ZoneAddition
extends
Common
{
/**
* @var string
*/
/**
* @return string
*/
public
function
getBeforeData
()
{
return
$this
->
beforeData
;
}
/**
* @param string $before
* @return ZoneAddition
*/
public
function
setBeforeData
(
$before
)
{
$this
->
beforeData
=
$before
;
return
$this
;
}
/**
* @return string
*/
public
function
getElData
()
{
return
$this
->
elData
;
}
/**
* @param string $el
* @return ZoneAddition
*/
public
function
setElData
(
$el
)
{
$this
->
elData
=
$el
;
return
$this
;
}
/**
* @return string
*/
public
function
getAfterData
()
{
return
$this
->
afterData
;
}
/**
* @param string $after
* @return ZoneAddition
*/
public
function
setAfterData
(
$after
)
{
$this
->
afterData
=
$after
;
return
$this
;
}
}
\ No newline at end of file
src/src/App/Hydrator/Blockers.php
deleted
100644 → 0
View file @
9b2d5f7d
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
namespace
App\Hydrator
;
use
Zend\Hydrator\ClassMethods
;
use
Zend\Hydrator\NamingStrategy\MapNamingStrategy
;
use
App\Hydrator\Strategy\Data
as
DataStrategy
;
/**
* Class Blockers
* @package App\Hydrator
*/
class
Blockers
extends
ClassMethods
{
/**
* Blockers constructor.
* @param array|bool $underscoreSeparatedKeys
*/
public
function
__construct
(
$underscoreSeparatedKeys
=
true
)
{
$dataPropertiesMapping
=
[
\App\Entity\Statistic\Blockers
::
PROP_FIRST
=>
'first'
,
\App\Entity\Statistic\Blockers
::
PROP_SECOND
=>
'second'
,
\App\Entity\Statistic\Blockers
::
PROP_THIRD
=>
'third'
,
\App\Entity\Statistic\Blockers
::
PROP_FORTH
=>
'forth'
,
];
parent
::
__construct
(
$underscoreSeparatedKeys
);
$this
->
setNamingStrategy
(
new
MapNamingStrategy
(
$dataPropertiesMapping
));
foreach
(
$dataPropertiesMapping
as
$alias
=>
$property
)
{
$this
->
addStrategy
(
$alias
,
new
DataStrategy
(
\App\Hydrator\Strategy\Data
::
EXTRACT_PERCENT
));
}
}
}
\ No newline at end of file
src/src/App/Hydrator/Site.php
deleted
100644 → 0
View file @
9b2d5f7d
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
namespace
App\Hydrator
;
use
App\Hydrator\Strategy\Data
as
DataStrategy
;
use
Zend\Hydrator\ClassMethods
;
use
Zend\Hydrator\NamingStrategy\MapNamingStrategy
;
/**
* Class Site
* @package App\Hydrator
*/
class
Site
extends
ClassMethods
{
/**
* Site constructor.
*/
public
function
__construct
(
$underscoreSeparatedKeys
=
true
)
{
$dataPropertiesMapping
=
[
\App\Entity\Statistic\Site
::
PROP_USERS_WITH_ADBLOCKER
=>
'usersWithAdBlocker'
,
\App\Entity\Statistic\Site
::
PROP_USERS_WITHOUT_ADBLOCKER
=>
'usersWithoutAdBlocker'
,
\App\Entity\Statistic\Site
::
PROP_LOSS_TOTAL
=>
'lossTotal'
,
\App\Entity\Statistic\Site
::
PROP_LOSS_DAY
=>
'lossDay'
,
\App\Entity\Statistic\Site
::
PROP_LOSS_WEEK
=>
'lossWeek'
,
\App\Entity\Statistic\Site
::
PROP_LOSS_PER1000VIEWS
=>
'lossPer1000views'
,
\App\Entity\Statistic\Site
::
PROP_RECOVERED
=>
'recovered'
,
];
parent
::
__construct
(
$underscoreSeparatedKeys
);
$this
->
setNamingStrategy
(
new
MapNamingStrategy
(
$dataPropertiesMapping
));
foreach
(
$dataPropertiesMapping
as
$alias
=>
$property
)
{
$this
->
addStrategy
(
$alias
,
new
DataStrategy
());
}
}
}
\ No newline at end of file
src/src/App/Hydrator/Strategy/Data.php
deleted
100644 → 0
View file @
9b2d5f7d
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
namespace
App\Hydrator\Strategy
;
use
App\Entity\Statistic\Data
as
DataEntity
;
use
App\Hydrator\Data
as
DataHydrator
;
use
Zend\Hydrator\Strategy\DefaultStrategy
;
/**
* Class Data
* @package App\Hydrator\Strategy
*/
class
Data
extends
DefaultStrategy
{
const
EXTRACT_ALL
=
1
;
const
EXTRACT_VALUES
=
2
;
const
EXTRACT_PERCENT
=
3
;
const
EXTRACT_TITLE
=
4
;
protected
$mode
;
/**
* Data constructor.
*/
public
function
__construct
(
$mode
=
Data
::
EXTRACT_ALL
)
{
$this
->
mode
=
$mode
;
}
/**
* @param \App\Entity\Statistic\Data $value
* @return mixed
*/
public
function
extract
(
$value
)
{
//$value = parent::extract($value);
switch
(
$this
->
mode
)
{
case
Data
::
EXTRACT_VALUES
:
$result
=
$value
->
getValue
();
break
;
case
Data
::
EXTRACT_PERCENT
:
$result
=
$value
->
getPercent
();
break
;
case
Data
::
EXTRACT_TITLE
:
$result
=
$value
->
getTitle
();
break
;
case
Data
::
EXTRACT_ALL
:
default
:
$result
=
(
new
DataHydrator
())
->
extract
(
$value
);
break
;
}
return
$result
;
}
/**
* @param mixed $value
* @return mixed
*/
public
function
hydrate
(
$value
)
{
if
(
!
$value
instanceof
DataEntity
)
{
$value
=
(
new
DataHydrator
())
->
hydrate
(
$value
,
new
DataEntity
());
}
parent
::
hydrate
(
$value
);
return
$value
;
}
}
\ No newline at end of file
src/src/App/Model/Providers.php
deleted
100644 → 0
View file @
9b2d5f7d
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
namespace
App\Model
;
use
App\Entity\Provider
;
//use App\Model\Common;
/**
* Class Providers
* @package App\Model
*/
class
Providers
extends
Common
{
/**
* @param \App\Entity\Common $entity
* @return int
* @throws \Exception
*/
public
function
create
(
$entity
)
{
$data
=
$this
->
delegatingHydrator
->
extract
(
$entity
);
// accept data columns only available at table
$data
=
array_intersect_key
(
$data
,
array_fill_keys
(
$this
->
tableGateway
->
getColumns
(),
1
));
$query
=
function
(
$data
)
{
$this
->
tableGateway
->
insert
(
$data
);
$insertId
=
$this
->
tableGateway
->
lastInsertValue
;
return
$insertId
;
};
try
{
$this
->
tableGateway
->
getAdapter
()
->
getDriver
()
->
getConnection
()
->
beginTransaction
();
$id
=
$query
(
$data
);
$this
->
tableGateway
->
getAdapter
()
->
getDriver
()
->
getConnection
()
->
commit
();
}
catch
(
\Exception
$e
)
{
$this
->
tableGateway
->
getAdapter
()
->
getDriver
()
->
getConnection
()
->
rollback
();
throw
$e
;
}
return
$id
;
}
}
src/src/App/Model/ProvidersDomains.php
deleted
100644 → 0
View file @
9b2d5f7d
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
namespace
App\Model
;
use
App\Entity\ProviderDomain
;
use
App\Model\Common
;
/**
* Class Providers
* @package App\Model
*/
class
ProvidersDomains
extends
Common
{
/**
* @param \App\Entity\Common $entity
* @return int
* @throws \Exception
*/
public
function
create
(
$entity
)
{
$data
=
$this
->
delegatingHydrator
->
extract
(
$entity
);
// accept data columns only available at table
$data
=
array_intersect_key
(
$data
,
array_fill_keys
(
$this
->
tableGateway
->
getColumns
(),
1
));
$query
=
function
(
$data
)
{
$this
->
tableGateway
->
insert
(
$data
);
$insertId
=
$this
->
tableGateway
->
lastInsertValue
;
return
$insertId
;
};
try
{
$this
->
tableGateway
->
getAdapter
()
->
getDriver
()
->
getConnection
()
->
beginTransaction
();
$id
=
$query
(
$data
);
$this
->
tableGateway
->
getAdapter
()
->
getDriver
()
->
getConnection
()
->
commit
();
}
catch
(
\Exception
$e
)
{
$this
->
tableGateway
->
getAdapter
()
->
getDriver
()
->
getConnection
()
->
rollback
();
throw
$e
;
}
return
$id
;
}
/**
* @param $name
* @return mixed
*/
public
function
findByName
(
$name
)
{
// we got an arrray instead of HydratingResultSet
// so use current
$result
=
$this
->
findOne
([
'name'
=>
$name
]);
return
$result
;
}
}
src/src/App/Model/Sites.php
deleted
100644 → 0
View file @
9b2d5f7d
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
namespace
App\Model
;
use
App\Entity\Site
;
/**
* Class Sites
* @package App\Model
*/
class
Sites
extends
Common
{
/**
* @param $id
* @return Site[]
*/
public
function
findByUserId
(
$id
)
{
/** @noinspection PhpIncompatibleReturnTypeInspection */
return
$this
->
findAll
([
'users_id'
=>
$id
],
'domain ASC'
);
}
/**
* @param $id int
* @param $usersId int
* @return int
*/
public
function
delete
(
$id
,
$usersId
)
{
return
$this
->
tableGateway
->
delete
([
'id'
=>
$id
,
'users_id'
=>
$usersId
]);
}
/**
* @param $siteId
* @param $userId
* @return \Zend\Db\ResultSet\HydratingResultSet
*/
public
function
findByIdAndUserId
(
$siteId
,
$userId
)
{
return
$this
->
findAll
([
'id'
=>
$siteId
,
'users_id'
=>
$userId
])
->
current
();
}
/**
*
* @param type $siteDomain
* @param type $userId
*
* @return \App\Entity\Common|object
* @throws \Exception
*/
public
function
findByDomainAndUserId
(
$siteDomain
,
$userId
)
{
return
$this
->
findOne
([
'domain'
=>
$siteDomain
,
'users_id'
=>
$userId
]);
}
public
function
findByDomain
(
$siteDomain
)
{
return
$this
->
findAll
([
'domain'
=>
$siteDomain
]);
}
public
function
findByAlias
(
$alias
)
{
$sites
=
$this
->
findAll
();
foreach
(
$sites
as
$site
)
{
$site_aliases
=
explode
(
","
,
$site
->
getAlias
());
foreach
(
$site_aliases
as
$key
=>
$site_alias
)
{
$site_aliases
[
$key
]
=
trim
(
$site_alias
);
}
if
(
in_array
(
$alias
,
$site_aliases
))
{
return
$site
;
}
}
return
null
;
}
public
function
findBy
(
$where
=
null
,
$limit
=
null
,
$order
=
null
)
{
if
(
$where
[
'category'
])
{
$result
=
parent
::
findByLike
(
$where
,
$limit
,
$order
);
}
else
{
$result
=
parent
::
findBy
(
$where
,
$limit
,
$order
);
}
return
$result
;
}
public
function
findAllSites
()
{
$url
=
'http://piguiqproxy.com/api'
;
$username
=
'dev'
;
$password
=
'LJsVSwx2K5t5HvcWaBKKDbLzB625D5mhrbDFaxYzugkutp23eUB5F'
;
$ch
=
curl_init
();
curl_setopt
(
$ch
,
CURLOPT_URL
,
$url
);
curl_setopt
(
$ch
,
CURLOPT_TIMEOUT
,
30
);
curl_setopt
(
$ch
,
CURLOPT_RETURNTRANSFER
,
true
);
curl_setopt
(
$ch
,
CURLOPT_POST
,
true
);
curl_setopt
(
$ch
,
CURLOPT_POSTFIELDS
,
"m=whitelist_get"
);
curl_setopt
(
$ch
,
CURLOPT_HTTPHEADER
,
array
(
'Content-Type: application/x-www-form-urlencoded'
,
'Authorization: Basic '
.
base64_encode
(
$username
.
":"
.
$password
)
));
// выполняем запрос
$result
=
curl_exec
(
$ch
);
$info
=
curl_getinfo
(
$ch
);
// закрываем curl
curl_close
(
$ch
);
if
(
$info
[
'http_code'
]
!=
200
)
{
throw
new
\Exception
(
'Error. '
.
$info
[
'http_code'
]);
}
return
json_decode
(
$result
,
1
);
}
public
function
createListItem
(
$entity
)
{
$data
=
$this
->
delegatingHydrator
->
extract
(
$entity
);
// accept data columns only available at table
$data
=
array_intersect_key
(
$data
,
array_fill_keys
(
$this
->
tableGateway
->
getColumns
(),
1
));
$query
=
function
(
$data
)
{
$this
->
tableGateway
->
insert
(
$data
);
$insertId
=
$this
->
tableGateway
->
lastInsertValue
;
return
$insertId
;
};
try
{
$this
->
tableGateway
->
getAdapter
()
->
getDriver
()
->
getConnection
()
->
beginTransaction
();
$id
=
$query
(
$data
);
$this
->
tableGateway
->
getAdapter
()
->
getDriver
()
->
getConnection
()
->
commit
();
}
catch
(
\Exception
$e
)
{
$this
->
tableGateway
->
getAdapter
()
->
getDriver
()
->
getConnection
()
->
rollback
();
throw
$e
;
}
return
$id
;
}
public
function
createListSites
()
{
$list_sites
=
[];
foreach
(
$this
->
findAll
()
->
toArray
()
as
$site_data
)
{
$list_sites
[
$site_data
[
'id'
]]
=
$site_data
[
'domain'
];
}
return
$list_sites
;
}
public
function
createListSitesById
(
$sites_id
)
{
$list_sites
=
[];
foreach
(
$this
->
findAll
([
'id'
=>
$sites_id
])
->
toArray
()
as
$site_data
)
{
$list_sites
[
$site_data
[
'id'
]]
=
$site_data
[
'domain'
];
}
return
$list_sites
;
}
}
\ No newline at end of file
src/src/App/Model/Slots.php
deleted
100644 → 0
View file @
9b2d5f7d
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
namespace
App\Model
;
use
App\Entity\Slot
;
/**
* Class Slots
* @package App\Model
*/
class
Slots
extends
Common
{
/**
* @param $id
* @return Slot[]
*/
public
function
findBySiteId
(
$id
)
{
/** @noinspection PhpIncompatibleReturnTypeInspection */
return
$this
->
findAll
([
'site_id'
=>
$id
]);
}
/**
* @param \App\Entity\Common $entity
* @return int
* @throws \Exception
*/
public
function
create
(
$entity
)
{
$data
=
$this
->
delegatingHydrator
->
extract
(
$entity
);
// accept data columns only available at table
$data
=
array_intersect_key
(
$data
,
array_fill_keys
(
$this
->
tableGateway
->
getColumns
(),
1
));
$query
=
function
(
$data
)
{
$this
->
tableGateway
->
insert
(
$data
);
$insertId
=
$this
->
tableGateway
->
lastInsertValue
;
return
$insertId
;
};
try
{
$this
->
tableGateway
->
getAdapter
()
->
getDriver
()
->
getConnection
()
->
beginTransaction
();
$id
=
$query
(
$data
);
$this
->
tableGateway
->
getAdapter
()
->
getDriver
()
->
getConnection
()
->
commit
();
}
catch
(
\Exception
$e
)
{
$this
->
tableGateway
->
getAdapter
()
->
getDriver
()
->
getConnection
()
->
rollback
();
throw
$e
;
}
return
$id
;
}
}
\ No newline at end of file
src/src/App/Model/Zones.php
deleted
100644 → 0
View file @
9b2d5f7d
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
namespace
App\Model
;
use
App\Entity\Zone
;
use
Zend\Diactoros\Response\JsonResponse
;
/**
* Class Zones
* @package App\Model
*/
class
Zones
extends
Common
{
/**
* @param $id
* @return Zone[]
*/
public
function
findBySiteId
(
$id
)
{
/** @noinspection PhpIncompatibleReturnTypeInspection */
return
$this
->
findAll
([
'site_id'
=>
$id
,
'hidden'
=>
0
]);
}
/**
* @param $id
* @return int
*/
public
function
findCurrentIdBySiteId
(
$id
)
{
/** @noinspection PhpIncompatibleReturnTypeInspection */
$zones
=
$this
->
findAll
([
'site_id'
=>
$id
]);
$currentIdZone
=
$id
*
100
;
foreach
(
$zones
as
$zone
)
{
$currentIdZone
=
(
$zone
->
getId
()
>
$currentIdZone
)
?
$zone
->
getId
()
:
$currentIdZone
;
}
return
$currentIdZone
;
}
public
function
findSiteZones
()
{
$adapter
=
$this
->
tableGateway
->
getAdapter
();
$sql
=
'SELECT site_id, COUNT(*) AS count'
.
' FROM '
.
(
string
)
$this
->
tableGateway
->
getTable
()
.
' GROUP BY site_id'
;
$res
=
$adapter
->
query
(
$sql
,
\Zend\Db\Adapter\Adapter
::
QUERY_MODE_EXECUTE
);
$zonesCount
=
array
();
if
(
$res
)
{
foreach
(
$res
as
$r
)
{
$zonesCount
[
$r
[
'site_id'
]]
=
$r
[
'count'
];
}
}
return
$zonesCount
;
}
public
function
findZonesInfoSize
()
{
$zones_list
=
[];
$zones
=
$this
->
findAll
()
->
toArray
();
foreach
(
$zones
as
$zone
)
{
$zones_list
[
$zone
[
'id'
]][
'size'
]
=
$zone
[
'width'
]
.
'x'
.
$zone
[
'height'
];
$zones_list
[
$zone
[
'id'
]][
'site_id'
]
=
$zone
[
'site_id'
];
}
return
$zones_list
;
}
public
function
findZonesInfoSizeById
(
$zones_id
)
{
$zones_list
=
[];
$zones
=
$this
->
findAll
([
'id'
=>
$zones_id
])
->
toArray
();
foreach
(
$zones
as
$zone
)
{
$zones_list
[
$zone
[
'id'
]][
'size'
]
=
$zone
[
'width'
]
.
'x'
.
$zone
[
'height'
];
}
return
$zones_list
;
}
/**
* @param \App\Entity\Common $entity
* @return int
* @throws \Exception
*/
public
function
create
(
$entity
)
{
$data
=
$this
->
delegatingHydrator
->
extract
(
$entity
);
// accept data columns only available at table
$data
=
array_intersect_key
(
$data
,
array_fill_keys
(
$this
->
tableGateway
->
getColumns
(),
1
));
$query
=
function
(
$data
)
{
$this
->
tableGateway
->
insert
(
$data
);
$insertId
=
$this
->
tableGateway
->
lastInsertValue
;
return
$insertId
;
};
try
{
$this
->
tableGateway
->
getAdapter
()
->
getDriver
()
->
getConnection
()
->
beginTransaction
();
$id
=
$query
(
$data
);
$this
->
tableGateway
->
getAdapter
()
->
getDriver
()
->
getConnection
()
->
commit
();
}
catch
(
\Exception
$e
)
{
$this
->
tableGateway
->
getAdapter
()
->
getDriver
()
->
getConnection
()
->
rollback
();
throw
$e
;
}
return
$id
;
}
public
function
updateStatus
(
$id
,
$status
,
$value
)
{
$zone
=
$this
->
findById
(
$id
);
$data
=
[];
if
(
$zone
)
{
$hydrator
=
$this
->
delegatingHydrator
;
$zone
=
$hydrator
->
hydrate
([
$status
=>
$value
],
$zone
);
try
{
$this
->
save
(
$zone
);
$data
[
'result'
]
=
true
;
}
catch
(
\Exception
$e
)
{
$data
[
'result'
]
=
false
;
$data
[
'msg'
]
=
$e
->
getMessage
();
}
}
else
{
$data
=
[
'result'
=>
false
,
'msg'
=>
'Zone not found'
,
];
}
$response
=
new
JsonResponse
(
$data
);
return
$response
;
}
public
function
deleteBySiteId
(
$site_id
)
{
$zone_items
=
$this
->
findAll
([
'site_id'
=>
$site_id
]);
if
(
$zone_items
)
{
foreach
(
$zone_items
as
$zone_item
)
{
$result
=
$this
->
deleteById
(
$zone_item
->
getId
());
}
}
return
$result
;
}
public
function
createListZones
()
{
$list_zones
=
[];
foreach
(
$this
->
findAll
()
->
toArray
()
as
$zone_data
)
{
$list_zones
[
$zone_data
[
'id'
]]
=
$zone_data
[
'site_id'
];
}
return
$list_zones
;
}
}
\ No newline at end of file
src/src/App/Model/ZonesAdditions.php
deleted
100644 → 0
View file @
9b2d5f7d
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
namespace
App\Model
;
use
App\Entity\ZoneAddition
;
/**
* Class ZonesAdditions
* @package App\Model
*/
class
ZonesAdditions
extends
Common
{
/**
* @param $id
* @return ZonesAddition[]
*/
public
function
findById
(
$id
)
{
/** @noinspection PhpIncompatibleReturnTypeInspection */
return
$this
->
findAll
([
'id'
=>
$id
]);
}
public
function
findOneById
(
$id
)
{
/** @noinspection PhpIncompatibleReturnTypeInspection */
return
$this
->
findOne
([
'id'
=>
$id
]);
}
/**
* @param \App\Entity\Common $entity
* @return int
* @throws \Exception
*/
public
function
create
(
$entity
)
{
$data
=
$this
->
delegatingHydrator
->
extract
(
$entity
);
// accept data columns only available at table
$data
=
array_intersect_key
(
$data
,
array_fill_keys
(
$this
->
tableGateway
->
getColumns
(),
1
));
$query
=
function
(
$data
)
{
$this
->
tableGateway
->
insert
(
$data
);
$insertId
=
$this
->
tableGateway
->
lastInsertValue
;
return
$insertId
;
};
try
{
$this
->
tableGateway
->
getAdapter
()
->
getDriver
()
->
getConnection
()
->
beginTransaction
();
$id
=
$query
(
$data
);
$this
->
tableGateway
->
getAdapter
()
->
getDriver
()
->
getConnection
()
->
commit
();
}
catch
(
\Exception
$e
)
{
$this
->
tableGateway
->
getAdapter
()
->
getDriver
()
->
getConnection
()
->
rollback
();
throw
$e
;
}
return
$id
;
}
public
function
clearTable
()
{
$adapter
=
$this
->
tableGateway
->
getAdapter
();
$sql
=
'TRUNCATE TABLE zones_additions'
;
$res
=
$adapter
->
query
(
$sql
,
\Zend\Db\Adapter\Adapter
::
QUERY_MODE_EXECUTE
);
return
$res
;
}
}
\ No newline at end of file
src/templates/app/examples.phtml
deleted
100644 → 0
View file @
9b2d5f7d
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
/** @var $this \Zend\View\Renderer\PhpRenderer */
//@todo absent page & styles/scripts
//$this->headScript()
// ->appendFile('/js/script-examples.js');
//
//$this->headLink()
// ->appendStylesheet('/css/styles-examples.css');
?>
<div
style=
"min-height: 200px"
>
<center>
<h1
style=
"padding-top: 50px"
>
NO CONTENT AVAILABLE
</h1>
</center>
</div>
src/templates/app/popup/add-site.phtml
deleted
100644 → 0
View file @
9b2d5f7d
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
/** @var $this \Zend\View\Renderer\PhpRenderer */
$dataUrl
=
$this
->
url
(
'site.add'
,
[
'lang'
=>
$this
->
lang
]);
?>
<div
class=
"add-site b-popup__window"
>
<p
class=
"button-close"
></p>
<div
class=
"form-wrapp"
>
<form
action=
""
class=
""
name=
"site"
data-url=
"
<?=
$dataUrl
?>
"
>
<h1>
<?=
_t
(
"Подключение к AddCPM"
)
?>
</h1>
<span
class=
"input input--akira"
>
<input
class=
"input__field input__field--akira"
type=
"text"
id=
"site"
name=
"site"
/>
<label
class=
"input__label input__label--akira"
for=
"site"
>
<span
class=
"input__label-content input__label-content--akira"
>
<?=
_t
(
"Адрес сайта"
)
?>
</span>
</label>
</span>
<input
type=
"submit"
name=
"submit"
value=
"
<?=
_t
(
'Отправить запрос'
)
?>
"
class=
"button-open"
>
</form>
</div>
</div>
src/templates/app/statistics.phtml
deleted
100644 → 0
View file @
9b2d5f7d
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
/** @var $this \Zend\View\Renderer\PhpRenderer */
$this
->
headScript
()
->
appendFile
(
'//cdnjs.cloudflare.com/ajax/libs/autosize.js/3.0.18/autosize.min.js'
)
->
appendFile
(
'/js/chartjs.js'
)
// old unknow version
->
appendFile
(
'/js/chartCircle.js'
)
//custom scripts for old version of chart.js
->
appendFile
(
'/js/chartLine.js'
)
//custom scripts for old version of chart.js
->
appendFile
(
'/js/script-statistics.js'
)
;
$this
->
headLink
()
->
appendStylesheet
(
'/css/styles-statistics.css'
);
/** @var \App\Entity\Statistic\Site $siteStatistic */
?>
<section
class=
"b-content__title"
>
<div
class=
"wrapp"
>
<h1>
<?=
_t
(
"Статистика"
)
?>
</h1>
<div
class=
"row"
>
<p
class=
"lead col sm-offset-1 sm-10"
>
<?=
sprintf
(
_t
(
"Статистика обновляется ежедневно и охватывает более %s с площадок различной направленности в Украине, России и Казахстане"
),
$siteStatistic
->
getSitesCount
())
?>
</p>
</div>
</div>
</section>
<?=
$this
->
partial
(
'app::statistics/losses'
)
?>
<?=
$this
->
partial
(
'app::statistics/use-block'
)
?>
<?=
$this
->
partial
(
'app::statistics/traffic'
)
?>
<section
class=
"b-content__contact"
>
<div
class=
"wrapp"
>
<h1>
<?=
_t
(
"Узнайте сколько теряет ваш сайт!"
)
?>
</h1>
<p
class=
"text"
>
<?=
_t
(
"Интегрируйте наш счётчик бесплатно и оцените потери сайта из-за блокировщиков."
)
?>
</p>
<div
class=
"row row-wrap"
>
<form
action=
"
<?=
$this
->
url
(
'email.counter'
)
?>
"
method=
"post"
accept-charset=
"utf-8"
class=
"form-contact col sm-offset-3 sm-6 xs-offset-2 xs-8"
name=
"contact-email"
>
<span
class=
"input input--akira"
>
<input
class=
"input__field input__field--akira"
type=
"email"
id=
"e-mail"
name=
"email"
/>
<label
class=
"input__label input__label--akira"
for=
"e-mail"
>
<span
class=
"input__label-content input__label-content--akira"
>
<?=
_t
(
"Ваш e-mail"
)
?>
</span>
</label>
</span>
<input
type=
"submit"
value=
"
<?=
_t
(
'Получить счетчик'
)
?>
"
>
</form>
</div>
<p
class=
"text"
>
<span>
<?=
_t
(
"Уже установили счётчик?"
)
?>
</span>
<a
href=
"#"
class=
"link login-button button-open"
>
<?=
_t
(
"Войти в личный кабинет"
)
?>
</a>
</p>
</div>
</section>
src/templates/app/user/cabinet-feed.phtml
View file @
55f619f4
...
...
@@ -25,8 +25,6 @@
/** @var $this \Zend\View\Renderer\PhpRenderer */
/** @var $userSiteStatistic \App\Entity\Statistic\Site */
$this
->
headScript
()
->
appendFile
(
'/js/underscore-min.js'
)
->
appendFile
(
'/js/jquery.cookie.js'
)
...
...
src/templates/app/user/cabinet.phtml
deleted
100644 → 0
View file @
9b2d5f7d
This diff is collapsed.
Click to expand it.
src/templates/layout/layout-main.phtml
View file @
55f619f4
...
...
@@ -133,7 +133,6 @@ $urlHome = $this->url(
<?php
//= $this->partial('app::popup/login', ['lang' => $lang]) ?>
<?=
$this
->
partial
(
'app::popup/to-action'
,
[
'lang'
=>
$lang
])
?>
<?=
$this
->
partial
(
'app::popup/connection'
,
[
'lang'
=>
$lang
])
?>
<?=
$this
->
partial
(
'app::popup/add-site'
,
[
'lang'
=>
$lang
])
?>
<?=
$this
->
partial
(
'app::popup/password-reset'
,
[
'lang'
=>
$lang
])
?>
<?=
$this
->
partial
(
'app::popup/confirm'
,
[
'lang'
=>
$lang
])
?>
...
...
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