sync
This commit is contained in:
50
modules/KKC/app.php
Normal file
50
modules/KKC/app.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace API;
|
||||
|
||||
trait app
|
||||
{
|
||||
public function appUser($params)
|
||||
{
|
||||
//WHERE [ip]='".$_SERVER['REMOTE_ADDR']."'
|
||||
$query = "SELECT TOP 1 [id]
|
||||
,[ip]
|
||||
,[user_desc]
|
||||
,[isAdmin]
|
||||
,[isBan]
|
||||
FROM [SITE].[dbo].[kkc_users]
|
||||
WHERE [ip]='".$_SERVER['REMOTE_ADDR']."'
|
||||
AND isBan <> 1";
|
||||
select($query);
|
||||
}
|
||||
|
||||
public function appHeadersById($params)
|
||||
{
|
||||
if ($params['isAdmin']) {
|
||||
$query = "SELECT *
|
||||
FROM [SITE].[dbo].[kkc_headers]
|
||||
ORDER BY id";
|
||||
} else {
|
||||
$query = "SELECT * FROM [SITE].[dbo].[get_headers_by_user_id] ('".$params['id_user']."')";
|
||||
}
|
||||
select($query);
|
||||
}
|
||||
|
||||
public function appAllSubheaders($params)
|
||||
{
|
||||
$query = "SELECT *
|
||||
FROM [SITE].[dbo].[kkc_headers]
|
||||
WHERE isHeader is not null
|
||||
and idSubHeader is null
|
||||
";
|
||||
select($query);
|
||||
}
|
||||
|
||||
public function appVisits($params)
|
||||
{
|
||||
$query = "SELECT count([isVisit]) countVisits
|
||||
FROM [SITE].[dbo].[kkc_stat]
|
||||
where [isVisit]=1";
|
||||
select($query);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user