This commit is contained in:
Your Name
2020-07-03 14:29:46 +03:00
parent 6f82be0ef9
commit 347c9bddb0
5 changed files with 98 additions and 75 deletions

View File

@@ -1,6 +1,6 @@
<?php <?php
ini_set('display_errors', 1); ini_set('display_errors', 0);
ini_set('display_startup_errors', 0); ini_set('display_startup_errors', 0);
@@ -10,28 +10,28 @@ if (isset($_SERVER['HTTP_HOST']))
if (isset($_SERVER['HTTP_HOST'])) if (isset($_SERVER['HTTP_HOST']))
define('SITEPATH', $_SERVER['DOCUMENT_ROOT'].'/'); define('SITEPATH', $_SERVER['DOCUMENT_ROOT'].'/');
else else
define('SITEPATH', dirname(__FILE__)); define('SITEPATH', dirname(__FILE__));
if (SITE == 'http://klan.argumenti.ru/'){ if (SITE == 'http://klan.argumenti.ru/'){
define('PDFSOURCE', '/vhosts/an/httpdocs/pub/files/pdf/pdf/'); define('PDFSOURCE', '/vhosts/an/httpdocs/pub/files/pdf/pdf/');
define('HTMLSOURCE', '/vhosts/an/httpdocs/pub/files/html/'); define('HTMLSOURCE', '/vhosts/an/httpdocs/pub/files/html/');
} }
else { else {
define('PDFSOURCE', SITEPATH.'pub/source/'); define('PDFSOURCE', SITEPATH.'pub/source/');
} }
define('PDFPATH', '/pub/files/pdf/'); define('PDFPATH', '/pub/files/pdf/');
define('PGPATH', '/pub/files/pages/'); define('PGPATH', '/pub/files/pages/');
define('PDFDIR', SITEPATH.PDFPATH); define('PDFDIR', SITEPATH.PDFPATH);
define('PGDIR', SITEPATH.PGPATH); define('PGDIR', SITEPATH.PGPATH);
define('APPPATH', SITEPATH); define('APPPATH', SITEPATH);
define('VIEWPATH', SITEPATH.'views/'); define('VIEWPATH', SITEPATH.'views/');
define('API', 'http://api.argumenti.ru/'); define('API', 'http://api.argumenti.ru/');
define('IMGSRV', 'https://imgurl.argumenti.ru/'); define('IMGSRV', 'https://imgurl.argumenti.ru/');
/** отправка уведомлений */ /** отправка уведомлений */
set('mail', set('mail',
[ [
'login' => 'noreply@argumenti.ru', 'login' => 'noreply@argumenti.ru',
'name' => 'Аргументы Недели', 'name' => 'Аргументы Недели',

View File

@@ -243,7 +243,7 @@ h1 {
font-weight: bold; font-weight: bold;
margin: 20px; margin: 20px;
font-size: 1.2em; font-size: 1.2em;
} }
.book_small{ .book_small{
position:relative; position:relative;
@@ -254,11 +254,11 @@ h1 {
width: 100%; width: 100%;
margin-top: 10%; margin-top: 10%;
text-align: center; text-align: center;
} }
#form_title{ #form_title{
font-size: 18px; font-size: 18px;
} }
#container_form p { #container_form p {
font-size: 1.3em; font-size: 1.3em;
margin-bottom: 8px; margin-bottom: 8px;
@@ -281,7 +281,7 @@ input[type="email"],input[type="password"]{
padding-left: 10px; padding-left: 10px;
font-size: 16px; font-size: 16px;
box-sizing: border-box; box-sizing: border-box;
} }
#container_form span.icon { #container_form span.icon {
width: 50px; width: 50px;
transition: all 800ms; transition: all 800ms;
@@ -304,20 +304,20 @@ input[type="email"],input[type="password"]{
background-color: #69c; background-color: #69c;
border: none; border: none;
cursor: pointer; cursor: pointer;
} }
.submit:hover{ .submit:hover{
transition: all 0.5s; transition: all 0.5s;
background: #fff; background: #fff;
color: #2c536c; color: #2c536c;
} }
.lib_container { .lib_container {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: left; justify-content: left;
flex-wrap: wrap; flex-wrap: wrap;
} }
.book_skeleton { .book_skeleton {
width:25%; width:25%;
margin-bottom: 30px; margin-bottom: 30px;
@@ -399,14 +399,14 @@ input[type="email"],input[type="password"]{
float: left; float: left;
margin: 0px; margin: 0px;
margin-right: 25px; margin-right: 25px;
} }
.anphoto IMG { .anphoto IMG {
width: 100%; width: 100%;
margin: 0px; margin: 0px;
display: block; display: block;
} }
@@ -443,10 +443,16 @@ input[type="email"],input[type="password"]{
#book-html p { #book-html p {
width: 85%; width: 85%;
} }
#lk-menu div, .header-div {
margin-right: 5px;
padding: 10px 7px;
}
} }
@media screen and (max-width: 768px) { @media screen and (max-width: 768px) {
body {
width:92%;
}
#book-html p { #book-html p {
width: 100%; width: 100%;
} }
@@ -507,13 +513,12 @@ input[type="email"],input[type="password"]{
} }
@media screen and (max-width: 560px) { @media screen and (max-width: 560px) {
body {
width: 97%;
}
#pages { #pages {
font-size: .7em; font-size: .7em;
} }
body {
width:90%;
}
header .lite-logo { header .lite-logo {
width: 45%; width: 45%;
} }
@@ -580,8 +585,18 @@ input[type="email"],input[type="password"]{
.antitle { .antitle {
font-size: 1.2em; font-size: 1.2em;
} }
.header-div, #lk-menu div {
margin-right: 4px;
font-size: .9em;
}
} }
@media screen and (max-width: 460px) { @media screen and (max-width: 460px) {
.hid460 {
display:none;
}
.header-div, #lk-menu div {
font-size:1.1em;
}
header { header {
font-size:.8em; font-size:.8em;
} }

View File

@@ -11,16 +11,16 @@ function addclient(){
$clientdate = date('Y-m-d G:i:s'); $clientdate = date('Y-m-d G:i:s');
else else
$clientdate = $buy['date_start']; $clientdate = $buy['date_start'];
$clientmail = strtolower(trim($buy['buy_email']));
$clientmail = strtolower(trim($buy['buy_email']));
$clienthash = md5($clientmail); $clienthash = md5($clientmail);
$client = db_get("SELECT `client_id`, `clientcard`, `clientdate` FROM `clients` WHERE `clientmail` = '$clientmail' LIMIT 1"); $client = db_get("SELECT `client_id`, `clientcard`, `clientdate` FROM `clients` WHERE `clientmail` = '$clientmail' LIMIT 1");
if (isset($client['client_id'])){ if (isset($client['client_id'])){
if ($client['clientdate'] == '0000-00-00 00:00:00'){ if ($client['clientdate'] == '0000-00-00 00:00:00'){
$updsql = "UPDATE `clients` SET `clientdate` = '$clientdate' WHERE `client_id` = '{$client['client_id']}'"; $updsql = "UPDATE `clients` SET `clientdate` = '$clientdate' WHERE `client_id` = '{$client['client_id']}'";
db_get($updsql, 'writer'); db_get($updsql, 'writer');
@@ -41,12 +41,12 @@ function addclient(){
} }
else { else {
$inssql = "INSERT INTO `clients` (clientmail, clientdate, clienthash) VALUES ('$clientmail', '$clientdate', '$clienthash')"; $inssql = "INSERT INTO `clients` (clientmail, clientdate, clienthash) VALUES ('$clientmail', '$clientdate', '$clienthash')";
db_get($inssql, 'writer'); db_get($inssql, 'writer');
echo "$inssql \n"; echo "$inssql \n";
} }
} }
} }
@@ -56,15 +56,15 @@ function addclientid(){
$buys = db_get("SELECT `buy_id`, `buy_email` FROM `anbuy` WHERE `client_id` = 0"); $buys = db_get("SELECT `buy_id`, `buy_email` FROM `anbuy` WHERE `client_id` = 0");
foreach ($buys as $buy){ foreach ($buys as $buy){
$clientmail = strtolower(trim($buy['buy_email'])); $clientmail = strtolower(trim($buy['buy_email']));
$client = db_get("SELECT `client_id` FROM `clients` WHERE `clientmail` = '$clientmail' LIMIT 1"); $client = db_get("SELECT `client_id` FROM `clients` WHERE `clientmail` = '$clientmail' LIMIT 1");
if (isset($client['client_id'])){ if (isset($client['client_id'])){
$updsql = "UPDATE `anbuy` SET `client_id` = '{$client['client_id']}' WHERE `buy_id` = '{$buy['buy_id']}'"; $updsql = "UPDATE `anbuy` SET `client_id` = '{$client['client_id']}' WHERE `buy_id` = '{$buy['buy_id']}'";
echo "$updsql\n"; echo "$updsql\n";
db_get($updsql); db_get($updsql);
} }
} }
} }
@@ -85,13 +85,13 @@ function restoration_kuri(){
if (isset($_POST['reset_mail'])){ if (isset($_POST['reset_mail'])){
$email = $_POST['reset_mail']; $email = $_POST['reset_mail'];
$title = 'Восстановление пароля'; $title = 'Восстановление пароля';
$hash = api_restore_mail($mail); $hash = api_restore_mail($mail);
if ($hash !== false) { if ($hash !== false) {
$hashlink = SITE.'resetlink/'.$hash; $hashlink = SITE.'resetlink/'.$hash;
} }
echo $hashlink; echo $hashlink;
$tempcontent = VIEWPATH.'restore_add.phtml'; $tempcontent = VIEWPATH.'restore_add.phtml';
@@ -113,13 +113,13 @@ function resetlink_kuri($hash){
$res = api_restore_hash($hash); $res = api_restore_hash($hash);
if (!$res){ if (!$res){
} }
else { else {
header("HTTP/1.1 301 Moved Permanently"); header("HTTP/1.1 301 Moved Permanently");
header("Location: ${SITE}/resetpwd/"); exit(); header("Location: ${SITE}/resetpwd/"); exit();
} }
} }
@@ -138,8 +138,8 @@ function mybooks_kuri($category = 'gazeta', $filter = 'all', $page = 1){
if ($category == 'gazeta') if ($category == 'gazeta')
$category_id = 1; $category_id = 1;
elseif ($category == 'books') elseif ($category == 'books')
$category_id = 3; $category_id = 3;
$limit = 25; $limit = 25;
$client = api_client_kuri($login['clienthash']); $client = api_client_kuri($login['clienthash']);
$baseurl = SITE.'mybooks/'.$category.'/'.$filter.'/'; $baseurl = SITE.'mybooks/'.$category.'/'.$filter.'/';
@@ -152,7 +152,7 @@ function mybooks_kuri($category = 'gazeta', $filter = 'all', $page = 1){
$items = clientbuys_kuri($client['clientmail'], $page, $category_id, $client['clientgroup_id'], $filter); $items = clientbuys_kuri($client['clientmail'], $page, $category_id, $client['clientgroup_id'], $filter);
$count = $items['count']; $count = $items['count'];
if ($count > $limit){ if ($count > $limit){
$pages = ceil($count / $limit); $pages = ceil($count / $limit);
} }
@@ -161,19 +161,19 @@ function mybooks_kuri($category = 'gazeta', $filter = 'all', $page = 1){
$title = "Моя библиотека - страница $page"; $title = "Моя библиотека - страница $page";
$prevpage = $page - 1 ; $prevpage = $page - 1 ;
$prevurl = $baseurl.$prevpage; $prevurl = $baseurl.$prevpage;
} }
else { else {
$title = "Моя библиотека"; $title = "Моя библиотека";
} }
if ($pages > $page){ if ($pages > $page){
$nextpage = $page + 1; $nextpage = $page + 1;
$nexturl = $baseurl.$nextpage; $nexturl = $baseurl.$nextpage;
$endurl = $baseurl.$pages; $endurl = $baseurl.$pages;
} }
$tempcontent = VIEWPATH.'allbooks.phtml'; $tempcontent = VIEWPATH.'allbooks.phtml';
include VIEWPATH.'layout.phtml'; include VIEWPATH.'layout.phtml';
@@ -183,16 +183,18 @@ function mybooks_kuri($category = 'gazeta', $filter = 'all', $page = 1){
function form_kuri(){ function form_kuri(){
$type='form';
$checklogin = check_login_kuri(); $checklogin = check_login_kuri();
$title = "Бесплатные юридические консультации";
if ($checklogin['error'] == 'client not found'){ if ($checklogin['error'] == 'client not found'){
login_kuri(); login_kuri();
} }
else { else {
$tempcontent = VIEWPATH.'form.phtml'; $tempcontent = VIEWPATH.'form.phtml';
include VIEWPATH.'layout.phtml'; include VIEWPATH.'layout.phtml';
} }
} }
@@ -210,18 +212,18 @@ function payments_kuri($filter = 1 ){
} }
$paysql = " $paysql = "
SELECT SELECT
buy_id, date, anbuy.price AS price, buy_status, pricename, category_id, pricehash buy_id, date, anbuy.price AS price, buy_status, pricename, category_id, pricehash
FROM FROM
anbuy anbuy
LEFT JOIN price ON LEFT JOIN price ON
anbuy.number_id = price.price_id anbuy.number_id = price.price_id
WHERE WHERE
client_id = {$login['client_id']} client_id = {$login['client_id']}
AND AND
buy_status = $filter buy_status = $filter
ORDER BY ORDER BY
buy_id DESC buy_id DESC
"; ";
$payments = db_get($paysql); $payments = db_get($paysql);

View File

@@ -8,8 +8,8 @@
<li><a href="<?=SITE?>mybooks/gazeta/all/1">Газета</a></li> <li><a href="<?=SITE?>mybooks/gazeta/all/1">Газета</a></li>
<li class="active">Книги</li> <li class="active">Книги</li>
<?endif?> <?endif?>
</ul> </ul>
</div> </div>
<?if ($items['subscript'] == true):?> <?if ($items['subscript'] == true):?>
<div class="small-mob-hidden"><p>Вам доступен весь архив</p></div> <div class="small-mob-hidden"><p>Вам доступен весь архив</p></div>
@@ -25,15 +25,19 @@
<?for ($y = date('Y'); $y >= 2006; $y--):?> <?for ($y = date('Y'); $y >= 2006; $y--):?>
<?$selected = ($filter == $y) ? ' selected' : ''?> <?$selected = ($filter == $y) ? ' selected' : ''?>
<option value="<?=$y?>"<?=$selected?>><?=$y?> год</option> <option value="<?=$y?>"<?=$selected?>><?=$y?> год</option>
<?endfor?> <?endfor?>
</select> </select>
<i class="fas fa-chevron-down"></i> <i class="fas fa-chevron-down"></i>
</p> </p>
</div> </div>
<?endif?> <?endif?>
<div> <div>
<a href="<?=SITE?>payments">Мои покупки</a> <a href="<?=SITE?>payments">Мои покупки</a>
</div> </div>
<div class="hid460">
<a href="<?=SITE?>form">Консультации</a>
</div>
</div> </div>
@@ -46,7 +50,7 @@
<img src="<?=$book['pic']?>"> <img src="<?=$book['pic']?>">
<p class="book_mini_title"><?=$book['pricename']?></p> <p class="book_mini_title"><?=$book['pricename']?></p>
<p>Читать</p> <p>Читать</p>
</a> </a>
</div> </div>
</div> </div>
<?endforeach?> <?endforeach?>

View File

@@ -5,13 +5,13 @@
<script src="/pub/scripts/pdf.min.js"></script> <script src="/pub/scripts/pdf.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mobile-detect/1.4.4/mobile-detect.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/mobile-detect/1.4.4/mobile-detect.min.js"></script>
<script src="/pub/scripts/klanviewer.js?ver=34"></script> <script src="/pub/scripts/klanviewer.js?ver=34"></script>
<link rel="stylesheet" type="text/css" href="/pub/css/an.css?ver=218"> <link rel="stylesheet" type="text/css" href="/pub/css/an.css?ver=228">
<link rel="icon" type="image/ico" href="https://argumenti.ru/favicon.ico"> <link rel="icon" type="image/ico" href="https://argumenti.ru/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/pub/fontawesome/css/all.css"> <link rel="stylesheet" href="/pub/fontawesome/css/all.css">
<link rel="stylesheet" href="/pub/fontawesome/css/v4-shims.css"> <link rel="stylesheet" href="/pub/fontawesome/css/v4-shims.css">
</head> </head>
<body> <body>
<!-- Rating Mail.ru counter --> <!-- Rating Mail.ru counter -->
@@ -60,12 +60,14 @@ _tmr.push({id: "1069168", type: "pageView", start: (new Date()).getTime()});
<li class="mob-full"> <li class="mob-full">
<img id="logo" alt="Аргументы Недели (argumenti.ru)" src="https://argumenti.ru/images/argumenti/AN2.gif"> <img id="logo" alt="Аргументы Недели (argumenti.ru)" src="https://argumenti.ru/images/argumenti/AN2.gif">
</li> </li>
<li class="mob-hidden"> <?//if ($type !== 'form'):?>
<i style="float:left" class="fas fa-arrow-right"></i> <li class="mob-hidden">
</li> <i style="float:left" class="fas fa-arrow-right"></i>
<li class="header-div<?if ($type == 'mybooks'):?> mob-hidden<?endif?>"> </li>
<a href="<?=SITE?>mybooks">Моя библиотека</a> <li class="header-div<?if ($type == 'mybooks'):?> mob-hidden<?endif?>">
</li> <a href="<?=SITE?>mybooks">Моя библиотека</a>
</li>
<?//endif?>
<?if (isset($author) and $author !== ''):?> <?if (isset($author) and $author !== ''):?>
<li> <li>
<i style="float:left" class="fas fa-arrow-right"></i> <i style="float:left" class="fas fa-arrow-right"></i>
@@ -81,7 +83,7 @@ _tmr.push({id: "1069168", type: "pageView", start: (new Date()).getTime()});
<li class="header-div"> <li class="header-div">
<a id="page_title" href="<?=$baseurl?>"><?=$title?></a> <a id="page_title" href="<?=$baseurl?>"><?=$title?></a>
</li> </li>
<?endif?> <?endif?>
</ul> </ul>
<?include('blocks/auth.phtml')?> <?include('blocks/auth.phtml')?>
@@ -109,7 +111,7 @@ _tmr.push({id: "1069168", type: "pageView", start: (new Date()).getTime()});
})(this, this.document, "yandexContextAsyncCallbacks"); })(this, this.document, "yandexContextAsyncCallbacks");
</script> </script>
</div> </div>
<?endif?> <?endif?>
<?if (isset($tempcontent)) <?if (isset($tempcontent))
include($tempcontent); include($tempcontent);
?> ?>
@@ -136,4 +138,4 @@ _tmr.push({id: "1069168", type: "pageView", start: (new Date()).getTime()});
<?endif?> <?endif?>
</body> </body>
</html> </html>