Файл: public_html/page/link.php
Строк: 529
<?php
if (!defined('BASE_DIR')) { exit(header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found', true)); }
$obEngine->addTitleHtml('Размещение ссылки');
if (isset($_GET['mode']) && $_GET['mode'] == 'preview')
{
switch ($_GET['mode'])
{
case 'preview':
if (isset($_GET['id']))
{
$id = isset($_GET['id']) ? (int)$_GET['id'] : 0;
$query = $mysqli->query("SELECT * FROM `".PREFIX."_blocks` WHERE `type` = '1' and `id` = '".$id."' LIMIT 1");
if ($query->num_rows)
{
$res = $query->fetch_assoc();
}
else
{
exit(header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found', true));
}
if (isset($_POST['url']))
{
$url = filter_var($_POST['url'], FILTER_VALIDATE_URL);
if (!$url)
{
exit(header('Location: /link.php?id='.$id));
}
$text = filter_var($_POST['text'], FILTER_SANITIZE_STRING);
if (!$text || mb_strlen($text) > $res['dlinlink'])
{
exit(header('Location: /link.php?id='.$id));
}
$color = filter_var($_POST['scolor'], FILTER_SANITIZE_STRING);
$specc = isset($_POST['specc']) && $_POST['specc'] == 1 ? 1 : 0;
$price = 0;
if ($specc) $price += $res['sumcolor'];
$price += $res['sum'];
$comm = sprintf("%.2f", ($price*$obEngine->getConfig('comm_pay'))/100);
$user_id = isset($_SESSION['user_id']) ? $_SESSION['user_id'] : session_id();
$data = array('ids' => $id.'_', 'url' => $url, 'text' => $text, 'color' => $color, 'specc' => $specc);
$data = serialize($data);
$query = $mysqli->query("SELECT `id` FROM `".PREFIX."_history_pay` WHERE `user_id` = '".$user_id."' and `status` = '0' and `type` = '2' LIMIT 1");
if ($query->num_rows)
{
$res_zakaz = $query->fetch_assoc();
$id_zakaz = $res_zakaz['id'];
$mysqli->query("UPDATE `".PREFIX."_history_pay` SET `time_add` = NOW(), `price` = '".$price."', `money` = '".($price+$comm)."', `data` = '".$data."' WHERE `id` = '".$id_zakaz."' and `user_id` = '".$user_id."' and `status` = '0' and `type` = '2' LIMIT 1");
}
else
{
$mysqli->query("INSERT INTO `".PREFIX."_history_pay`
(
`time_add`,
`user_id`,
`type`,
`payment`,
`price`,
`money`,
`wallet`,
`data`,
`status`
)
VALUES
(
NOW(),
'".$user_id."',
'2',
'',
'".$price."',
'".($price+$comm)."',
'',
'".$data."',
'0'
)");
$id_zakaz = $mysqli->insert_id();
}
$desc = base64_encode('Размещение ссылки на сайте '.$res['url']);
$arHash = array(ID_SHOP_PAYEER, $id_zakaz, sprintf("%.2f", ($price+$comm)), 'RUB', $desc, SECRET_KEY_PAYEER);
$sign = strtoupper(hash('sha256', implode(':', $arHash)));
?>
<div class="wrapper">
<div class="main">
<div class="m_left">
<div class="m_title">Размещение ссылки</div>
<div class="m_l">Текст ссылки: <b><?php echo $text; ?></b></div>
<div class="m_l">Адрес ссылки: <b><?php echo $url; ?></b></div>
<div class="m_l">Результат: <a <?php echo $color_link = $specc == 1 ? 'style="color:'.$color.';"' : ''; ?> href="<?php echo $url; ?>" target="_blank"><b><?php echo $text; ?></b></a></div>
<div class="m_l">
<form method="post" action="?id=<?php echo $id; ?>">
<input type="hidden" name="id" value="<?php echo $id; ?>">
<input type="hidden" name="url" value="<?php echo $url; ?>">
<input type="hidden" name="text" value="<?php echo $text; ?>">
<input type="hidden" name="scolor" value="<?php echo $color; ?>">
<input type="hidden" name="specc" value="<?php echo $specc; ?>">
<button type="submit">Редактировать</button>
</form>
</div>
<div class="m_l">Сумма к оплате: <b><?php echo $price; ?></b> руб.</div>
<div class="m_l">Выберите способ оплаты:</div>
<div class="pay_btn">
<form name="form2" method="post" action="https://merchant.webmoney.ru/lmi/payment.asp">
<input type="hidden" name="LMI_PAYMENT_AMOUNT" value="<?php echo ($price+$comm); ?>">
<input type="hidden" name="LMI_PAYMENT_DESC_BASE64" value="<?php echo $desc; ?>">
<input type="hidden" name="LMI_PAYEE_PURSE" value="<?php echo WMR; ?>">
<input type="hidden" name="LMI_PAYMENT_NO" value="<?php echo $id_zakaz; ?>" />
<input class="wmoney" type="submit" value="Webmoney"><span class="comment">(+<b><?php echo $comm; ?></b> руб. комиссия)</span>
</form>
</div>
<div class="pay_btn">
<form method="GET" action="https://payeer.com/merchant/">
<input type="hidden" name="m_shop" value="<?php echo ID_SHOP_PAYEER; ?>">
<input type="hidden" name="m_orderid" value="<?php echo $id_zakaz; ?>">
<input type="hidden" name="m_amount" value="<?php echo sprintf("%.2f", ($price+$comm)); ?>">
<input type="hidden" name="m_curr" value="RUB">
<input type="hidden" name="m_desc" value="<?php echo $desc; ?>">
<input type="hidden" name="m_sign" value="<?php echo $sign; ?>">
<input type="hidden" name="form[ps]" value="2609">
<input type="hidden" name="form[curr[2609]]" value="RUB">
<input type="submit" class="wmoney" name="m_process" value="Payeer" /><span class="comment">(+<b><?php echo $comm; ?></b> руб. комиссия)</span>
</form>
</div>
<?php
if (isset($_SESSION['user_id']) && $users_info['status'] == 1)
{
?>
<div class="pay_btn">
<form name="form4" method="post" action="result.php" onsubmit="return validate4();">
<input type="hidden" name="sign" value="<?php echo $sign; ?>">
<input type="hidden" name="merchant" value="directpay">
<input type="hidden" name="service" value="link">
<input type="hidden" name="id_zakaz" value="<?php echo $id_zakaz; ?>">
<input type="hidden" name="id" value="<?php echo $id; ?>_">
<input type="hidden" name="url" value="<?php echo $url; ?>">
<input type="hidden" name="text" value="<?php echo $text; ?>">
<input type="hidden" name="scolor" value="<?php echo $color; ?>">
<input type="hidden" name="specc" value="<?php echo $specc; ?>">
<input type="hidden" name="buyer" value="<?php echo $users_info['login']; ?>">
<input type="hidden" name="price" value="<?php echo $price; ?>_">
<input type="hidden" name="auth" value="1">
<input type="hidden" name="sum" value="<?php echo $price; ?>">
<input type="hidden" name="sum_balance" value="<?php echo $users_info['money']; ?>">
<input class="bsistem" type="submit" value="Баланс системы"><span class="comment">(без комиссии)</span>
</form>
</div>
<?php
}
?>
</div>
<?php include 'module/user_menu.php'; ?>
</div>
</div>
<?php
}
else
{
exit(header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found', true));
}
}
else
{
if (isset($_POST['ids']))
{
$post_id = explode("_", $_POST['ids']);
$specc = isset($_POST['specc']) && $_POST['specc'] == 1 ? 1 : 0;
$place = 0;
$price = 0;
$prices = '';
$ids = '';
foreach ($post_id as $key => $value)
{
$id = (int)$value;
$query = $mysqli->query("SELECT `sum`, `sumcolor` FROM `".PREFIX."_blocks` WHERE `type` = '1' and `id` = '".$id."' LIMIT 1");
if ($query->num_rows)
{
$res = $query->fetch_assoc();
$prices .= $specc ? ($res['sum'] + $res['sumcolor']).'_' : $res['sum'].'_';
$price += $specc ? ($res['sum'] + $res['sumcolor']) : $res['sum'];
$place++;
$ids .= $id.'_';
}
}
$url = filter_var($_POST['url'], FILTER_VALIDATE_URL);
if (!$url)
{
exit(header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found', true));
}
$text = filter_var($_POST['text'], FILTER_SANITIZE_STRING);
if (!$text)
{
exit(header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found', true));
}
$color = filter_var($_POST['scolor'], FILTER_SANITIZE_STRING);
if ($specc && !isValidColor($color))
{
exit(header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found', true));
}
$comm = sprintf("%.2f", ($price*$obEngine->getConfig('comm_pay'))/100);
$user_id = isset($_SESSION['user_id']) ? $_SESSION['user_id'] : session_id();
$data = array('ids' => $ids, 'url' => $url, 'text' => $text, 'color' => $color, 'specc' => $specc);
$data = serialize($data);
$query = $mysqli->query("SELECT `id` FROM `".PREFIX."_history_pay` WHERE `user_id` = '".$user_id."' and `status` = '0' and `type` = '2' LIMIT 1");
if ($query->num_rows)
{
$res_zakaz = $query->fetch_assoc();
$id_zakaz = $res_zakaz['id'];
$mysqli->query("UPDATE `".PREFIX."_history_pay` SET `time_add` = NOW(), `price` = '".$price."', `money` = '".($price+$comm)."', `data` = '".$data."' WHERE `id` = '".$id_zakaz."' and `user_id` = '".$user_id."' and `status` = '0' and `type` = '2' LIMIT 1");
}
else
{
$mysqli->query("INSERT INTO `".PREFIX."_history_pay`
(
`time_add`,
`user_id`,
`type`,
`payment`,
`price`,
`money`,
`wallet`,
`data`,
`status`
)
VALUES
(
NOW(),
'".$user_id."',
'2',
'',
'".$price."',
'".($price+$comm)."',
'',
'".$data."',
'0'
)");
$id_zakaz = $mysqli->insert_id();
}
$desc = base64_encode('Размещение ссылок через сервис '.$_SERVER['HTTP_HOST']);
$arHash = array(ID_SHOP_PAYEER, $id_zakaz, sprintf("%.2f", ($price+$comm)), 'RUB', $desc, SECRET_KEY_PAYEER);
$sign = strtoupper(hash('sha256', implode(':', $arHash)));
?>
<div class="wrapper">
<div class="main">
<div class="m_left">
<div class="m_title">Размещение ссылки</div>
<div class="m_l">Текст ссылки: <b><?php echo $text; ?></b></div>
<div class="m_l">Адрес ссылки: <b><?php echo $url; ?></b></div>
<div class="m_l">Результат: <a <?php echo $color_link = $specc == 1 ? 'style="color:'.$color.';"' : ''; ?> href="<?php echo $url; ?>" target="_blank"><b><?php echo $text; ?></b></a></div>
<div class="m_l">
<form action="advertise.php" method="post">
<input name="type" type="hidden" value="back">
<input name="url" type="hidden" value="<?php echo $url; ?>">
<input name="text" type="hidden" value="<?php echo $text; ?>">
<button type="submit">Вернуться к поиску</button>
</form>
</div>
<div class="m_l">Выбрано витрин: <b><?php echo $place; ?></b></div>
<div class="m_l">Сумма к оплате: <b><?php echo $price; ?></b> руб.</div>
<div class="m_l">Выберите способ оплаты:</div>
<div class="pay_btn">
<form name="form2" method="post" action="https://merchant.webmoney.ru/lmi/payment.asp">
<input type="hidden" name="LMI_PAYMENT_AMOUNT" value="<?php echo ($price+$comm); ?>">
<input type="hidden" name="LMI_PAYMENT_DESC_BASE64" value="<?php echo $desc; ?>">
<input type="hidden" name="LMI_PAYEE_PURSE" value="<?php echo WMR; ?>">
<input type="hidden" name="LMI_PAYMENT_NO" value="<?php echo $id_zakaz; ?>" />
<input class="wmoney" type="submit" value="Webmoney"><span class="comment">(+<b><?php echo $comm; ?></b> руб. комиссия)</span>
</form>
</div>
<div class="pay_btn">
<form method="GET" action="https://payeer.com/merchant/">
<input type="hidden" name="m_shop" value="<?php echo ID_SHOP_PAYEER; ?>">
<input type="hidden" name="m_orderid" value="<?php echo $id_zakaz; ?>">
<input type="hidden" name="m_amount" value="<?php echo sprintf("%.2f", ($price+$comm)); ?>">
<input type="hidden" name="m_curr" value="RUB">
<input type="hidden" name="m_desc" value="<?php echo $desc; ?>">
<input type="hidden" name="m_sign" value="<?php echo $sign; ?>">
<input type="hidden" name="form[ps]" value="2609">
<input type="hidden" name="form[curr[2609]]" value="RUB">
<input type="submit" class="wmoney" name="m_process" value="Payeer" /><span class="comment">(+<b><?php echo $comm; ?></b> руб. комиссия)</span>
</form>
</div>
<?php
if (isset($_SESSION['user_id']) && $users_info['status'] == 1)
{
?>
<div class="pay_btn">
<form name="form4" method="post" action="result.php" onsubmit="return validate4 ( );">
<?php $sign = md5('link'.$ids.$url.$text.$specc.$color.$_SESSION['user_id'].$prices.HASH_MD5); ?>
<input type="hidden" name="sign" value="<?php echo $sign; ?>">
<input type="hidden" name="merchant" value="directpay">
<input type="hidden" name="service" value="link">
<input type="hidden" name="id_zakaz" value="<?php echo $id_zakaz; ?>">
<input type="hidden" name="id" value="<?php echo $ids; ?>">
<input type="hidden" name="url" value="<?php echo $url; ?>">
<input type="hidden" name="text" value="<?php echo $text; ?>">
<input type="hidden" name="scolor" value="<?php echo $color; ?>">
<input type="hidden" name="specc" value="<?php echo $specc; ?>">
<input type="hidden" name="buyer" value="<?php echo $users_info['login']; ?>">
<input type="hidden" name="price" value="<?php echo $prices; ?>">
<input type="hidden" name="auth" value="1">
<input type="hidden" name="sum" value="<?php echo $price; ?>">
<input type="hidden" name="sum_balance" value="<?php echo $users_info['money']; ?>">
<input class="bsistem" type="submit" value="Баланс системы"><span class="comment">(без комиссии)</span>
</form>
</div>
<?php
}
?>
</div>
<?php include 'module/user_menu.php'; ?>
</div>
</div>
<?php
}
else
{
exit(header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found', true));
}
}
break;
case 'delete':
break;
default:
exit(header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found', true));
break;
}
}
else
{
$id = isset($_GET['id']) ? (int)$_GET['id'] : 0;
$query = $mysqli->query("SELECT * FROM `".PREFIX."_blocks` WHERE `type` = '1' and `id` = '".$id."'");
if ($query->num_rows)
{
$res = $query->fetch_assoc();
$stats = json_decode($res['stats'], true);
$arr_topic = $obEngine->getConfig('topic');
}
else
{
exit(header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found', true));
}
$n = 0;
$d = '';
while($d != date("Y-m-d", strtotime($res['time_add']) - (27*86400)))
{
$d = date("Y-m-d", TIME - ($n * 86400));
if (!isset($stats[$d]))
{
$stats[$d]['view'] = 0;
$stats[$d]['user'] = 0;
}
//$arr_day[] = (date("Y-m-d", TIME) != $d) ? '"'.strftime("%b, %d", TIME - ($n * 86400)).'"' : '"Сегодня"';
$n++;
}
?>
<div class="wrapper">
<script src="/js/highcharts.js"></script>
<div class="main">
<div class="m_left">
<div class="m_title">Размещение ссылки</div>
<div class="m_img"><img style="border:1px solid #717171;" src="http://mini.s-shot.ru/1200x800/270/jpeg/z100/?<?php echo $res['url']; ?>" /></div>
<div class="m_r_info">
<table align="left" border="0" cellspacing="0" cellpadding="0" class="buy_table deal_table">
<tbody>
<tr><td class="deal_title" width="105">Адрес:</td><td colspan="3" class="deal_mid"><a href=<?php echo $res['url']; ?>><?php echo $res['url']; ?></a></td></tr>
<tr><td class="deal_title" width="105">Тематика:</td><td colspan="3" class="deal_mid"><?php echo $arr_topic[$res['topic']]; ?></td></tr>
<tr><td class="deal_title">Яндекс тИЦ:</td><td colspan="3" class="deal_mid"><?php echo $res['tic']; ?></td></tr>
<tr><td class="deal_title">Google PR:</td><td colspan="3" class="deal_mid"><?php echo $res['pr']; ?></td></tr>
<tr><td class="deal_title">Ссылок в блоке:</td><td colspan="3" class="deal_mid"><?php echo $res['slots']; ?> <?php echo getWord($res['slots'], array('последняя', 'последних', 'последних')); ?></td></tr>
<tr><td class="deal_title" style="background: #5ca300; border: 1px solid #5ca300;">Цена:</td><td colspan="3" class="deal_mid"><?php echo $res['sum']; ?> <?php echo getWord($res['sum'], array('рубль', 'рубля', 'рублей')); ?></td></tr>
</tbody>
</table>
</div>
<div class="m_text" style="text-align: justify; word-wrap: break-word;"><b>Описание сайта:</b><br><?php echo $res['text']; ?></div>
<div id="container" style="width: 644px; height: 200px; margin: 0 auto;float:left;padding: 18px 0 0 0;background:#fff;"></div>
<script>
$(function ()
{
$("#container").highcharts(
{
chart:
{
type: "areaspline"
},
title:
{
text: ""
},
legend:
{
layout: "vertical",
align: "left",
verticalAlign: "top",
x: 60,
y: 5,
floating: true,
borderWidth: 1,
backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || "#FFFFFF"
},
xAxis:
{
categories:
[
"<?php echo strftime("%b, %d", TIME - (27 * 86400)); ?>","<?php echo strftime("%b, %d", TIME - (26 * 86400)); ?>","<?php echo strftime("%b, %d", TIME - (25 * 86400)); ?>","<?php echo strftime("%b, %d", TIME - (24 * 86400)); ?>","<?php echo strftime("%b, %d", TIME - (23 * 86400)); ?>","<?php echo strftime("%b, %d", TIME - (22 * 86400)); ?>","<?php echo strftime("%b, %d", TIME - (21 * 86400)); ?>","<?php echo strftime("%b, %d", TIME - (20 * 86400)); ?>","<?php echo strftime("%b, %d", TIME - (19 * 86400)); ?>","<?php echo strftime("%b, %d", TIME - (18 * 86400)); ?>","<?php echo strftime("%b, %d", TIME - (17 * 86400)); ?>","<?php echo strftime("%b, %d", TIME - (16 * 86400)); ?>","<?php echo strftime("%b, %d", TIME - (15 * 86400)); ?>","<?php echo strftime("%b, %d", TIME - (14 * 86400)); ?>","<?php echo strftime("%b, %d", TIME - (13 * 86400)); ?>","<?php echo strftime("%b, %d", TIME - (12 * 86400)); ?>","<?php echo strftime("%b, %d", TIME - (11 * 86400)); ?>","<?php echo strftime("%b, %d", TIME - (10 * 86400)); ?>","<?php echo strftime("%b, %d", TIME - (9 * 86400)); ?>","<?php echo strftime("%b, %d", TIME - (8 * 86400)); ?>","<?php echo strftime("%b, %d", TIME - (7 * 86400)); ?>","<?php echo strftime("%b, %d", TIME - (6 * 86400)); ?>","<?php echo strftime("%b, %d", TIME - (5 * 86400)); ?>","<?php echo strftime("%b, %d", TIME - (4 * 86400)); ?>","<?php echo strftime("%b, %d", TIME - (3 * 86400)); ?>","<?php echo strftime("%b, %d", TIME - (2 * 86400)); ?>","<?php echo strftime("%b, %d", TIME - (1 * 86400)); ?>", "Сегодня"
],
plotBands:
[{
from: -0.5,
to: 10.5,
color: "rgba(64, 74, 86, .03)"
}]
},
yAxis:
{
title:
{
text: ""
}
},
tooltip:
{
shared: true,
},
credits:
{
enabled: false
},
plotOptions:
{
areaspline:
{
fillOpacity: 0.5
}
},
series:
[{
name: "Просмотры",
data: [<?php echo $stats[date("Y-m-d", TIME - (27*86400))]['view']; ?>,<?php echo $stats[date("Y-m-d", TIME - (26*86400))]['view']; ?>,<?php echo $stats[date("Y-m-d", TIME - (25*86400))]['view']; ?>,<?php echo $stats[date("Y-m-d", TIME - (24*86400))]['view']; ?>,<?php echo $stats[date("Y-m-d", TIME - (23*86400))]['view']; ?>,<?php echo $stats[date("Y-m-d", TIME - (22*86400))]['view']; ?>,<?php echo $stats[date("Y-m-d", TIME - (21*86400))]['view']; ?>,<?php echo $stats[date("Y-m-d", TIME - (20*86400))]['view']; ?>,<?php echo $stats[date("Y-m-d", TIME - (19*86400))]['view']; ?>,<?php echo $stats[date("Y-m-d", TIME - (18*86400))]['view']; ?>,<?php echo $stats[date("Y-m-d", TIME - (17*86400))]['view']; ?>,<?php echo $stats[date("Y-m-d", TIME - (16*86400))]['view']; ?>,<?php echo $stats[date("Y-m-d", TIME - (15*86400))]['view']; ?>,<?php echo $stats[date("Y-m-d", TIME - (14*86400))]['view']; ?>,<?php echo $stats[date("Y-m-d", TIME - (13*86400))]['view']; ?>,<?php echo $stats[date("Y-m-d", TIME - (12*86400))]['view']; ?>,<?php echo $stats[date("Y-m-d", TIME - (11*86400))]['view']; ?>,<?php echo $stats[date("Y-m-d", TIME - (10*86400))]['view']; ?>,<?php echo $stats[date("Y-m-d", TIME - (9*86400))]['view']; ?>,<?php echo $stats[date("Y-m-d", TIME - (8*86400))]['view']; ?>,<?php echo $stats[date("Y-m-d", TIME - (7*86400))]['view']; ?>,<?php echo $stats[date("Y-m-d", TIME - (6*86400))]['view']; ?>,<?php echo $stats[date("Y-m-d", TIME - (5*86400))]['view']; ?>,<?php echo $stats[date("Y-m-d", TIME - (4*86400))]['view']; ?>,<?php echo $stats[date("Y-m-d", TIME - (3*86400))]['view']; ?>,<?php echo $stats[date("Y-m-d", TIME - (2*86400))]['view']; ?>,<?php echo $stats[date("Y-m-d", TIME - (1*86400))]['view']; ?>,<?php echo $stats[date("Y-m-d", TIME)]['view']; ?>], color: "#e2e1e5"
},
{
name: "Посетители",
data: [<?php echo $stats[date("Y-m-d", TIME - (27*86400))]['user']; ?>,<?php echo $stats[date("Y-m-d", TIME - (26*86400))]['user']; ?>,<?php echo $stats[date("Y-m-d", TIME - (25*86400))]['user']; ?>,<?php echo $stats[date("Y-m-d", TIME - (24*86400))]['user']; ?>,<?php echo $stats[date("Y-m-d", TIME - (23*86400))]['user']; ?>,<?php echo $stats[date("Y-m-d", TIME - (22*86400))]['user']; ?>,<?php echo $stats[date("Y-m-d", TIME - (21*86400))]['user']; ?>,<?php echo $stats[date("Y-m-d", TIME - (20*86400))]['user']; ?>,<?php echo $stats[date("Y-m-d", TIME - (19*86400))]['user']; ?>,<?php echo $stats[date("Y-m-d", TIME - (18*86400))]['user']; ?>,<?php echo $stats[date("Y-m-d", TIME - (17*86400))]['user']; ?>,<?php echo $stats[date("Y-m-d", TIME - (16*86400))]['user']; ?>,<?php echo $stats[date("Y-m-d", TIME - (15*86400))]['user']; ?>,<?php echo $stats[date("Y-m-d", TIME - (14*86400))]['user']; ?>,<?php echo $stats[date("Y-m-d", TIME - (13*86400))]['user']; ?>,<?php echo $stats[date("Y-m-d", TIME - (12*86400))]['view']; ?>,<?php echo $stats[date("Y-m-d", TIME - (11*86400))]['user']; ?>,<?php echo $stats[date("Y-m-d", TIME - (10*86400))]['user']; ?>,<?php echo $stats[date("Y-m-d", TIME - (9*86400))]['user']; ?>,<?php echo $stats[date("Y-m-d", TIME - (8*86400))]['user']; ?>,<?php echo $stats[date("Y-m-d", TIME - (7*86400))]['user']; ?>,<?php echo $stats[date("Y-m-d", TIME - (6*86400))]['user']; ?>,<?php echo $stats[date("Y-m-d", TIME - (5*86400))]['user']; ?>,<?php echo $stats[date("Y-m-d", TIME - (4*86400))]['user']; ?>,<?php echo $stats[date("Y-m-d", TIME - (3*86400))]['user']; ?>,<?php echo $stats[date("Y-m-d", TIME - (2*86400))]['user']; ?>,<?php echo $stats[date("Y-m-d", TIME - (1*86400))]['user']; ?>,<?php echo $stats[date("Y-m-d", TIME)]['user']; ?>], color: "#0092a3"
}]
});
});
</script>
<div class="m_form">
<form name="form1" method="post" action="?mode=preview&id=<?php echo $id; ?>" onsubmit="return validate1();">
<div class="m_l">
<div class="m_name">Адрес ссылки: </div>
<div class="m_pole"><input type="text" id="url" name="url" class="tt" placeholder="http://website.ru" value="<?php echo $url = isset($_POST['url']) ? filter_var($_POST['url'], FILTER_SANITIZE_STRING) : ''; ?>" maxlength="255"></div>
</div>
<div class="m_l">
<div class="m_name">Текст ссылки: </div>
<div class="m_pole"><input type="text" id="text" name="text" class="tt" placeholder="Пример рекламной ссылки" value="<?php echo $text = isset($_POST['text']) ? filter_var($_POST['text'], FILTER_SANITIZE_STRING) : ''; ?>" maxlength="<?php echo $res['dlinlink']; ?>"/>
<br />
<span style="color:#888">(максимум <?php echo $res['dlinlink']; ?> символов)</span></div>
</div>
<?php
if ($res['red'] == 1 || $res['green'] == 1 || $res['blue'] == 1 || $res['orange'] == 1 || $res['other'] == 1)
{
?>
<div class="m_l">
<table cellpadding="0" cellspacing="0">
<tr>
<td width="444" height="24">
<label><span><b>Выделить ссылку другим цветом</b></span> (+<span style="color: red;"><b><?php echo $res['sumcolor']; ?></b> руб.</span>): </label><input type="checkbox" <?php echo $specc = isset($_POST['specc']) && $_POST['specc'] == 1 ? 'checked' : ''; ?> id="premium" value="1" name="specc"></div>
</td>
<td width="50">
<span class="premium"><b>Цвет:</b></span>
</td>
<td>
<select class="premium" size="1" name="scolor" id="color" style="width:150px;">
<?php if ($res['red'] == 1) { ?><option value="red" <?php echo $color = isset($_POST['color']) && $_POST['color'] == 'red' ? 'selected' : ''; ?> style="color:red;">Красный</option><?php } ?>
<?php if ($res['green'] == 1) { ?><option value="green" <?php echo $color = isset($_POST['color']) && $_POST['color'] == 'green' ? 'selected' : ''; ?> style="color: green;">Зеленый</option><?php } ?>
<?php if ($res['blue'] == 1) { ?><option value="blue" <?php echo $color = isset($_POST['color']) && $_POST['color'] == 'blue' ? 'selected' : ''; ?> style="color:blue;">Синий</option><?php } ?>
<?php if ($res['orange'] == 1) { ?><option value="orange" <?php echo $color = isset($_POST['color']) && $_POST['color'] == 'orange' ? 'selected' : ''; ?> style="color:orange;">Оранжевый</option><?php } ?>
<?php if ($res['other'] == 1) { ?><option value="<?php echo $res['color']; ?>" <?php echo $color = isset($_POST['color']) && $_POST['color'] == $res['color'] ? 'selected' : ''; ?> style="color: <?php echo $res['color']; ?>;">Другой</option><?php } ?>
</select>
</td>
</tr>
</table>
</div>
<?php
}
?>
<div class="m_l">
<div class="m_urr"><a href="info.php?mode=terms" target="_blank">Условия размещения рекламы</a> </div>
<div class="m_btn"><button style="float:right;">Купить</button></div>
</div>
</form>
</div>
</div>
<?php include 'module/user_menu.php'; ?>
</div>
</div>
<?php
}
?>
<script>
function validate1()
{
valid = true;
if ((document.form1.url.value == "") && (document.form1.text.value == ""))
{
alert ('Не заполнены поля «Адрес ссылки» и «Текст ссылки»');
valid = false;
}
if ((document.form1.url.value == "") && (valid == true))
{
alert ('Не заполнено поле «Адрес ссылки»');
valid = false;
}
if ((document.form1.url.value == "http://website.ru") && (valid == true))
{
alert ('Следует указать адрес рекламируемого сайта вместо «website.ru»');
valid = false;
}
if ((document.form1.url.value.indexOf('http://') == -1) && (document.form1.url.value.indexOf('https://') == -1) && (valid == true))
{
alert ('Адрес ссылки должен начинаться с «http://» или «https://»');
valid = false;
}
if ((document.form1.text.value == "") && (valid == true))
{
alert ('Не заполнено поле «Текст ссылки»');
valid = false;
}
return valid;
}
function validate2()
{
valid = true;
if ((document.form2.url.value == "") && (document.form2.text.value == ""))
{
alert ('Не заполнены поля «Адрес ссылки» и «Текст ссылки»');
valid = false;
}
if ((document.form2.url.value == "") && (valid == true))
{
alert ('Не заполнено поле «Адрес ссылки»');
valid = false;
}
if ((document.form2.url.value == encodeURIComponent("http://website.ru")) && (valid == true))
{
alert ('Следует указать адрес рекламируемого сайта вместо «website.ru»');
valid = false;
}
if ((document.form2.url.value.indexOf('http://') == -1) && (document.form2.url.value.indexOf('https://') == -1) && (valid == true))
{
alert ('Адрес ссылки должен начинаться с «http://» или «https://»');
valid = false;
}
if ((document.form2.text.value == "") && (valid == true))
{
alert ('Не заполнено поле «Текст ссылки»');
valid = false;
}
return valid;
}
function validate3()
{
valid = true;
if ((document.form3.url.value == "") && (document.form3.text.value == ""))
{
alert ('Не заполнены поля «Адрес ссылки» и «Текст ссылки»');
valid = false;
}
if ((document.form3.url.value == "") && (valid == true))
{
alert ('Не заполнено поле «Адрес ссылки»');
valid = false;
}
if ((document.form3.url.value == encodeURIComponent("http://website.ru")) && (valid == true))
{
alert ('Следует указать адрес рекламируемого сайта вместо «website.ru»');
valid = false;
}
if ((document.form3.url.value.indexOf('http://') == -1) && (document.form3.url.value.indexOf('https://') == -1) && (valid == true))
{
alert ('Адрес ссылки должен начинаться с «http://» или «https://»');
valid = false;
}
if ((document.form3.text.value == "") && (valid == true))
{
alert ('Не заполенно поле «Текст ссылки»');
valid = false;
}
return valid;
}
function validate4 ( )
{
valid = true;
if ((document.form4.url.value == "") && (document.form4.text.value == ""))
{
alert ('Не заполнены поля «Адрес ссылки» и «Текст ссылки»');
valid = false;
}
if ((document.form4.url.value == "") && (valid == true))
{
alert ('Не заполнено поле «Адрес ссылки»');
valid = false;
}
if ((document.form4.url.value == encodeURIComponent("http://website.ru")) && (valid == true))
{
alert ('Следует указать адрес рекламируемого сайта вместо «website.ru»');
valid = false;
}
if ((document.form4.url.value.indexOf('http://') == -1) && (document.form4.url.value.indexOf('https://') == -1) && (valid == true))
{
console.log(document.form4.url.value);
alert ('Адрес ссылки должен начинаться с «http://» или «https://»');
valid = false;
}
if ((document.form4.text.value == "") && (valid == true))
{
alert ('Не заполнено поле «Текст ссылки»');
valid = false;
}
if ((document.form4.auth.value == 0) && (valid == true))
{
alert ('Для оплаты с баланса необходимо авторизоваться');
valid = false;
}
if ((document.form4.sum.value * 100 > document.form4.sum_balance.value * 100) && (valid == true))
{
alert ('На балансе недостаточно средств');
valid = false;
}
return valid;
}
function validate5 ( )
{
valid = true;
if ((document.form6.url.value == "") && (document.form6.text.value == ""))
{
alert ('Не заполнены поля «Адрес ссылки» и «Текст ссылки»');
valid = false;
}
if ((document.form6.url.value == "") && (valid == true))
{
alert ('Не заполнено поле «Адрес ссылки');
valid = false;
}
if ((document.form6.url.value == "http://website.ru") && (valid == true))
{
alert ('Следует указать адрес рекламируемого сайта вместо «website.ru»');
valid = false;
}
if ((document.form6.url.value.indexOf('http://') == -1) && (document.form6.url.value.indexOf('https://') == -1) && (valid == true))
{
alert ('Адрес ссылки должен начинаться с «http://» или «https://»');
valid = false;
}
if ((document.form6.text.value == "") && (valid == true))
{
alert ('Не заполнено поле «Текст ссылки»');
valid = false;
}
return valid;
}
$('#premium').click(function()
{
if ( $("#premium").prop("checked"))
$('.premium').show();
else
$('.premium').hide();
});
if ( $("#premium").prop("checked"))
$('.premium').show();
</script>