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

View File

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

View File

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

View File

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

View File

@@ -5,13 +5,13 @@
<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="/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">
<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/v4-shims.css">
</head>
<body>
<body>
<!-- Rating Mail.ru counter -->
@@ -60,12 +60,14 @@ _tmr.push({id: "1069168", type: "pageView", start: (new Date()).getTime()});
<li class="mob-full">
<img id="logo" alt="Аргументы Недели (argumenti.ru)" src="https://argumenti.ru/images/argumenti/AN2.gif">
</li>
<li class="mob-hidden">
<i style="float:left" class="fas fa-arrow-right"></i>
</li>
<li class="header-div<?if ($type == 'mybooks'):?> mob-hidden<?endif?>">
<a href="<?=SITE?>mybooks">Моя библиотека</a>
</li>
<?//if ($type !== 'form'):?>
<li class="mob-hidden">
<i style="float:left" class="fas fa-arrow-right"></i>
</li>
<li class="header-div<?if ($type == 'mybooks'):?> mob-hidden<?endif?>">
<a href="<?=SITE?>mybooks">Моя библиотека</a>
</li>
<?//endif?>
<?if (isset($author) and $author !== ''):?>
<li>
<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">
<a id="page_title" href="<?=$baseurl?>"><?=$title?></a>
</li>
<?endif?>
<?endif?>
</ul>
<?include('blocks/auth.phtml')?>
@@ -109,7 +111,7 @@ _tmr.push({id: "1069168", type: "pageView", start: (new Date()).getTime()});
})(this, this.document, "yandexContextAsyncCallbacks");
</script>
</div>
<?endif?>
<?endif?>
<?if (isset($tempcontent))
include($tempcontent);
?>
@@ -136,4 +138,4 @@ _tmr.push({id: "1069168", type: "pageView", start: (new Date()).getTime()});
<?endif?>
</body>
</html>
</html>