Файл: images/panel.php
Строк: 3930
<?php
//error_reporting(2047|2048);
error_reporting(0);
include 'config.php';
class_exists('config') or die('Error load config class');
$config = new config(1, 1, 1);
$lang = $config->parse_lang() or die('Error parse lang file');
if(isset($_GET['id'])) $id = intval($_GET['id']);
elseif(isset($_POST['id'])) $id = intval($_POST['id']);
else $id = false;
if(isset($_GET['ps'])) $ps = trim($_GET['ps']);
elseif(isset($_POST['ps'])) $ps = trim($_POST['ps']);
else $ps = false;
if(!$id || !$ps){
$config->start('error', $lang['1014'], 'center');
echo '<u>'.$lang['1025'].'</u><br/>'.
'<a href="index.php?l='.$config->lang.'&v='.$config->vers.'">'.$lang['1003'].'</a>';
$config->finish(true);
}
if(!$mysql = mysql_connect($config->mysql['host'], $config->mysql['user'], $config->mysql['pass'])){
$config->start('error', $lang['1014']);
if($config->vers == 'wml'){
print '<b>'.$lang['1014'].'! '.$lang['1010'].'</b><br/>';
}
else
if($config->vers == 'html'){
print '<font color="'.$config->color['error'].'">'.$lang['1014'].'! '.$lang['1010'].'</font><br/>';
}
print $lang['1015'].' MySQL: <u>'.mysql_error().'</u><br/>';
print '<a href="index.php?l='.$config->lang.'&v='.$config->vers.'">'.$lang['1003'].'</a>';
$config->finish(true);
}
if(!mysql_select_db($config->mysql['db'], $mysql)){
$config->start('error', $lang['1014']);
if($config->vers == 'wml'){
print '<b>'.$lang['1014'].'! '.$lang['1011'].'</b><br/>';
}
else
if($config->vers == 'html'){
print '<font color="'.$config->color['error'].'">'.$lang['1014'].'! '.$lang['1011'].'</font><br/>';
}
print $lang['1015'].' MySQL: <u>'.mysql_error().'</u><br/>';
print '<a href="index.php?l='.$config->lang.'&v='.$config->vers.'">'.$lang['1003'].'</a>';
mysql_close($mysql); $config->finish(true);
}
$q = mysql_query("SELECT `pass` FROM `users` WHERE `id` = '$id';", $mysql);
$q = mysql_fetch_array($q);
if(!$q || $q['pass'] != $ps){
$config->start('error', $lang['1014'], 'center');
echo '<u>'.$lang['1025'].'</u><br/>'.
'<a href="index.php?l='.$config->lang.'&v='.$config->vers.'">'.$lang['1003'].'</a>';
mysql_close($mysql); $config->finish(true);
}
if(isset($_GET['act'])) $act = $_GET['act'];
elseif(isset($_POST['act'])) $act = $_POST['act'];
else $act = false;
/******************************************************************************/
if($act == 'stat'){
$config->start('stat', $lang['1071']);
$q = mysql_query("SELECT `is1`, `is2`, `is3`, `ic1`, `ic2`, `ic3`, `it1`, `it2`, `it3`, `ms1`, `ms2`, `ms3`, `mc1`, `mc2`, `mc3`, `mt1`, `mt2`, `mt3`, `bank`, `credit` FROM `users` WHERE `id` = '$id';", $mysql);
$q = mysql_fetch_array($q);
if(!$q) $q = array('is1' => '0', 'is2' => '0', 'is3' => '0', 'ic1' => '0', 'ic2' => '0', 'ic3' => '0', 'it1' => '0', 'it2' => '0', 'it3' => '0', 'ms1' => '0', 'ms2' => '0', 'ms3' => '0', 'mc1' => '0', 'mc2' => '0', 'mc3' => '0', 'mt1' => '0', 'mt2' => '0', 'mt3' => '0', 'bank' => '0', 'credit' => '0');
if($config->vers == 'wml')
echo '<small>'.
$lang['1072'].': <b>'.$q['credit'].'</b><br/>'.
$lang['1073'].': <b>'.$q['bank'].'</b><br/><br/>'.
'<b>'.$lang['1074'].':</b><br/>'.
$lang['1076'].': <b>'.$q['is1'].'</b><br/>'.
$lang['1077'].': <b>'.$q['ic1'].'</b><br/>'.
$lang['1078'].': <b>'.$q['it1'].'</b><br/>'.
'<u>'.$lang['1079'].': <b>'.round($q['ic1']/$q['is1'], 3).'</b></u><br/>'.
$lang['1080'].': <b>'.$q['is2'].'</b><br/>'.
$lang['1081'].': <b>'.$q['ic2'].'</b><br/>'.
$lang['1082'].': <b>'.$q['it2'].'</b><br/>'.
'<u>'.$lang['1083'].': <b>'.round($q['ic2']/$q['is2'], 3).'</b></u><br/>'.
$lang['1084'].': <b>'.$q['is3'].'</b><br/>'.
$lang['1085'].': <b>'.$q['ic3'].'</b><br/>'.
$lang['1086'].': <b>'.$q['it3'].'</b><br/>'.
'<u>'.$lang['1087'].': <b>'.round($q['ic3']/$q['is3'], 3).'</b></u><br/><br/>'.
'<b>'.$lang['1075'].':</b><br/>'.
$lang['1076'].': <b>'.$q['ms1'].'</b><br/>'.
$lang['1077'].': <b>'.$q['mc1'].'</b><br/>'.
$lang['1078'].': <b>'.$q['mt1'].'</b><br/>'.
'<u>'.$lang['1079'].': <b>'.round($q['mc1']/$q['ms1'], 3).'</b></u><br/>'.
$lang['1080'].': <b>'.$q['ms2'].'</b><br/>'.
$lang['1081'].': <b>'.$q['mc2'].'</b><br/>'.
$lang['1082'].': <b>'.$q['mt2'].'</b><br/>'.
'<u>'.$lang['1083'].': <b>'.round($q['mc2']/$q['ms2'], 3).'</b></u><br/>'.
$lang['1084'].': <b>'.$q['ms3'].'</b><br/>'.
$lang['1085'].': <b>'.$q['mc3'].'</b><br/>'.
$lang['1086'].': <b>'.$q['mt3'].'</b><br/>'.
'<u>'.$lang['1087'].': <b>'.round($q['mc3']/$q['ms3'], 3).'</b></u><br/><br/>'.
'<u>'.$lang['1088'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v=wml&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>'.
'</small>';
else
if($config->vers == 'html')
echo $lang['1072'].': <font color="'.$config->color['other'].'">'.$q['credit'].'</font><br/>'.
$lang['1073'].': <font color="'.$config->color['other'].'">'.$q['bank'].'</font><br/><br/>'.
'<b><font color="'.$config->color['error'].'">'.$lang['1074'].':</font></b><br/>'.
$lang['1076'].': <font color="'.$config->color['other'].'">'.$q['is1'].'</font><br/>'.
$lang['1077'].': <font color="'.$config->color['other'].'">'.$q['ic1'].'</font><br/>'.
$lang['1078'].': <font color="'.$config->color['other'].'">'.$q['it1'].'</font><br/>'.
'<u>'.$lang['1079'].': <font color="'.$config->color['other'].'">'.round($q['ic1']/$q['is1'], 3).'</font></u><br/>'.
$lang['1080'].': <font color="'.$config->color['other'].'">'.$q['is2'].'</font><br/>'.
$lang['1081'].': <font color="'.$config->color['other'].'">'.$q['ic2'].'</font><br/>'.
$lang['1082'].': <font color="'.$config->color['other'].'">'.$q['it2'].'</font><br/>'.
'<u>'.$lang['1083'].': <font color="'.$config->color['other'].'">'.round($q['ic2']/$q['is2'], 3).'</font></u><br/>'.
$lang['1084'].': <font color="'.$config->color['other'].'">'.$q['is3'].'</font><br/>'.
$lang['1085'].': <font color="'.$config->color['other'].'">'.$q['ic3'].'</font><br/>'.
$lang['1086'].': <font color="'.$config->color['other'].'">'.$q['it3'].'</font><br/>'.
'<u>'.$lang['1087'].': <font color="'.$config->color['other'].'">'.round($q['ic3']/$q['is3'], 3).'</font></u><br/><br/>'.
'<b><font color="'.$config->color['error'].'">'.$lang['1075'].':</font></b><br/>'.
$lang['1076'].': <font color="'.$config->color['other'].'">'.$q['ms1'].'</font><br/>'.
$lang['1077'].': <font color="'.$config->color['other'].'">'.$q['mc1'].'</font><br/>'.
$lang['1078'].': <font color="'.$config->color['other'].'">'.$q['mt1'].'</font><br/>'.
'<u>'.$lang['1079'].': <font color="'.$config->color['other'].'">'.round($q['mc1']/$q['ms1'], 3).'</font></u><br/>'.
$lang['1080'].': <font color="'.$config->color['other'].'">'.$q['ms2'].'</font><br/>'.
$lang['1081'].': <font color="'.$config->color['other'].'">'.$q['mc2'].'</font><br/>'.
$lang['1082'].': <font color="'.$config->color['other'].'">'.$q['mt2'].'</font><br/>'.
'<u>'.$lang['1083'].': <font color="'.$config->color['other'].'">'.round($q['mc2']/$q['ms2'], 3).'</font></u><br/>'.
$lang['1084'].': <font color="'.$config->color['other'].'">'.$q['ms3'].'</font><br/>'.
$lang['1085'].': <font color="'.$config->color['other'].'">'.$q['mc3'].'</font><br/>'.
$lang['1086'].': <font color="'.$config->color['other'].'">'.$q['mt3'].'</font><br/>'.
'<u>'.$lang['1087'].': <font color="'.$config->color['other'].'">'.round($q['mc3']/$q['ms3'], 3).'</font></u><br/><br/>'.
'<u>'.$lang['1088'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v=html&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
mysql_close($mysql); $config->finish(true);
}
/******************************************************************************/
if($act == 'banner'){
if(isset($_GET['banner'])) $banner = $_GET['banner'];
elseif(isset($_POST['banner'])) $banner = $_POST['banner'];
else $banner = false;
################################################################################
if($banner == 'add'){
$config->start('add', $lang['1101']);
if(!isset($_POST['url']) && !isset($_FILES['file']) && !isset($_GET['std']))
{
if($config->vers == 'wml')
echo '<small>'.$lang['1103'].':</small><br/>'.
'<input type="text" name="url" value="http://" maxlength="150"/><br/>'.
'<small><anchor>'.$lang['1105'].'<go href="panel.php" method="post">'.
'<postfield name="l" value="'.$config->lang.'"/>'.
'<postfield name="v" value="wml"/>'.
'<postfield name="id" value="'.$id.'"/>'.
'<postfield name="ps" value="'.$ps.'"/>'.
'<postfield name="act" value="banner"/>'.
'<postfield name="banner" value="add"/>'.
'<postfield name="url" value="$(url)"/>'.
'</go></anchor><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v=wml&id='.$id.'&ps='.$ps.'&act=banner">'.$lang['1098'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v=wml&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a></small>';
else
if($config->vers == 'html')
echo '<form action="panel.php" method="post">'.
'<input type="hidden" name="l" value="'.$config->lang.'"/>'.
'<input type="hidden" name="v" value="html"/>'.
'<input type="hidden" name="id" value="'.$id.'"/>'.
'<input type="hidden" name="ps" value="'.$ps.'"/>'.
'<input type="hidden" name="act" value="banner"/>'.
'<input type="hidden" name="banner" value="add"/>'.
$lang['1103'].':<br/>'.
'<input type="text" name="url" value="http://" maxlength="150"/><br/>'.
'<input type="submit" value="'.$lang['1105'].'"/>'.
'</form>'.
'<form action="panel.php" enctype="multipart/form-data" method="post">'.
'<input type="hidden" name="l" value="'.$config->lang.'"/>'.
'<input type="hidden" name="v" value="html"/>'.
'<input type="hidden" name="id" value="'.$id.'"/>'.
'<input type="hidden" name="ps" value="'.$ps.'"/>'.
'<input type="hidden" name="act" value="banner"/>'.
'<input type="hidden" name="banner" value="add"/>'.
$lang['1104'].':<br/>'.
'<input type="file" name="file"/><br/>'.
'<input type="submit" value="'.$lang['1105'].'"/>'.
'</form><br/>'.
'<a href="panel.php?l='.$config->lang.'&v=html&id='.$id.'&ps='.$ps.'&act=banner">'.$lang['1098'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v=html&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
mysql_close($mysql); $config->finish(true);
}
$error = false;
$rnd = mt_rand();
if(isset($_POST['url'])){
$url = trim($_POST['url']);
$url = stripslashes($url);
if(!preg_match('/(https?|ftp)://((?:[-a-z0-9_]+):(?:[-a-z0-9_]+)@)?((?:d{1,3}.d{1,3}.d{1,3}.d{1,3})|(?:(?:[-a-z0-9_]+.)+(?:info|mobi|name|biz|com|net|org|ae|au|az|be|br|by|bz|ca|cc|ch|cn|cz|de|dk|do|ee|eo|es|eu|fi|fr|hu|il|in|iz|jp|kg|kr|kz|lt|lv|mn|mx|nl|no|nz|pl|ro|ru|si|sk|su|tv|tw|ua|uk|us|uz|ws|yu|za))).?(:d+)?((?:(?:/)|(?))(.*))?/is', $url, $url)) $error = $lang['1106'];
elseif(!copy($url['1'].'://'.$url['2'].$url['3'].$url['4'].'/'.$url['6'].$url['7'], $config->root.'/banners/tmp'.$rnd)) $error = $lang['1108'];
else{
$img = getimagesize($config->root.'/banners/tmp'.$rnd);
if($img['2'] != 1 && $img['2'] != 2 && $img['3'] != 3) $error = $lang['1109'];
elseif($img['0'] < 50 || $img['0'] > 100 || $img['1'] < 20 || $img['1'] > 40) $error = $lang['1110'];
elseif(filesize($config->root.'/banners/tmp'.$rnd) > 10240) $error = $lang['1120'];
else{
if($config->conf['mod_banner'] == 'on')
{
$q = mysql_query("SELECT `status` FROM `users` WHERE `id` = '$id';", $mysql);
$q = mysql_fetch_array($q) or $q['status'] = 2;
if($q['status'] == 4 || $q['status'] == 5 || $q['status'] == 7 || strpos($config->conf['admin'], '|'.$id.'|') !== false){
$st = 3;
}
else $st = 1;
}
else $st = 3;
if(mysql_query("INSERT INTO `banners` VALUES('0', '$id', '0', '0', '0', '0', '0', '0', '$st');", $mysql))
{
$ud = mysql_insert_id($mysql) or $ud = 0;
if(copy($config->root.'/banners/tmp'.$rnd, $config->root.'/banners/'.$ud))
{
if($st == 3) mysql_query("UPDATE `users` SET `banner` = `banner`+1 WHERE `id` = '$id';", $mysql);
}
else{ $error = $lang['1108']; mysql_query("DELETE FROM `banners` WHERE `id` = '$ud';", $mysql); }
}
else $error = $lang['1108'];
}
unlink($config->root.'/banners/tmp'.$rnd);
}
}
elseif($config->vers == 'html' && isset($_FILES['file'])){
$img = getimagesize($_FILES['file']['tmp_name']);
if($img['2'] != 1 && $img['2'] != 2 && $img['3'] != 3) $error = $lang['1109'];
elseif($img['0'] < 50 || $img['0'] > 100 || $img['1'] < 20 || $img['1'] > 40) $error = $lang['1110'];
elseif($_FILES['file']['size'] > 10240) $error = $lang['1120'];
else{
if($config->conf['mod_banner'] == 'on')
{
$q = mysql_query("SELECT `status` FROM `users` WHERE `id` = '$id';", $mysql);
$q = mysql_fetch_array($q) or $q['status'] = 2;
if($q['status'] == 4 || $q['status'] == 5 || $q['status'] == 7 || strpos($config->conf['admin'], '|'.$id.'|') !== false){
$st = 3;
}
else $st = 1;
}
else $st = 3;
if(mysql_query("INSERT INTO `banners` VALUES('0', '$id', '0', '0', '0', '0', '0', '0', '$st');", $mysql))
{
$ud = mysql_insert_id($mysql) or $ud = 0;
if(copy($_FILES['file']['tmp_name'], $config->root.'/banners/'.$ud))
{
if($st == 3) mysql_query("UPDATE `users` SET `banner` = `banner`+1 WHERE `id` = '$id';", $mysql);
}
else{ $error = $lang['1108']; mysql_query("DELETE FROM `banners` WHERE `id` = '$ud';", $mysql); }
}
else $error = $lang['1108'];
}
}
elseif(isset($_GET['std'])){
$std = intval($_GET['std']);
$img = getimagesize($config->root.'/banners/std/'.$std);
if($img['2'] != 1 && $img['2'] != 2 && $img['3'] != 3) $error = $lang['1108'];
elseif($img['0'] < 50 || $img['0'] > 100 || $img['1'] < 20 || $img['1'] > 40) $error = $lang['1108'];
else{
if(mysql_query("INSERT INTO `banners` VALUES('0', '$id', '0', '0', '0', '0', '0', '0', '3');", $mysql))
{
$ud = mysql_insert_id($mysql) or $ud = 0;
if(copy($config->root.'/banners/std/'.$std, $config->root.'/banners/'.$ud)){
mysql_query("UPDATE `users` SET `banner` = `banner`+1 WHERE `id` = '$id';", $mysql); }
else{ $error = $lang['1108']; mysql_query("DELETE FROM `banners` WHERE `id` = '$ud';", $mysql); }
}
else $error = $lang['1108'];
}
}
else $error = $lang['1108'];
if($config->vers == 'wml') print '<small>';
if($error) echo '<u>'.$error.'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=banner&banner=add">'.$lang['1029'].'</a><br/><br/>';
else echo '<u>'.$lang['1107'].'</u><br/><br/>';
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=banner">'.$lang['1098'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
################################################################################
if($banner == 'std'){
$config->start('std', $lang['1102']);
if($config->vers == 'wml') print '<small>';
$files = array();
$od = opendir($config->root.'/banners/std/');
while($file = readdir($od)){
if($file{0} == '.') continue;
if(!preg_match('/^d+$/', $file)) continue;
$files[] = $file;
}
$count = count($files);
if($count < 1) print '<u>'.$lang['1100'].'</u><br/><br/>';
else{
$page = intval($_GET['p']);
if($page < 1) $page = 1;
$limit = $page*5-5;
if($limit >= $count){ $limit = 0; $page = 1; }
$pages = round($count/5);
if($pages*5 < $count) $pages++;
asort($files);
$files = array_slice($files, $limit, 5);
echo '<u>'.$lang['1099'].': <b>'.$count.'</b></u><br/><br/>';
foreach($files as $num => $file){
echo '<b>'.($limit+$num+1).'.</b>'.
' <img src="banner.php?id='.$file.'&std=yes" alt=""/> <br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=banner&banner=add&std='.$file.'">'.$lang['1x'].'</a><br/><br/>';
}
if($page > 1 || $page < $pages){
if($page > 1)
print '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=banner&banner=std&p='.($page-1).'">'.$lang['1n'].'</a> ';
if($page < $pages)
print '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=banner&banner=std&p='.($page+1).'">'.$lang['1g'].'</a>';
print '<br/><br/>';
}
}
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=banner">'.$lang['1098'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
################################################################################
if(intval($banner) > 0){
$banner = intval($banner);
$q = mysql_query("SELECT `ud`, `s1`, `s2`, `s3`, `c1`, `c2`, `c3`, `status` FROM `banners` WHERE `id` = '$banner';", $mysql);
$q = mysql_fetch_array($q);
if(!$q || $q['ud'] != $id){
$config->start('error', $lang['1014'], 'left', 'panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=banner', '1');
if($config->vers == 'wml') print '<small>';
echo '<u>'.$lang['1111'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=banner">'.$lang['1098'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
if(isset($_GET['del'])){
$config->start('del', $lang['1116'], 'left', 'panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=banner', '1');
if($config->vers == 'wml') print '<small>';
if(mysql_query("DELETE FROM `banners` WHERE `id` = '$banner';", $mysql)){
if($q['status'] == 3) mysql_query("UPDATE `users` SET `banner` = `banner`-1 WHERE `id` = '$id';");
unlink($config->root.'/banners/'.$banner);
print '<u>'.$lang['1118'].'</u><br/><br/>';
}
else{
print '<u>'.$lang['1117'].'</u><br/><br/>'; }
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=banner">'.$lang['1098'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
if(isset($_GET['switch'])){
if($q['status'] == 3){
if(mysql_query("UPDATE `users` SET `banner` = `banner`-1 WHERE `id` = '$id';", $mysql))
{
mysql_query("UPDATE `banners` SET `status` = '4' WHERE `id` = '$banner';", $mysql);
$q['status'] = 4;
}
}
elseif($q['status'] == 4){
if(mysql_query("UPDATE `users` SET `banner` = `banner`+1 WHERE `id` = '$id';", $mysql))
{
mysql_query("UPDATE `banners` SET `status` = '3' WHERE `id` = '$banner';", $mysql);
$q['status'] = 3;
}
}
}
$config->start('banner', $lang['1098'], 'center');
if($config->vers == 'wml') print '<small>';
echo '<img src="banner.php?id='.$banner.'" alt=""/><br/>';
if($q['status'] == 1) print '[<u>'.$lang['1112'].'</u>]';
elseif($q['status'] == 2) print '[<u>'.$lang['1113'].'</u>]';
elseif($q['status'] == 3) print '[<u>'.$lang['1065'].'</u>]';
elseif($q['status'] == 4) print '[<u>'.$lang['1066'].'</u>]';
if($config->vers == 'wml') print '</small>';
echo '</p><p align="left">';
if($config->vers == 'wml') print '<small>';
if($q['status'] == 3) print '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=banner&banner='.$banner.'&switch=yes">'.$lang['1115'].'</a><br/>';
elseif($q['status'] == 4) print '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=banner&banner='.$banner.'&switch=yes">'.$lang['1114'].'</a><br/>';
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=banner&banner='.$banner.'&del=yes">'.$lang['1116'].'</a><br/><br/>';
if($config->vers == 'wml')
echo '<b>'.$lang['1119'].':</b><br/>'.
$lang['1076'].': <b>'.$q['s1'].'</b><br/>'.
$lang['1077'].': <b>'.$q['c1'].'</b><br/>'.
'<u>'.$lang['1079'].': <b>'.round($q['c1']/$q['s1'], 3).'</b></u><br/>'.
$lang['1080'].': <b>'.$q['s2'].'</b><br/>'.
$lang['1081'].': <b>'.$q['c2'].'</b><br/>'.
'<u>'.$lang['1083'].': <b>'.round($q['c2']/$q['s2'], 3).'</b></u><br/>'.
$lang['1084'].': <b>'.$q['s3'].'</b><br/>'.
$lang['1085'].': <b>'.$q['c3'].'</b><br/>'.
'<u>'.$lang['1087'].': <b>'.round($q['c3']/$q['s3'], 3).'</b></u><br/><br/>';
else
if($config->vers == 'html')
echo '<b><font color="'.$config->color['error'].'">'.$lang['1119'].':</font></b><br/>'.
$lang['1076'].': <font color="'.$config->color['other'].'">'.$q['s1'].'</font><br/>'.
$lang['1077'].': <font color="'.$config->color['other'].'">'.$q['c1'].'</font><br/>'.
'<u>'.$lang['1079'].': <font color="'.$config->color['other'].'">'.round($q['c1']/$q['s1'], 3).'</font></u><br/>'.
$lang['1080'].': <font color="'.$config->color['other'].'">'.$q['s2'].'</font><br/>'.
$lang['1081'].': <font color="'.$config->color['other'].'">'.$q['c2'].'</font><br/>'.
'<u>'.$lang['1083'].': <font color="'.$config->color['other'].'">'.round($q['c2']/$q['s2'], 3).'</font></u><br/>'.
$lang['1084'].': <font color="'.$config->color['other'].'">'.$q['s3'].'</font><br/>'.
$lang['1085'].': <font color="'.$config->color['other'].'">'.$q['c3'].'</font><br/>'.
'<u>'.$lang['1087'].': <font color="'.$config->color['other'].'">'.round($q['c3']/$q['s3'], 3).'</font></u><br/><br/>';
echo '<u>'.$lang['1088'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=banner">'.$lang['1098'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
################################################################################
$config->start('banner', $lang['1098']);
if($config->vers == 'wml') print '<small>';
$q = mysql_query("SELECT COUNT(`id`) FROM `banners` WHERE `ud` = '$id';", $mysql);
$q = mysql_fetch_array($q) or $q['0'] = 0;
$count = $q['0'];
if($count < 1) print '<u>'.$lang['1100'].'</u><br/><br/>';
else{
$page = intval($_GET['p']);
if($page < 1) $page = 1;
$limit = $page*5-5;
if($limit >= $count){ $limit = 0; $page = 1; }
$pages = round($count/5);
if($pages*5 < $count) $pages++;
$q = mysql_query("SELECT `id` FROM `banners` WHERE `ud` = '$id' ORDER BY `id` DESC LIMIT $limit, 5;", $mysql);
echo '<u>'.$lang['1099'].': <b>'.$count.'</b></u><br/><br/>';
$num = 1;
while($d = mysql_fetch_array($q)){
echo '<b>'.($limit+$num).'.</b>'.
' <img src="banner.php?id='.$d['id'].'" alt=""/> '.
'[<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=banner&banner='.$d['id'].'">+</a>]<br/>';
$num++;
}
print '<br/>';
if($page > 1 || $page < $pages){
if($page > 1)
print '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=banner&p='.($page-1).'">'.$lang['1n'].'</a> ';
if($page < $pages)
print '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=banner&p='.($page+1).'">'.$lang['1g'].'</a>';
print '<br/><br/>';
}
}
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=banner&banner=add">'.$lang['1101'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=banner&banner=std">'.$lang['1102'].'</a><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
/******************************************************************************/
if($act == 'bank'){
$config->start('bank', $lang['1089']);
$q = mysql_query("SELECT `bank`, `credit` FROM `users` WHERE `id` = '$id';", $mysql);
$q = mysql_fetch_array($q) or $q = array('bank' => '0', 'credit' => '0');
if((!isset($_POST['credit'])) || ($q['credit'] <= 0 && $q['bank'] <= 0))
{
if($config->vers == 'wml'){
echo '<small>'.
$lang['1072'].': <b>'.$q['credit'].'</b><br/>'.
$lang['1073'].': <b>'.$q['bank'].'</b><br/><br/>';
if($q['credit'] > 0 || $q['bank'] > 0)
echo $lang['1091'].':</small><br/>'.
'<select name="opt" value="1">'.
'<option value="1">'.$lang['1092'].'</option>'.
'<option value="2">'.$lang['1093'].'</option>'.
'</select><br/>'.
'<small>'.$lang['1090'].':</small><br/>'.
'<input type="text" name="credit" maxlength="11" format="*N"/><br/>'.
'<small><anchor>'.$lang['1028'].'<go href="panel.php" method="post">'.
'<postfield name="l" value="'.$config->lang.'"/>'.
'<postfield name="v" value="wml"/>'.
'<postfield name="id" value="'.$id.'"/>'.
'<postfield name="ps" value="'.$ps.'"/>'.
'<postfield name="act" value="bank"/>'.
'<postfield name="opt" value="$(opt)"/>'.
'<postfield name="credit" value="$(credit)"/>'.
'</go></anchor><br/><br/>';
echo '<a href="panel.php?l='.$config->lang.'&v=wml&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>'.
'</small>';
}
else
if($config->vers == 'html'){
echo $lang['1072'].': <font color="'.$config->color['other'].'">'.$q['credit'].'</font><br/>'.
$lang['1073'].': <font color="'.$config->color['other'].'">'.$q['bank'].'</font><br/><br/>';
if($q['credit'] > 0 || $q['bank'] > 0)
echo '<form action="panel.php" method="post">'.
'<input type="hidden" name="l" value="'.$config->lang.'"/>'.
'<input type="hidden" name="v" value="html"/>'.
'<input type="hidden" name="id" value="'.$id.'"/>'.
'<input type="hidden" name="ps" value="'.$ps.'"/>'.
'<input type="hidden" name="act" value="bank"/>'.
$lang['1091'].':<br/>'.
'<select name="opt" value="1">'.
'<option value="1">'.$lang['1092'].'</option>'.
'<option value="2">'.$lang['1093'].'</option>'.
'</select><br/>'.
$lang['1090'].':<br/>'.
'<input type="text" name="credit" maxlength="11"/><br/>'.
'<input type="submit" value="'.$lang['1028'].'"/>'.
'</form><br/>';
echo '<a href="panel.php?l='.$config->lang.'&v=html&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
}
mysql_close($mysql); $config->finish(true);
}
$error = false;
$option = intval($_POST['opt']);
$credit = intval($_POST['credit']);
if($option != 1 && $option != 2) $option = 1;
if($credit < 0) $credit = 0;
if($option == 1 && $credit > $q['credit']) $error = $lang['1094'];
if($option == 2 && $credit > $q['bank']) $error = $lang['1095'];
if($error){
if($config->vers == 'wml') print '<small>';
echo '<u>'.$error.'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=bank">'.$lang['1029'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
if($config->vers == 'wml') print '<small>';
if($option == 1){
$q['credit'] -= $credit;
$q['bank'] += $credit;
echo '<u>'.$lang['1096'].'</u><br/><br/>';
}
else{
$q['credit'] += $credit;
$q['bank'] -= $credit;
echo '<u>'.$lang['1097'].'</u><br/><br/>';
}
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=bank">'.$lang['1089'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_query("UPDATE `users` set `credit` = '".$q['credit']."', `bank` = '".$q['bank']."' WHERE `id` = '$id';", $mysql);
mysql_close($mysql); $config->finish(true);
}
/******************************************************************************/
if($act == 'trans'){
$q = mysql_query("SELECT `credit`, `status` FROM `users` WHERE `id` = '$id';", $mysql);
$q = mysql_fetch_array($q) or $q['credit'] = 0;
$config->start('trans', $lang['1252']);
if(!isset($_POST['to']) || $q['status'] < 3)
{
if($config->vers == 'wml'){
echo '<small>'.$lang['1072'].': <b>'.$q['credit'].'</b><br/><br/>';
if(($q['credit'] > 0 || strpos($config->conf['admin'], '|'.$id.'|') !== false) && $q['status'] > 2)
echo $lang['1254'].':</small><br/>'.
'<input type="text" name="to" value="" maxlength="11" format="*N"/><br/>'.
'<small>'.$lang['1255'].':</small><br/>'.
'<input type="text" name="credit" value="" maxlength="11" format="*N"/><br/>'.
'<small>'.$lang['1132'].':</small><br/>'.
'<input type="text" name="comment" value="" maxlength="50"/><br/>'.
'<small><anchor>'.$lang['1256'].'<go href="panel.php" method="post">'.
'<postfield name="l" value="'.$config->lang.'"/>'.
'<postfield name="v" value="wml"/>'.
'<postfield name="id" value="'.$id.'"/>'.
'<postfield name="ps" value="'.$ps.'"/>'.
'<postfield name="act" value="trans"/>'.
'<postfield name="to" value="$(to)"/>'.
'<postfield name="credit" value="$(credit)"/>'.
'<postfield name="comment" value="$(comment)"/>'.
'</go></anchor><br/><br/>';
echo '<a href="panel.php?l='.$config->lang.'&v=wml&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>'.
'</small>';
}
else
if($config->vers == 'html'){
echo $lang['1072'].': <font color="'.$config->color['other'].'">'.$q['credit'].'</font><br/><br/>';
if(($q['credit'] > 0 || strpos($config->conf['admin'], '|'.$id.'|') !== false) && $q['status'] > 2)
echo '<form action="panel.php" method="post">'.
'<input type="hidden" name="l" value="'.$config->lang.'"/>'.
'<input type="hidden" name="v" value="html"/>'.
'<input type="hidden" name="id" value="'.$id.'"/>'.
'<input type="hidden" name="ps" value="'.$ps.'"/>'.
'<input type="hidden" name="act" value="trans"/>'.
$lang['1254'].':<br/>'.
'<input type="text" name="to" value="" maxlength="11"/><br/>'.
$lang['1255'].':<br/>'.
'<input type="text" name="credit" value="" maxlength="11"/><br/>'.
$lang['1132'].':<br/>'.
'<input type="text" name="comment" value="" maxlength="50"/><br/>'.
'<input type="submit" value="'.$lang['1256'].'"/>'.
'</form><br/>';
echo '<a href="panel.php?l='.$config->lang.'&v=html&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
}
}
else
{
$to = intval($_POST['to']);
$credit = intval($_POST['credit']);
$comment = trim($_POST['comment']);
if($config->vers == 'wml') print '<small>';
if($credit > $q['credit'] && strpos($config->conf['admin'], '|'.$id.'|') === false){
echo '<u>'.$lang['1257'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=trans">'.$lang['1029'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
if(strlen($comment) > 1)
{
$comment = stripslashes($comment);
$comment = str_replace("n", " ", $comment);
$comment = iconv('utf-8', 'windows-1251', $comment);
$comment = addslashes($comment);
}
if(strlen($comment) > 50)
{
echo '<u>'.$lang['1331'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=trans">'.$lang['1029'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
if($credit<=0){
echo '<u>Вы не можете перевести менее 1 кредита!</u>';
echo '<u>You can't translate less then 1 credit!</u>';
mysql_close($mysql); $config->finish(true);
}
$sql=mysql_query('select * from users where id='.$to) or die(mysql_error());
if(mysql_num_rows($sql)<1)
{
echo '<u>Этот id не существует</u><br/><u>This id is not exist</u>';
mysql_close($mysql); $config->finish(true);
}
if(!mysql_query("UPDATE `users` SET `credit` = `credit`+'$credit' WHERE `id` = '$to';", $mysql)){
echo '<u>'.$lang['1258'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=trans">'.$lang['1029'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
if(strpos($config->conf['admin'], '|'.$id.'|') === false) mysql_query("UPDATE `users` SET `credit` = `credit`-'$credit' WHERE `id` = '$id';", $mysql);
if($id != $to)
{
$mes = 'ID '.$id.' перевел Вам '.$credit.' кредит';
if($credit >= 2 && $credit <= 4) $mes .= 'а';
if($credit >= 5) $mes .= 'ов';
if(strlen($comment) > 1) $mes .= "n".'Его комментарий: '.$comment;
$mes .= "n".'-----'."n";
$mes .= 'ID '.$id.' translated you '.$credit.' credit';
if($credit > 1) $mes .= 's';
if(strlen($comment) > 1) $mes .= "n".'His comment: '.$comment;
mysql_query("INSERT INTO `history` VALUES('$id', '$to', '".time()."', '0', '$credit', '1', '2'), ('$to', '$id', '".time()."', '0', '$credit', '1', '1');", $mysql);
mysql_query("INSERT INTO `pochta` VALUES('0', '$to', '1', 'Перевод кредитов/Translation of credits', '".$mes."', '1', '".time()."', '1');", $mysql);
}
echo '<u>'.$lang['1259'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
}
mysql_close($mysql); $config->finish(true);
}
/******************************************************************************/
if($act == 'sc' && $config->conf['sell'] != 'off'){
$config->start('sc', $lang['1233']);
if($config->vers == 'wml') print '<small>';
if($config->conf['sell'] == 'stop'){
echo '<u>'.$lang['1336'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
$q = mysql_query("SELECT `bank`, `money`, `status` FROM `users` WHERE `id` = '$id';", $mysql);
if(!$q = mysql_fetch_array($q)){ $q['bank'] = 0; $q['money'] = 0; }
if($q['bank'] <= 0 || $q['status'] < 3)
{
echo $lang['1230'].': <b>'.$q['bank'].'</b><br/>'.
$lang['1231'].': <b>'.doubleval($q['money']).'</b> WMR<br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
if(!isset($_POST['credit']))
{
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=scr">'.$lang['1340'].'</a><br/>---<br/>'.
$lang['1230'].': <b>'.$q['bank'].'</b><br/>'.
$lang['1231'].': <b>'.doubleval($q['money']).'</b> WMR<br/>---<br/>';
if($config->vers == 'wml'){
echo $lang['1276'].':</small><br/>'.
'<input type="text" name="credit'.$rand.'" value="'.$q['bank'].'" maxlength="10" format="*N"/><br/>'.
'<small><anchor>'.$lang['1028'].'<go href="panel.php" method="post">'.
'<postfield name="l" value="'.$config->lang.'"/>'.
'<postfield name="v" value="wml"/>'.
'<postfield name="id" value="'.$id.'"/>'.
'<postfield name="ps" value="'.$ps.'"/>'.
'<postfield name="act" value="sc"/>'.
'<postfield name="credit" value="$(credit'.$rand.')"/>'.
'</go></anchor><br/>'.
'<a href="panel.php?l='.$config->lang.'&v=wml&id='.$id.'&ps='.$ps.'">'.$lang['1027'].'</a>';
}
else
if($config->vers == 'html'){
echo '<form action="panel.php" method="post">'.
'<input type="hidden" name="l" value="'.$config->lang.'"/>'.
'<input type="hidden" name="v" value="html"/>'.
'<input type="hidden" name="id" value="'.$id.'"/>'.
'<input type="hidden" name="ps" value="'.$ps.'"/>'.
'<input type="hidden" name="act" value="sc"/>'.
$lang['1276'].':<br/>'.
'<input type="text" name="credit" value="'.$q['bank'].'" maxlength="10"/><br/>'.
'<input type="submit" value="'.$lang['1028'].'"/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v=html&id='.$id.'&ps='.$ps.'">'.$lang['1027'].'</a>'.
'</form>';
}
}
else
{
$credit = intval($_POST['credit']);
if($credit <= 0) $result = $lang['1337'];
elseif($credit > $q['bank']) $result = $lang['1337'];
else
{
$q['bank'] -= $credit;
$q['money'] += $credit/50; #0.02 WMR - 1 кредит; 20 WMR - 1000 кредитов
if(mysql_query("UPDATE `users` SET `bank` = '".$q['bank']."', `money` = '".$q['money']."' WHERE `id` = '".$id."';", $mysql))
{
$result = $lang['1338'];
mysql_query("INSERT INTO `pochta` VALUES('0', '1', '1', 'Продажа кредитов', 'ID: ".$id." продал ".$credit." кредитов на ".($credit/50)." WMR', '1', '".time()."', '1');", $mysql);
}
else $result = $lang['1339'];
}
echo '<u>'.$result.'</u><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=sc">'.$lang['1233'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
}
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
/******************************************************************************/
if($act == 'scr'){
$config->start('rules', $lang['1340']);
if($config->vers == 'wml') print '<small>';
echo $lang['1341'].
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=sc">'.$lang['1233'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
/******************************************************************************/
if($act == 'history'){
$config->start('history', $lang['1253']);
if($config->vers == 'wml') print '<small>';
$q = mysql_query("SELECT COUNT(*) FROM `history` WHERE `id` = '$id' && `status` = '1';", $mysql);
$q = mysql_fetch_array($q) or $q['0'] = 0;
$count = $q['0'];
if($count < 1) print '<u>'.$lang['1262'].'</u><br/><br/>';
else{
$page = intval($_GET['p']);
if($page < 1) $page = 1;
$limit = $page*10-10;
if($limit >= $count){ $limit = 0; $page = 1; }
$pages = round($count/10);
if($pages*10 < $count) $pages++;
$q = mysql_query("SELECT `ud`, `time`, `credit`, `action` FROM `history` WHERE `id` = '$id' && `status` = '1' ORDER BY `time` DESC LIMIT $limit, 10;", $mysql);
$num = 1;
while($d = mysql_fetch_array($q)){
echo '<b>'.($limit+$num).'.</b> <u>['.date('d.m H:i', $d['time']).']</u> ';
if($d['action'] == 1)
echo str_ireplace('%credit%', $d['credit'], str_ireplace('%from%', $d['ud'], $lang['1260']));
elseif($d['action'] == 2)
echo str_ireplace('%credit%', $d['credit'], str_ireplace('%to%', $d['ud'], $lang['1261']));
echo '<br/>';
$num++;
}
print '<br/>';
if($page > 1 || $page < $pages){
if($page > 1)
print '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=history&p='.($page-1).'">'.$lang['1n'].'</a> ';
if($page < $pages)
print '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=history&p='.($page+1).'">'.$lang['1g'].'</a>';
print '<br/><br/>';
}
}
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
/******************************************************************************/
if($act == 'code'){
$q = mysql_query("SELECT `site` FROM `users` WHERE `id` = '$id';", $mysql);
$q = mysql_fetch_array($q) or $q['site'] = 'Unknown';
$config->start('code', $lang['1058']);
if($config->vers == 'wml') print '<small>';
echo $lang['1050'].' <u>'.$q['site'].'</u><br/>'.
$lang['1051'].': <textarea>'.htmlspecialchars('<a href="http://'.$config->site.'/c.php?'.$id.'"><img src="http://'.$config->site.'/b.php?'.$id.'" alt="'.$config->site.'"/></a>').'</textarea><br/>'.
$lang['1052'].': <textarea>'.htmlspecialchars('<a href="http://'.$config->site.'/t.php?'.$id.'">'.$lang['1055'].'</a>').'</textarea><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
/******************************************************************************/
if($act == 'rules'){
$config->start('rules', $lang['1024']);
if($config->vers == 'wml') print '<small>';
echo $lang['1030'].
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
/******************************************************************************/
if($act == 'ref' && $config->conf['ref'] != 'off'){
$config->start('ref', $lang['1365']);
if($config->vers == 'wml') print '<small>';
$q = mysql_query("SELECT COUNT(`id`) AS `count` FROM `users` WHERE `ref` = '$id';", $mysql);
$q = mysql_fetch_array($q) or $q['count'] = 0;
$count = $q['count'];
################################################################################
if($_GET['ref'] == 'list' && $count > 0)
{
$page = intval($_GET['p']);
if($page < 1) $page = 1;
$limit = $page*10-10;
if($limit >= $count){ $limit = 0; $page = 1; }
$pages = round($count/10);
if($pages*10 < $count) $pages++;
$c = $limit+1;
$q = mysql_query("SELECT `id`, `site` FROM `users` WHERE `ref` = '$id' ORDER BY `id` DESC LIMIT $limit, 10;", $mysql);
while($d = mysql_fetch_array($q))
{
echo '<b>'.$c.'.</b> ID='.$d['id'].'; <u>'.$d['site'].'</u><br/>';
$c++;
}
echo '<br/>';
if($page > 1 || $page < $pages)
{
if($page > 1){
if($page-1 != 1)
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=ref&ref=list&p=1"><<</a> ';
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=ref&ref=list&p='.($page-1).'">'.$lang['1n'].'</a> ';
}
if($page < $pages){
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=ref&ref=list&p='.($page+1).'">'.$lang['1g'].'</a> ';
if($page+1 != $pages)
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=ref&ref=list&p='.$pages.'">>></a> ';
}
echo '<br/><br/>';
}
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=ref">'.$lang['1029'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
################################################################################
if($count <= 0) echo '<u>'.$lang['1367'].'</u><br/><br/>';
else
{
$lang['1366'] = str_ireplace('%partners%', '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=ref&ref=list">'.$count.'</a>', $lang['1366']);
echo $lang['1366'].'<br/><br/>';
}
echo str_ireplace('%link%', 'http://'.$config->site.'/?ref='.$id, $lang['1368']).'<br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
/******************************************************************************/
if($act == 'prof'){
$q = mysql_query("SELECT `nick`, `site`, `mail`, `status` FROM `users` WHERE `id` = '$id';", $mysql);
$q = mysql_fetch_array($q) or $q = array('nick' => 'Unknown', 'site' => 'Unknown', 'mail' => 'Unknown', 'status' => '2');
$q['nick'] = htmlspecialchars($q['nick']);
$q['nick'] = str_replace('$', '$$', $q['nick']);
if(($q['status'] == 1 || $q['status'] == 2) && (strpos($config->conf['admin'], '|'.$id.'|') === false)){
$config->start('prof', $lang['1022']);
if($config->vers == 'wml') print '<small>';
echo $lang['1033'].': <u>'.$q['mail'].'</u><br/>'.
$lang['1036'].': <u>http://'.$q['site'].'</u><br/>'.
$lang['1021'].': <u>'.$ps.'</u><br/>'.
$lang['1326'].': <u>'.$q['nick'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
if(!isset($_POST['site']))
{
$config->start('prof', $lang['1022']);
if($config->vers == 'wml'){
echo '<small>'.$lang['1033'].': <u>'.$q['mail'].'</u></small><br/>'.
'<small>'.$lang['1036'].':</small><br/>'.
'<input type="text" name="site" value="http://'.$q['site'].'" maxlength="150"/><br/>'.
'<small>'.$lang['1021'].':</small><br/>'.
'<input type="password" name="pass" value="'.$ps.'" maxlength="150"/><br/>'.
'<small>'.$lang['1059'].':</small><br/>'.
'<input type="password" name="pass2" value="'.$ps.'" maxlength="150"/><br/>'.
'<small>'.$lang['1326'].':</small><br/>'.
'<input type="text" name="nick" value="'.$q['nick'].'" maxlength="30"/><br/>'.
'<small>'.
'<anchor>'.$lang['1061'].'<go href="panel.php" method="post">'.
'<postfield name="l" value="'.$config->lang.'"/>'.
'<postfield name="v" value="wml"/>'.
'<postfield name="id" value="'.$id.'"/>'.
'<postfield name="ps" value="'.$ps.'"/>'.
'<postfield name="act" value="prof"/>'.
'<postfield name="site" value="$(site)"/>'.
'<postfield name="pass" value="$(pass)"/>'.
'<postfield name="pass2" value="$(pass2)"/>'.
'<postfield name="nick" value="$(nick)"/>'.
'</go></anchor><br/>'.
'<a href="panel.php?l='.$config->lang.'&v=wml&id='.$id.'&ps='.$ps.'">'.$lang['1027'].'</a>'.
'</small>';
}
else
if($config->vers == 'html'){
echo '<form action="panel.php" method="post">'.
'<input type="hidden" name="l" value="'.$config->lang.'"/>'.
'<input type="hidden" name="v" value="html"/>'.
'<input type="hidden" name="id" value="'.$id.'"/>'.
'<input type="hidden" name="ps" value="'.$ps.'"/>'.
'<input type="hidden" name="act" value="prof"/>'.
$lang['1033'].': <u>'.$q['mail'].'</u><br/>'.
$lang['1036'].':<br/>'.
'<input type="text" name="site" value="http://'.$q['site'].'" maxlength="150"/><br/>'.
$lang['1021'].':<br/>'.
'<input type="password" name="pass" value="'.$ps.'" maxlength="150"/><br/>'.
$lang['1059'].':<br/>'.
'<input type="password" name="pass2" value="'.$ps.'" maxlength="150"/><br/>'.
$lang['1326'].':<br/>'.
'<input type="text" name="nick" value="'.$q['nick'].'" maxlength="30"/><br/>'.
'<input type="submit" value="'.$lang['1061'].'"/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v=html&id='.$id.'&ps='.$ps.'">'.$lang['1027'].'</a>'.
'</form>';
}
mysql_close($mysql); $config->finish(true);
}
$error = false;
if(!$_POST['site']) $error = $lang['1039'];
elseif(!$_POST['pass']) $error = $lang['1043'];
elseif($_POST['pass'] != $_POST['pass2']) $error = $lang['1060'];
else{
$nick = trim($_POST['nick']);
$site = trim($_POST['site']);
$pass = trim($_POST['pass']);
if(strlen($nick) > 1)
{
$nick = stripslashes($nick);
$nick = str_replace("n", " ", $nick);
$nick = iconv('utf-8', 'windows-1251', $nick);
$nick = addslashes($nick);
}
if(strlen($nick) > 30) $error = $lang['1327'];
else if($site == 'http://') $error = $lang['1040'];
else if(strlen($site) > 150) $error = $lang['1040'];
else if(strlen($pass) > 150) $error = $lang['1044'];
else if(!preg_match('/^(?:http://)?((?:[-a-z0-9_]+.)*(?:info|mobi|name|biz|com|net|org|ae|au|az|be|br|by|bz|ca|cc|ch|cn|cz|de|dk|do|ee|eo|es|eu|fi|fr|hu|il|in|iz|jp|kg|kr|kz|lt|lv|mn|mx|nl|no|nz|pl|ro|ru|si|sk|su|tv|tw|ua|uk|us|uz|ws|yu|za)).?(?::d+)?(?:(?:/|?)(?:.*?))?$/i', $site, $site)) $error = $lang['1040'];
else if(!preg_match('/^([-a-z0-9_.]+)$/i', $pass)) $error = $lang['1044'];
else{
$site = strtolower($site['1']);
if($q['site'] != $site){
$qs = mysql_query("SELECT `id` FROM `users` WHERE `site` = '$site';", $mysql);
$n = mysql_num_rows($qs);
if($n > 0){
$error = $lang['1045'];
if($n == 1){
$qs = mysql_fetch_array($qs);
$error .= ' [id:'.$qs['id'].']';
}
}
else{
if($config->conf['mod_user'] == 'on') $q['status'] = 1;
mysql_query("UPDATE `users` SET `site` = '$site', `status` = '".$q['status']."' WHERE `id` = '$id';", $mysql);
}
}
$ps = $pass;
mysql_query("UPDATE `users` SET `nick` = '$nick', `pass` = '$pass' WHERE `id` = '$id'", $mysql);
}
}
if($error){
$config->start('error', $lang['1014']);
if($config->vers == 'wml')
echo '<b>'.$lang['1014'].'!</b> '.$error.'<br/><br/>';
else
if($config->vers == 'html')
echo '<font color="'.$config->color['error'].'">'.$lang['1014'].'!</font> '.$error.'<br/><br/>';
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=prof">'.$lang['1029'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
mysql_close($mysql); $config->finish(true);
}
$config->start('prof', $lang['1022'], 'left', 'panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps, '1');
if($config->vers == 'wml') print '<small>';
echo $lang['1070'].'<br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
/******************************************************************************/
if($act == 'targ'){
$config->start('targ', $lang['1362']);
if($config->vers == 'wml') print '<small>';
################################################################################
if(isset($_GET['bann']))
{
if($_GET['bann'] == 'on') mysql_query("UPDATE `users` SET `active_bann` = '1' WHERE `id` = '$id';", $mysql);
if($_GET['bann'] == 'off') mysql_query("UPDATE `users` SET `active_bann` = '2' WHERE `id` = '$id';", $mysql);
}
if(isset($_GET['text']))
{
if($_GET['text'] == 'on') mysql_query("UPDATE `users` SET `active_text` = '1' WHERE `id` = '$id';", $mysql);
if($_GET['text'] == 'off') mysql_query("UPDATE `users` SET `active_text` = '2' WHERE `id` = '$id';", $mysql);
}
################################################################################
$q = mysql_query("SELECT `active_bann`, `active_text` FROM `users` WHERE `id` = '$id';", $mysql);
if(!$q = mysql_fetch_array($q)){ $q['active_bann'] = 2; $q['active_text'] = 2; }
if($q['active_bann'] == 1)
echo $lang['1363'].': <b>'.$lang['1065'].'</b> (<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=targ&bann=off">'.$lang['1066'].'</a>)<br/>';
else
echo $lang['1363'].': <b>'.$lang['1066'].'</b> (<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=targ&bann=on">'.$lang['1065'].'</a>)<br/>';
if($q['active_text'] == 1)
echo $lang['1364'].': <b>'.$lang['1065'].'</b> (<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=targ&text=off">'.$lang['1066'].'</a>)<br/>';
else
echo $lang['1364'].': <b>'.$lang['1066'].'</b> (<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=targ&text=on">'.$lang['1065'].'</a>)<br/>';
echo '<br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
/******************************************************************************/
if($act == 'news'){
$q = mysql_query("SELECT `status` FROM `users` WHERE `id` = '$id';", $mysql);
$q = mysql_fetch_array($q) or $q['status'] = 2;
$status = $q['status'];
################################################################################
if(($status == 7 || strpos($config->conf['admin'], '|'.$id.'|') !== false) && (isset($_GET['news']))){
$config->start('add', $lang['1124']);
if($config->vers == 'wml')
echo '<small>'.$lang['1125'].':</small><br/>'.
'<input type="text" name="news" value="" maxlength="250"/><br/>'.
'<small><anchor>'.$lang['1105'].'<go href="panel.php" method="post">'.
'<postfield name="l" value="'.$config->lang.'"/>'.
'<postfield name="v" value="wml"/>'.
'<postfield name="id" value="'.$id.'"/>'.
'<postfield name="ps" value="'.$ps.'"/>'.
'<postfield name="act" value="news"/>'.
'<postfield name="news" value="$(news)"/>'.
'</go></anchor><br/>'.
'<a href="panel.php?l='.$config->lang.'&v=wml&id='.$id.'&ps='.$ps.'&act=news">'.$lang['1027'].'</a>'.
'</small>';
else
if($config->vers == 'html')
echo '<form action="panel.php" method="post">'.
'<input type="hidden" name="l" value="'.$config->lang.'"/>'.
'<input type="hidden" name="v" value="html"/>'.
'<input type="hidden" name="id" value="'.$id.'"/>'.
'<input type="hidden" name="ps" value="'.$ps.'"/>'.
'<input type="hidden" name="act" value="news"/>'.
$lang['1125'].':<br/>'.
'<input type="text" name="news" value="" maxlength="250"/><br/>'.
'<input type="submit" value="'.$lang['1105'].'"/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v=html&id='.$id.'&ps='.$ps.'&act=news">'.$lang['1027'].'</a>'.
'</form>';
mysql_close($mysql); $config->finish(true);
}
################################################################################
if(($status == 7 || strpos($config->conf['admin'], '|'.$id.'|') !== false) && (isset($_POST['news']))){
$news = stripslashes($_POST['news']);
$news = str_replace("n", " ", $news);
$news = iconv('utf-8', 'windows-1251', $news);
$news = addslashes($news);
$news = trim($news);
$config->start('add', $lang['1124']);
if($config->vers == 'wml') print '<small>';
if(strlen($news) < 5 || strlen($news) > 250)
echo '<u>'.$lang['1126'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=news&news=add">'.$lang['1029'].'</a><br/><br/>';
else{
if(!mysql_query("INSERT INTO `news` VALUES('0', '$news', '".time()."');", $mysql)) print '<u>'.$lang['1127'].'</u><br/><br/>';
else print '<u>'.$lang['1128'].'</u><br/><br/>';
}
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=news">'.$lang['1121'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
################################################################################
if(($status == 7 || strpos($config->conf['admin'], '|'.$id.'|') !== false) && (isset($_GET['del']))){
$del = intval($_GET['del']);
if($del > 0){
mysql_query("DELETE FROM `news` WHERE `id` = '$del';", $mysql);
mysql_query("DELETE FROM `news_comment` WHERE `news` = '$del';", $mysql);
}
}
################################################################################
$config->start('news', $lang['1121']);
if($config->vers == 'wml') print '<small>';
$q = mysql_query("SELECT COUNT(`id`) FROM `news`;", $mysql);
$q = mysql_fetch_array($q) or $q['0'] = 0;
$count = $q['0'];
if($count < 1) print '<u>'.$lang['1123'].'</u><br/><br/>';
else{
$page = intval($_GET['p']);
if($page < 1) $page = 1;
$limit = $page*4-4;
if($limit >= $count){ $limit = 0; $page = 1; }
$pages = round($count/4);
if($pages*4 < $count) $pages++;
$q = mysql_query("SELECT `id`, `text`, `time` FROM `news` ORDER BY `id` DESC LIMIT $limit, 4;", $mysql);
while($d = mysql_fetch_array($q)){
echo '<b>'.date('d.m H:i', $d['time']).'</b>';
if($status == 7 || strpos($config->conf['admin'], '|'.$id.'|') !== false) echo ' [<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=news&del='.$d['id'].'&p='.$page.'">x</a>]';
echo '<br/>'.$d['text'].'<br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=news_comment&news='.$d['id'].'&comment=add">'.$lang['1130'].'</a>';
$comment = mysql_query("SELECT COUNT(`id`) FROM `news_comment` WHERE `news` = '".$d['id']."';", $mysql);
$comment = mysql_fetch_array($comment) or $comment['0'] = 0;
if($comment['0'] < 1) echo ' (0)<br/>';
else echo ' (<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=news_comment&news='.$d['id'].'">'.$comment['0'].'</a>)<br/>';
if($config->vers == 'html') echo '<font color="'.$config->color['other'].'">---</font><br/>'; else echo '---<br/>';
}
print '<br/>';
if($page > 1 || $page < $pages){
if($page > 1)
print '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=news&p='.($page-1).'">'.$lang['1g'].'</a> ';
if($page < $pages)
print '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=news&p='.($page+1).'">'.$lang['1n'].'</a>';
print '<br/><br/>';
}
}
if($status == 7 || strpos($config->conf['admin'], '|'.$id.'|') !== false) echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=news&news=add">'.$lang['1124'].'</a><br/>';
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
/******************************************************************************/
if($act == 'news_comment'){
if(isset($_GET['news'])) $news = intval($_GET['news']);
elseif(isset($_POST['news'])) $news = intval($_POST['news']);
else $news = 0;
$q = mysql_query("SELECT `id` FROM `news` WHERE `id` = '$news';", $mysql);
$q = mysql_fetch_array($q);
if(!$q){
$config->start('error', $lang['1014']);
if($config->vers == 'wml') print '<small>';
echo '<u>'.$lang['1131'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=news">'.$lang['1121'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
if(isset($_GET['comment'])) $comment = $_GET['comment'];
elseif(isset($_POST['comment'])) $comment = $_POST['comment'];
else $comment = false;
$q = mysql_query("SELECT `status` FROM `users` WHERE `id` = '$id';", $mysql);
$q = mysql_fetch_array($q) or $q['status'] = 2;
$status = $q['status'];
################################################################################
if($comment == 'add'){
$config->start('add', $lang['1130']);
if(!isset($_POST['text']))
{
$rnd = mt_rand();
if($config->vers == 'wml')
echo '<small>'.$lang['1132'].':</small><br/>'.
'<input type="text" name="text'.$rnd.'" value="" maxlength="250"/><br/>'.
'<small><anchor>'.$lang['1105'].'<go href="panel.php" method="post">'.
'<postfield name="l" value="'.$config->lang.'"/>'.
'<postfield name="v" value="wml"/>'.
'<postfield name="id" value="'.$id.'"/>'.
'<postfield name="ps" value="'.$ps.'"/>'.
'<postfield name="act" value="news_comment"/>'.
'<postfield name="news" value="'.$news.'"/>'.
'<postfield name="comment" value="add"/>'.
'<postfield name="text" value="$(text'.$rnd.')"/>'.
'</go></anchor><br/>'.
'<a href="panel.php?l='.$config->lang.'&v=wml&id='.$id.'&ps='.$ps.'&act=news_comment&news='.$news.'">'.$lang['1027'].'</a>'.
'</small>';
else
if($config->vers == 'html')
echo '<form action="panel.php" method="post">'.
'<input type="hidden" name="l" value="'.$config->lang.'"/>'.
'<input type="hidden" name="v" value="html"/>'.
'<input type="hidden" name="id" value="'.$id.'"/>'.
'<input type="hidden" name="ps" value="'.$ps.'"/>'.
'<input type="hidden" name="act" value="news_comment"/>'.
'<input type="hidden" name="news" value="'.$news.'"/>'.
'<input type="hidden" name="comment" value="add"/>'.
$lang['1132'].':<br/>'.
'<input type="text" name="text" value="" maxlength="250"/><br/>'.
'<input type="submit" value="'.$lang['1105'].'"/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v=html&id='.$id.'&ps='.$ps.'&act=news_comment&news='.$news.'">'.$lang['1027'].'</a>'.
'</form>';
}
else{
$text = stripslashes($_POST['text']);
$text = str_replace("n", " ", $text);
$text = iconv('utf-8', 'windows-1251', $text);
$text = addslashes($text);
$text = trim($text);
if($config->vers == 'wml') print '<small>';
if(strlen($text) < 5 || strlen($text) > 250)
echo '<u>'.$lang['1133'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=news_comment&news='.$news.'&comment=add">'.$lang['1029'].'</a><br/><br/>';
else{
$q = mysql_query("SELECT `time` FROM `news_comment` ORDER BY `time` DESC LIMIT 0, 1;", $mysql);
$q = mysql_fetch_array($q) or $q['time'] = 0;
if(time()-$q['time'] <= 5) print '<u>'.$lang['1136'].'</u><br/><br/>';
else{
if(!mysql_query("INSERT INTO `news_comment` VALUES('0', '$news', '$id', '$text', '".time()."');", $mysql)) print '<u>'.$lang['1134'].'</u><br/><br/>';
else print '<u>'.$lang['1135'].'</u><br/><br/>';
}
}
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=news">'.$lang['1121'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=news_comment&news='.$news.'">'.$lang['1129'].'</a><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
}
mysql_close($mysql); $config->finish(true);
}
################################################################################
if(($status == 4 || $status == 7 || strpos($config->conf['admin'], '|'.$id.'|') !== false) && ($comment == 'del') && (isset($_GET['del']))){
$del = intval($_GET['del']);
if($del > 0){
mysql_query("DELETE FROM `news_comment` WHERE `id` = '$del';", $mysql);
}
}
################################################################################
$config->start('comment', $lang['1129']);
if($config->vers == 'wml') print '<small>';
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=news_comment&news='.$news.'&comment=add">'.$lang['1130'].'</a><br/><br/>';
$q = mysql_query("SELECT COUNT(`id`) FROM `news_comment` WHERE `news` = '$news';", $mysql);
$q = mysql_fetch_array($q) or $q['0'] = 0;
$count = $q['0'];
if($count < 1) print '<u>'.$lang['1137'].'</u><br/><br/>';
else{
$page = intval($_GET['p']);
if($page < 1) $page = 1;
$limit = $page*5-5;
if($limit >= $count){ $limit = 0; $page = 1; }
$pages = round($count/5);
if($pages*5 < $count) $pages++;
$q = mysql_query("SELECT `id`, `user`, `text`, `time` FROM `news_comment` WHERE `news` = '$news' ORDER BY `id` DESC LIMIT $limit, 5;", $mysql);
while($d = mysql_fetch_array($q)){
echo '<b>'.date('d.m H:i', $d['time']).'</b>';
if($status == 4 || $status == 7 || strpos($config->conf['admin'], '|'.$id.'|') !== false) echo ' [<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=news_comment&news='.$news.'&comment=del&del='.$d['id'].'&p='.$page.'">x</a>]';
echo '<br/><u>[id='.$d['user'];
if($config->conf['nick'] == 'on')
{
$nick = mysql_query("SELECT `nick` FROM `users` WHERE `id` = '".$d['user']."';", $mysql);
$nick = mysql_fetch_array($nick) or $nick['nick'] = '';
if(strlen($nick['nick']) > 0)
{
$nick['nick'] = htmlspecialchars($nick['nick']);
$nick['nick'] = str_replace('$', '$$', $nick['nick']);
echo '; '.$nick['nick'];
}
}
echo ']</u> '.str_replace('$', '$$', htmlspecialchars($d['text'])).'<br/>';
if($config->vers == 'html') echo '<font color="'.$config->color['other'].'">---</font><br/>'; else echo '---<br/>';
}
print '<br/>';
if($page > 1 || $page < $pages){
if($page > 1)
print '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=news_comment&news='.$news.'&p='.($page-1).'">'.$lang['1n'].'</a> ';
if($page < $pages)
print '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=news_comment&news='.$news.'&p='.($page+1).'">'.$lang['1g'].'</a>';
print '<br/><br/>';
}
}
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=news">'.$lang['1121'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
/******************************************************************************/
if($act == 'pochta'){
if(isset($_GET['pochta'])) $pochta = $_GET['pochta'];
elseif(isset($_POST['pochta'])) $pochta = $_POST['pochta'];
else $pochta = false;
################################################################################
if($pochta == 'write'){
$config->start('write', $lang['1141']);
if(!isset($_POST['to']) || !isset($_POST['text']))
{
$rnd = mt_rand();
if(isset($_GET['to'])) $to = intval($_GET['to']); else $to = '';
if($config->vers == 'wml')
echo '<small>'.$lang['1142'].':</small><br/>'.
'<input type="text" name="to'.$rnd.'" value="'.$to.'" maxlength="11" format="*N"/><br/>'.
'<small>'.$lang['1143'].':</small><br/>'.
'<input type="text" name="tema'.$rnd.'" value="" maxlength="150"/><br/>'.
'<small>'.$lang['1144'].':</small><br/>'.
'<input type="text" name="text'.$rnd.'" value="" maxlength="250"/><br/>'.
'<small><anchor>'.$lang['1145'].'<go href="panel.php" method="post">'.
'<postfield name="l" value="'.$config->lang.'"/>'.
'<postfield name="v" value="wml"/>'.
'<postfield name="id" value="'.$id.'"/>'.
'<postfield name="ps" value="'.$ps.'"/>'.
'<postfield name="act" value="pochta"/>'.
'<postfield name="pochta" value="write"/>'.
'<postfield name="to" value="$(to'.$rnd.')"/>'.
'<postfield name="tema" value="$(tema'.$rnd.')"/>'.
'<postfield name="text" value="$(text'.$rnd.')"/>'.
'</go></anchor><br/>'.
'<a href="panel.php?l='.$config->lang.'&v=wml&id='.$id.'&ps='.$ps.'&act=pochta">'.$lang['1027'].'</a>'.
'</small>';
else
if($config->vers == 'html')
echo '<form action="panel.php" method="post">'.
'<input type="hidden" name="l" value="'.$config->lang.'"/>'.
'<input type="hidden" name="v" value="html"/>'.
'<input type="hidden" name="id" value="'.$id.'"/>'.
'<input type="hidden" name="ps" value="'.$ps.'"/>'.
'<input type="hidden" name="act" value="pochta"/>'.
'<input type="hidden" name="pochta" value="write"/>'.
$lang['1142'].':<br/>'.
'<input type="text" name="to" value="'.$to.'" maxlength="11"/><br/>'.
$lang['1143'].':<br/>'.
'<input type="text" name="tema" value="" maxlength="150"/><br/>'.
$lang['1144'].':<br/>'.
'<input type="text" name="text" value="" maxlength="250"/><br/>'.
'<input type="submit" value="'.$lang['1145'].'"/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v=html&id='.$id.'&ps='.$ps.'&act=pochta">'.$lang['1027'].'</a>'.
'</form>';
}
else
{
$error = false;
$to = intval($_POST['to']);
$tema = stripslashes($_POST['tema']);
$tema = str_replace("n", " ", $tema);
$tema = iconv('utf-8', 'windows-1251', $tema);
$tema = addslashes($tema);
$tema = trim($tema);
$text = stripslashes($_POST['text']);
$text = str_replace("n", " ", $text);
$text = iconv('utf-8', 'windows-1251', $text);
$text = addslashes($text);
$text = trim($text);
$q = mysql_query("SELECT `id` FROM `users` WHERE `id` = '$to';", $mysql);
$q = mysql_fetch_array($q);
if(!$q) $error = $lang['1025'];
elseif(strlen($tema) > 150) $error = $lang['1148'];
elseif(strlen($text) < 2 || strlen($text) > 250) $error = $lang['1149'];
else{
$q = mysql_query("SELECT `time` FROM `pochta` WHERE `from` = '$id' && `status` = '1' ORDER BY `time` DESC LIMIT 0, 1;", $mysql);
$q = mysql_fetch_array($q) or $q['time'] = 0;
if(time()-$q['time'] <= 5) $error = $lang['1150'];
else
mysql_query("INSERT INTO `pochta` VALUES('0', '$to', '$id', '$tema', '$text', '1', '".time()."', '1'), ('0', '$to', '$id', '$tema', '$text', '2', '".time()."', '2');", $mysql) or $error = $lang['1147'];
}
if($config->vers == 'wml') print '<small>';
if($error)
echo '<u>'.$error.'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=pochta&pochta=write">'.$lang['1029'].'</a><br/><br/>';
else
echo '<u>'.$lang['1146'].'</u><br/><br/>';
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=pochta">'.$lang['1138'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
}
mysql_close($mysql); $config->finish(true);
}
################################################################################
if($pochta == 'clean'){
$config->start('clean', $lang['1328']);
if(!mysql_query("DELETE FROM `pochta` WHERE `to` = '$id' && `status` = '1';", $mysql)) $error = true;
elseif(!mysql_query("DELETE FROM `pochta` WHERE `from` = '$id' && `status` = '2';", $mysql)) $error = true;
if($config->vers == 'wml') print '<small>';
if($error)
echo '<u>'.$lang['1330'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=pochta&pochta=write">'.$lang['1029'].'</a><br/><br/>';
else
echo '<u>'.$lang['1329'].'</u><br/><br/>';
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=pochta">'.$lang['1138'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
################################################################################
if($pochta == 'in'){
$config->start('inbox', $lang['1139']);
if($config->vers == 'wml') print '<small>';
if(isset($_GET['mes'])){
$mes = intval($_GET['mes']);
$q = mysql_query("SELECT `from`, `tema`, `text`, `read`, `time` FROM `pochta` WHERE `id` = '$mes' && `to` = '$id' && `status` = '1';", $mysql);
$q = mysql_fetch_array($q);
if($q){
if($q['read'] == '1') mysql_query("UPDATE `pochta` SET `read` = '2' WHERE `id` = '$mes';", $mysql);
echo '<u>'.$lang['1152'].':</u> id='.$q['from'];
if($config->conf['nick'] == 'on')
{
$nick = mysql_query("SELECT `nick` FROM `users` WHERE `id` = '".$q['from']."';", $mysql);
$nick = mysql_fetch_array($nick) or $nick['nick'] = '';
if(strlen($nick['nick']) > 0)
{
$nick['nick'] = htmlspecialchars($nick['nick']);
$nick['nick'] = str_replace('$', '$$', $nick['nick']);
echo '; '.$nick['nick'];
}
}
echo '<br/>';
if(strlen($q['tema']) > 0){
$q['tema'] = htmlspecialchars($q['tema']);
$q['tema'] = str_replace('$', '$$', $q['tema']);
echo '<u>'.$lang['1143'].':</u> '.$q['tema'].'<br/>';
}
$q['text'] = htmlspecialchars($q['text']);
$q['text'] = str_replace('$', '$$', $q['text']);
$q['text'] = str_replace("n", '<br/>', $q['text']);
echo '<u>'.$lang['1154'].':</u> '.date('d.m.y H:i:s', $q['time']).'<br/>'.
'<u>'.$lang['1144'].':</u> '.$q['text'].'<br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=pochta&pochta=write&to='.$q['from'].'">'.$lang['1155'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=pochta&pochta=in&del='.$mes.'">'.$lang['1116'].'</a><br/><br/>'.
'<img src="/images/act.png" alt=""><a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=pochta&pochta=in">'.$lang['1139'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=pochta">'.$lang['1138'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
}
if(isset($_GET['del'])){
if($_GET['del'] == 'all')
{
mysql_query("DELETE FROM `pochta` WHERE `to` = '$id' && `status` = '1';", $mysql);
}
else
{
$del = intval($_GET['del']);
mysql_query("DELETE FROM `pochta` WHERE `id` = '$del' && `to` = '$id' && `status` = '1';", $mysql);
}
}
$q = mysql_query("SELECT COUNT(`id`) FROM `pochta` WHERE `to` = '$id' && `status` = '1';", $mysql);
$q = mysql_fetch_array($q) or $q['0'] = 0;
$count = $q['0'];
if($count < 1) print '<u>'.$lang['1151'].'</u><br/><br/>';
else{
$page = intval($_GET['p']);
if($page < 1) $page = 1;
$limit = $page*10-10;
if($limit >= $count){ $limit = 0; $page = 1; }
$pages = round($count/10);
if($pages*10 < $count) $pages++;
$q = mysql_query("SELECT `id`, `from`, `tema`, `read` FROM `pochta` WHERE `to` = '$id' && `status` = '1' ORDER BY `id` DESC LIMIT $limit, 10;", $mysql);
while($d = mysql_fetch_array($q)){
if($d['read'] == 1) echo '<b>';
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=pochta&pochta=in&mes='.$d['id'].'">'.
'[id='.$d['from'];
if($config->conf['nick'] == 'on')
{
$nick = mysql_query("SELECT `nick` FROM `users` WHERE `id` = '".$d['from']."';", $mysql);
$nick = mysql_fetch_array($nick) or $nick['nick'] = '';
if(strlen($nick['nick']) > 0)
{
$nick['nick'] = htmlspecialchars($nick['nick']);
$nick['nick'] = str_replace('$', '$$', $nick['nick']);
if(strlen($nick['nick']) > 20) $nick['nick'] = substr($nick['nick'], 0, 17).'...';
echo '; '.$nick['nick'];
}
}
echo ']';
if($d['tema']){
if(strlen($d['tema']) > 30) $d['tema'] = substr($d['tema'], 0, 27).'...';
$d['tema'] = htmlspecialchars($d['tema']);
$d['tema'] = str_replace('$', '$$', $d['tema']);
echo ' '.$d['tema'];
}
echo '</a>';
if($d['read'] == 1) echo '</b>';
echo ' [<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=pochta&pochta=in&p='.$page.'&del='.$d['id'].'">x</a>]<br/>';
}
print '<br/>';
if($page > 1 || $page < $pages){
if($page > 1)
print '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=pochta&pochta=in&p='.($page-1).'">'.$lang['1n'].'</a> ';
if($page < $pages)
print '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=pochta&pochta=in&p='.($page+1).'">'.$lang['1g'].'</a>';
print '<br/><br/>';
}
}
if($count > 0) echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=pochta&pochta=in&del=all">'.$lang['1328'].'</a><br/>';
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=pochta">'.$lang['1138'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
################################################################################
if($pochta == 'out'){
$config->start('outbox', $lang['1140']);
if($config->vers == 'wml') print '<small>';
if(isset($_GET['mes'])){
$mes = intval($_GET['mes']);
$q = mysql_query("SELECT `to`, `tema`, `text`, `time` FROM `pochta` WHERE `id` = '$mes' && `from` = '$id' && `status` = '2';", $mysql);
$q = mysql_fetch_array($q);
if($q){
echo '<u>'.$lang['1153'].':</u> id='.$q['to'];
if($config->conf['nick'] == 'on')
{
$nick = mysql_query("SELECT `nick` FROM `users` WHERE `id` = '".$q['to']."';", $mysql);
$nick = mysql_fetch_array($nick) or $nick['nick'] = '';
if(strlen($nick['nick']) > 0)
{
$nick['nick'] = htmlspecialchars($nick['nick']);
$nick['nick'] = str_replace('$', '$$', $nick['nick']);
echo '; '.$nick['nick'];
}
}
echo '<br/>';
if($q['tema']){
$q['tema'] = htmlspecialchars($q['tema']);
$q['tema'] = str_replace('$', '$$', $q['tema']);
echo '<u>'.$lang['1143'].':</u> '.$q['tema'].'<br/>';
}
$q['text'] = htmlspecialchars($q['text']);
$q['text'] = str_replace('$', '$$', $q['text']);
$q['text'] = str_replace("n", '<br/>', $q['text']);
echo '<u>'.$lang['1154'].':</u> '.date('d.m.y H:i:s', $q['time']).'<br/>'.
'<u>'.$lang['1144'].':</u> '.$q['text'].'<br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=pochta&pochta=out&del='.$mes.'">'.$lang['1116'].'</a><br/><br/>'.
'<img src="/images/act.png" alt=""><a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=pochta&pochta=out">'.$lang['1140'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=pochta">'.$lang['1138'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
}
if(isset($_GET['del'])){
if($_GET['del'] == 'all')
{
mysql_query("DELETE FROM `pochta` WHERE `from` = '$id' && `status` = '2';", $mysql);
}
else
{
$del = intval($_GET['del']);
mysql_query("DELETE FROM `pochta` WHERE `id` = '$del' && `from` = '$id' && `status` = '2';", $mysql);
}
}
$q = mysql_query("SELECT COUNT(`id`) FROM `pochta` WHERE `from` = '$id' && `status` = '2';", $mysql);
$q = mysql_fetch_array($q) or $q['0'] = 0;
$count = $q['0'];
if($count < 1) print '<u>'.$lang['1151'].'</u><br/><br/>';
else{
$page = intval($_GET['p']);
if($page < 1) $page = 1;
$limit = $page*10-10;
if($limit >= $count){ $limit = 0; $page = 1; }
$pages = round($count/10);
if($pages*10 < $count) $pages++;
$q = mysql_query("SELECT `id`, `to`, `tema` FROM `pochta` WHERE `from` = '$id' && `status` = '2' ORDER BY `id` DESC LIMIT $limit, 10;", $mysql);
while($d = mysql_fetch_array($q)){
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=pochta&pochta=out&mes='.$d['id'].'">'.
'[id='.$d['to'];
if($config->conf['nick'] == 'on')
{
$nick = mysql_query("SELECT `nick` FROM `users` WHERE `id` = '".$d['to']."';", $mysql);
$nick = mysql_fetch_array($nick) or $nick['nick'] = '';
if(strlen($nick['nick']) > 0)
{
$nick['nick'] = htmlspecialchars($nick['nick']);
$nick['nick'] = str_replace('$', '$$', $nick['nick']);
if(strlen($nick['nick']) > 20) $nick['nick'] = substr($nick['nick'], 0, 17).'...';
echo '; '.$nick['nick'];
}
}
echo ']';
if(strlen($d['tema']) > 0){
if(strlen($d['tema']) > 30) $d['tema'] = substr($d['tema'], 0, 27).'...';
$d['tema'] = htmlspecialchars($d['tema']);
$d['tema'] = str_replace('$', '$$', $d['tema']);
echo ' '.$d['tema'];
}
echo '</a>';
echo ' [<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=pochta&pochta=out&p='.$page.'&del='.$d['id'].'">x</a>]<br/>';
}
print '<br/>';
if($page > 1 || $page < $pages){
if($page > 1)
print '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=pochta&pochta=out&p='.($page-1).'">'.$lang['1n'].'</a> ';
if($page < $pages)
print '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=pochta&pochta=out&p='.($page+1).'">'.$lang['1g'].'</a>';
print '<br/><br/>';
}
}
if($count > 0) echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=pochta&pochta=out&del=all">'.$lang['1328'].'</a><br/>';
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=pochta">'.$lang['1138'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
################################################################################
$config->start('pochta', $lang['1138']);
if($config->vers == 'wml') print '<small>';
$q = mysql_query("SELECT COUNT(`id`) FROM `pochta` WHERE `to` = '$id' && `read` = '1' && `status` = '1';", $mysql);
$q = mysql_fetch_array($q) or $q['0'] = 0;
$new = $q['0'];
$q = mysql_query("SELECT COUNT(`id`) FROM `pochta` WHERE `to` = '$id' && `status` = '1';", $mysql);
$q = mysql_fetch_array($q) or $q['0'] = 0;
$in = $q['0'];
$q = mysql_query("SELECT COUNT(`id`) FROM `pochta` WHERE `from` = '$id' && `status` = '2';", $mysql);
$q = mysql_fetch_array($q) or $q['0'] = 0;
$out = $q['0'];
echo '<img src="/images/act.png" alt=""> <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=pochta&pochta=in">'.$lang['1139'].'</a> (';
if($new > 0) print '<b>'.$new.'</b>/';
echo $in.')<br/>'.
'<img src="/images/act.png" alt=""> <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=pochta&pochta=out">'.$lang['1140'].'</a> ('.$out.')<br/>'.
'<img src="/images/act.png" alt=""> <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=pochta&pochta=write">'.$lang['1141'].'</a><br/>';
if($in > 0 || $out > 0) echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=pochta&pochta=clean">'.$lang['1328'].'</a><br/>';
echo '<br/><a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
/******************************************************************************/
if($act == 'check'){
$config->start('check', $lang['1294']);
if($config->vers == 'wml') print '<small>';
if($config->conf['mod_avto'] == 'off'){
echo '<u>'.$lang['1295'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
$q = mysql_query("SELECT `site`, `status` FROM `users` WHERE `id` = '$id';", $mysql);
$q = mysql_fetch_array($q) or $q = array('site' => 'Unknown', 'status' => '2');
if($q['status'] != 1){
echo '<u>'.$lang['1296'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
if(!isset($_GET['check'])){
echo '<u>'.$lang['1297'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=check&check=yes">'.$lang['1028'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1027'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
$file = file_get_contents('http://'.$q['site'].'/') or $file = '';
if(preg_match('/.+(?:<as+hrefs*=s*"s*http://'.str_replace('.', '.', $config->site).'/c.php?(?:id=)?'.$id.'s*"s*>s*<imgs+srcs*=s*"s*http://'.str_replace('.', '.', $config->site).'/b.php?(?:id=)?'.$id.'s*"s+alts*=s*"s*'.str_replace('.', '.', $config->site).'s*"s*/>s*</s*as*>|<as+hrefs*=s*"s*http://'.str_replace('.', '.', $config->site).'/t.php?(?:id=)?'.$id.'s*"s*>[^<>]+</s*as*>).+/s', $file)){
mysql_query("UPDATE `users` SET `status` = '3' WHERE `id` = '$id';", $mysql);
echo '<u>'.$lang['1298'].'</u><br/><br/>';
}
else echo '<u>'.$lang['1299'].'</u><br/><br/>';
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
/******************************************************************************/
if($act == 'ma'){
$q = mysql_query("SELECT `status` FROM `users` WHERE `id` = '$id';", $mysql);
$q = mysql_fetch_array($q) or $q['status'] = 2;
if($q['status'] != 4 && $q['status'] != 5 && $q['status'] != 7 && strpos($config->conf['admin'], '|'.$id.'|') === false){
mysql_query("UPDATE `users` SET `status` = '2' WHERE `id` = '$id';", $mysql);
$config->start('ban', '');
if($config->vers == 'wml') print '<small>';
echo '<u>'.$lang['1303'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
$config->start('ma', $lang['1304']);
if($config->vers == 'wml') print '<small>';
if(isset($_GET['ok'])){
$ok = intval($_GET['ok']);
mysql_query("UPDATE `users` SET `status` = '3' WHERE `id` = '$ok' && `status` = '1';", $mysql);
}
elseif(isset($_GET['no'])){
$no = intval($_GET['no']);
mysql_query("UPDATE `users` SET `status` = '2' WHERE `id` = '$no' && `status` = '1';", $mysql);
}
$q = mysql_query("SELECT COUNT(*) FROM `users` WHERE `status` = '1';", $mysql);
$q = mysql_fetch_array($q) or $q['0'] = 0;
$count = $q['0'];
if($count < 1) print '<u>'.$lang['1306'].'</u><br/><br/>';
else{
$page = intval($_GET['p']);
if($page < 1) $page = 1;
$limit = $page*10-10;
if($limit >= $count){ $limit = 0; $page = 1; }
$pages = round($count/10);
if($pages*10 < $count) $pages++;
$q = mysql_query("SELECT `id`, `site`, `time` FROM `users` WHERE `status` = '1' ORDER BY `time` DESC LIMIT $limit, 10;", $mysql);
$num = 1;
while($d = mysql_fetch_array($q)){
echo '<b>'.($limit+$num).'.</b> <u>['.date('d.m H:i', $d['time']).']</u> '.
'<a href="go.php?http://'.$d['site'].'">'.$d['site'].'</a> ID: '.$d['id'].' '.
'[<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=ma&p='.$page.'&ok='.$d['id'].'">OK</a>]'.
'[<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=ma&p='.$page.'&no='.$d['id'].'">NO</a>]'.
'<br/>';
$num++;
}
print '<br/>';
if($page > 1 || $page < $pages){
if($page > 1)
print '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=ma&p='.($page-1).'"><--</a> ';
if($page < $pages)
print '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=ma&p='.($page+1).'">--></a>';
print '<br/><br/>';
}
}
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
/******************************************************************************/
if($act == 'mb'){
$q = mysql_query("SELECT `status` FROM `users` WHERE `id` = '$id';", $mysql);
$q = mysql_fetch_array($q) or $q['status'] = 2;
if($q['status'] != 4 && $q['status'] != 5 && $q['status'] != 7 && strpos($config->conf['admin'], '|'.$id.'|') === false){
mysql_query("UPDATE `users` SET `status` = '2' WHERE `id` = '$id';", $mysql);
$config->start('ban', '');
if($config->vers == 'wml') print '<small>';
echo '<u>'.$lang['1303'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
$config->start('mod', $lang['1305']);
if($config->vers == 'wml') print '<small>';
if(isset($_GET['ok'])){
$ok = intval($_GET['ok']);
mysql_query("UPDATE `banners` SET `status` = '3' WHERE `id` = '$ok' && `status` = '1';", $mysql);
}
elseif(isset($_GET['no'])){
$no = intval($_GET['no']);
mysql_query("UPDATE `banners` SET `status` = '2' WHERE `id` = '$no' && `status` = '1';", $mysql);
}
$q = mysql_query("SELECT COUNT(*) FROM `banners` WHERE `status` = '1';", $mysql);
$q = mysql_fetch_array($q) or $q['0'] = 0;
$count = $q['0'];
if($count < 1) print '<u>'.$lang['1307'].'</u><br/><br/>';
else{
$page = intval($_GET['p']);
if($page < 1) $page = 1;
$limit = $page*5-5;
if($limit >= $count){ $limit = 0; $page = 1; }
$pages = round($count/5);
if($pages*5 < $count) $pages++;
$q = mysql_query("SELECT `id`, `ud` FROM `banners` WHERE `status` = '1' ORDER BY `id` DESC LIMIT $limit, 5;", $mysql);
$num = 1;
while($d = mysql_fetch_array($q)){
echo '<b>'.($limit+$num).'.</b> '.
'<img src="banner.php?id='.$d['id'].'" alt=""/> ID: '.$d['ud'].' '.
'[<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=mb&p='.$page.'&ok='.$d['id'].'">OK</a>]'.
'[<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=mb&p='.$page.'&no='.$d['id'].'">NO</a>]'.
'<br/>';
$num++;
}
print '<br/>';
if($page > 1 || $page < $pages){
if($page > 1)
print '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=mb&p='.($page-1).'"><--</a> ';
if($page < $pages)
print '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=mb&p='.($page+1).'">--></a>';
print '<br/><br/>';
}
}
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
/******************************************************************************/
if($act == 'dc'){
if(strpos($config->conf['admin'], '|'.$id.'|') === false){
mysql_query("UPDATE `users` SET `status` = '2' WHERE `id` = '$id';", $mysql);
$config->start('ban', '');
if($config->vers == 'wml') print '<small>';
echo '<u>'.$lang['1303'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
$config->start('dc', $lang['1308']);
if(!isset($_POST['credit']))
{
if($config->vers == 'wml')
echo '<small>'.$lang['1246'].':</small><br/>'.
'<input type="text" name="user" value="" maxlength="11" format="*N"/><br/>'.
'<small>'.$lang['1255'].':</small><br/>'.
'<input type="text" name="credit" value="" maxlength="11" format="*N"/>'.
'<select name="from" value="1">'.
'<option value="1">'.$lang['1334'].'</option>'.
'<option value="2">'.$lang['1335'].'</option>'.
'</select><br/>'.
'<small><anchor>'.$lang['1028'].'<go href="panel.php" method="post">'.
'<postfield name="l" value="'.$config->lang.'"/>'.
'<postfield name="v" value="wml"/>'.
'<postfield name="id" value="'.$id.'"/>'.
'<postfield name="ps" value="'.$ps.'"/>'.
'<postfield name="act" value="dc"/>'.
'<postfield name="user" value="$(user)"/>'.
'<postfield name="credit" value="$(credit)"/>'.
'<postfield name="from" value="$(from)"/>'.
'</go></anchor><br/>'.
'<a href="panel.php?l='.$config->lang.'&v=wml&id='.$id.'&ps='.$ps.'">'.$lang['1027'].'</a>'.
'</small>';
else
if($config->vers == 'html')
echo '<form action="panel.php" method="post">'.
'<input type="hidden" name="l" value="'.$config->lang.'"/>'.
'<input type="hidden" name="v" value="html"/>'.
'<input type="hidden" name="id" value="'.$id.'"/>'.
'<input type="hidden" name="ps" value="'.$ps.'"/>'.
'<input type="hidden" name="act" value="dc"/>'.
$lang['1246'].':<br/>'.
'<input type="text" name="user" value="" maxlength="11"/><br/>'.
$lang['1255'].':<br/>'.
'<input type="text" name="credit" value="" maxlength="11"/>'.
'<select name="from" value="1">'.
'<option value="1">'.$lang['1334'].'</option>'.
'<option value="2">'.$lang['1335'].'</option>'.
'</select><br/>'.
'<input type="submit" value="'.$lang['1028'].'"/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v=html&id='.$id.'&ps='.$ps.'">'.$lang['1027'].'</a>'.
'</form>';
}
else
{
if($config->vers == 'wml') print '<small>';
$user = intval($_POST['user']);
$credit = intval($_POST['credit']);
$from = intval($_POST['from']);
if($user < 1 || $credit < 1){
echo '<u>'.$lang['1309'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=dc">'.$lang['1029'].'</a><br/>';
}
else{
if($from == 1){ $q = mysql_query("SELECT `credit` FROM `users` WHERE `id` = '$user';", $mysql); }
else{ $q = mysql_query("SELECT `bank` FROM `users` WHERE `id` = '$user';", $mysql); }
$q = mysql_fetch_array($q);
if(!$q){
echo '<u>'.$lang['1309'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=dc">'.$lang['1029'].'</a><br/>';
}
else{
if($from == 1){ $q['credit'] -= $credit; $sql = "UPDATE `users` SET `credit` = '".$q['credit']."' WHERE `id` = '$user';"; }
else{ $q['bank'] -= $credit; $sql = "UPDATE `users` SET `bank` = '".$q['bank']."' WHERE `id` = '$user';"; }
if(!mysql_query($sql, $mysql)){
echo '<u>'.$lang['1309'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=dc">'.$lang['1029'].'</a><br/>';
}
else
{
if($from == 1)
echo '<u>'.str_ireplace('%credit%', $q['credit'], $lang['1310']).'</u><br/><br/>';
else
echo '<u>'.str_ireplace('%credit%', $q['bank'], $lang['1310']).'</u><br/><br/>';
}
}
}
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
}
mysql_close($mysql); $config->finish(true);
}
/******************************************************************************/
if($act == 'st'){
if(strpos($config->conf['admin'], '|'.$id.'|') === false){
mysql_query("UPDATE `users` SET `status` = '2' WHERE `id` = '$id';", $mysql);
$config->start('ban', '');
if($config->vers == 'wml') print '<small>';
echo '<u>'.$lang['1303'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
$config->start('st', $lang['1311']);
if(!isset($_POST['status']))
{
if($config->vers == 'wml')
echo '<small>'.$lang['1312'].':</small><br/>'.
'<input type="text" name="user" value="" maxlength="11" format="*N"/><br/>'.
'<small>'.$lang['1313'].':</small> '.
'<select name="status" value="1">'.
'<option value="1">'.$lang['1314'].'</option>'.
'<option value="2">'.$lang['1315'].'</option>'.
'<option value="3">'.$lang['1316'].'</option>'.
'<option value="4">'.$lang['1317'].'</option>'.
'<option value="5">'.$lang['1332'].'</option>'.
'<option value="6">'.$lang['1333'].'</option>'.
'<option value="7">'.$lang['1318'].'</option>'.
'<option value="8">'.$lang['1319'].'</option>'.
'</select><br/>'.
'<small><anchor>'.$lang['1028'].'<go href="panel.php" method="post">'.
'<postfield name="l" value="'.$config->lang.'"/>'.
'<postfield name="v" value="wml"/>'.
'<postfield name="id" value="'.$id.'"/>'.
'<postfield name="ps" value="'.$ps.'"/>'.
'<postfield name="act" value="st"/>'.
'<postfield name="user" value="$(user)"/>'.
'<postfield name="status" value="$(status)"/>'.
'</go></anchor><br/>'.
'<a href="panel.php?l='.$config->lang.'&v=wml&id='.$id.'&ps='.$ps.'">'.$lang['1027'].'</a>'.
'</small>';
else
if($config->vers == 'html')
echo '<form action="panel.php" method="post">'.
'<input type="hidden" name="l" value="'.$config->lang.'"/>'.
'<input type="hidden" name="v" value="html"/>'.
'<input type="hidden" name="id" value="'.$id.'"/>'.
'<input type="hidden" name="ps" value="'.$ps.'"/>'.
'<input type="hidden" name="act" value="st"/>'.
$lang['1312'].':<br/>'.
'<input type="text" name="user" value="" maxlength="11"/><br/>'.
$lang['1313'].': '.
'<select name="status" value="1">'.
'<option value="1">'.$lang['1314'].'</option>'.
'<option value="2">'.$lang['1315'].'</option>'.
'<option value="3">'.$lang['1316'].'</option>'.
'<option value="4">'.$lang['1317'].'</option>'.
'<option value="5">'.$lang['1332'].'</option>'.
'<option value="6">'.$lang['1333'].'</option>'.
'<option value="7">'.$lang['1318'].'</option>'.
'<option value="8">'.$lang['1319'].'</option>'.
'</select><br/>'.
'<input type="submit" value="'.$lang['1028'].'"/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v=html&id='.$id.'&ps='.$ps.'">'.$lang['1027'].'</a>'.
'</form>';
}
else
{
if($config->vers == 'wml') print '<small>';
$user = intval($_POST['user']);
$status = intval($_POST['status']);
if($user < 1 || $status < 1 || $status > 8){
echo '<u>'.$lang['1321'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=st">'.$lang['1029'].'</a><br/>';
}
elseif($status == 8){
if(!mysql_query("DELETE FROM `users` WHERE `id` = '$user';", $mysql)){
echo '<u>'.$lang['1323'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=st">'.$lang['1029'].'</a><br/>';
}
else{
mysql_query("DELETE FROM `banners` WHERE `ud` = '$user';", $mysql);
echo '<u>'.$lang['1322'].'</u><br/><br/>';
}
}
else{
if(!mysql_query("UPDATE `users` SET `status` = '$status' WHERE `id` = '$user';", $mysql)){
echo '<u>'.$lang['1321'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=st">'.$lang['1029'].'</a><br/>';
}
else
echo '<u>'.$lang['1320'].'</u><br/><br/>';
}
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
}
mysql_close($mysql); $config->finish(true);
}
/******************************************************************************/
if($act == 'edit'){
if(strpos($config->conf['admin'], '|'.$id.'|') === false){
mysql_query("UPDATE `users` SET `status` = '2' WHERE `id` = '$id';", $mysql);
$config->start('ban', '');
if($config->vers == 'wml') print '<small>';
echo '<u>'.$lang['1303'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
if(isset($_GET['user'])) $user = $_GET['user'];
elseif(isset($_POST['user'])) $user = $_POST['user'];
else $user = false;
$config->start('edit', $lang['1324']);
if(!$user){
if($config->vers == 'wml')
echo '<small>'.$lang['1312'].':</small><br/>'.
'<input type="text" name="user" value="" maxlength="11" format="*N"/><br/>'.
'<small><anchor>'.$lang['1028'].'<go href="panel.php" method="post">'.
'<postfield name="l" value="'.$config->lang.'"/>'.
'<postfield name="v" value="wml"/>'.
'<postfield name="id" value="'.$id.'"/>'.
'<postfield name="ps" value="'.$ps.'"/>'.
'<postfield name="act" value="edit"/>'.
'<postfield name="user" value="$(user)"/>'.
'</go></anchor><br/>'.
'<a href="panel.php?l='.$config->lang.'&v=wml&id='.$id.'&ps='.$ps.'">'.$lang['1027'].'</a>'.
'</small>';
else
if($config->vers == 'html')
echo '<form action="panel.php" method="post">'.
'<input type="hidden" name="l" value="'.$config->lang.'"/>'.
'<input type="hidden" name="v" value="html"/>'.
'<input type="hidden" name="id" value="'.$id.'"/>'.
'<input type="hidden" name="ps" value="'.$ps.'"/>'.
'<input type="hidden" name="act" value="edit"/>'.
$lang['1312'].':<br/>'.
'<input type="text" name="user" value="" maxlength="11"/><br/>'.
'<input type="submit" value="'.$lang['1028'].'"/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v=html&id='.$id.'&ps='.$ps.'">'.$lang['1027'].'</a>'.
'</form>';
mysql_close($mysql); $config->finish(true);
}
$q = mysql_query("SELECT `nick`, `site`, `mail`, `pass` FROM `users` WHERE `id` = '$user';", $mysql);
$q = mysql_fetch_array($q);
if(!$q){
if($config->vers == 'wml') print '<small>';
echo '<u>'.$lang['1025'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=edit">'.$lang['1029'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
$q['nick'] = htmlspecialchars($q['nick']);
$q['nick'] = str_replace('$', '$$', $q['nick']);
if(!isset($_POST['nick']) || !isset($_POST['site']) || !isset($_POST['mail']) || !isset($_POST['pass']))
{
$rnd = mt_rand();
if($config->vers == 'wml')
echo '<small>'.$lang['1325'].':</small><br/>'.
'<input type="text" name="mail'.$rnd.'" value="'.$q['mail'].'" maxlength="150"/><br/>'.
'<small>'.$lang['1036'].':</small><br/>'.
'<input type="text" name="site'.$rnd.'" value="http://'.$q['site'].'" maxlength="150"/><br/>'.
'<small>'.$lang['1021'].':</small><br/>'.
'<input type="text" name="pass'.$rnd.'" value="'.$q['pass'].'" maxlength="150"/><br/>'.
'<small>'.$lang['1326'].':</small><br/>'.
'<input type="text" name="nick'.$rnd.'" value="'.$q['nick'].'" maxlength="30"/><br/>'.
'<small><anchor>'.$lang['1061'].'<go href="panel.php" method="post">'.
'<postfield name="l" value="'.$config->lang.'"/>'.
'<postfield name="v" value="wml"/>'.
'<postfield name="id" value="'.$id.'"/>'.
'<postfield name="ps" value="'.$ps.'"/>'.
'<postfield name="act" value="edit"/>'.
'<postfield name="user" value="'.$user.'"/>'.
'<postfield name="mail" value="$(mail'.$rnd.')"/>'.
'<postfield name="site" value="$(site'.$rnd.')"/>'.
'<postfield name="pass" value="$(pass'.$rnd.')"/>'.
'<postfield name="nick" value="$(nick'.$rnd.')"/>'.
'</go></anchor><br/>'.
'<a href="panel.php?l='.$config->lang.'&v=wml&id='.$id.'&ps='.$ps.'">'.$lang['1027'].'</a>'.
'</small>';
else
if($config->vers == 'html')
echo '<form action="panel.php" method="post">'.
'<input type="hidden" name="l" value="'.$config->lang.'"/>'.
'<input type="hidden" name="v" value="html"/>'.
'<input type="hidden" name="id" value="'.$id.'"/>'.
'<input type="hidden" name="ps" value="'.$ps.'"/>'.
'<input type="hidden" name="act" value="edit"/>'.
'<input type="hidden" name="user" value="'.$user.'"/>'.
$lang['1325'].':<br/>'.
'<input type="text" name="mail" value="'.$q['mail'].'" maxlength="150"/><br/>'.
$lang['1036'].':<br/>'.
'<input type="text" name="site" value="http://'.$q['site'].'" maxlength="150"/><br/>'.
$lang['1021'].':<br/>'.
'<input type="text" name="pass" value="'.$q['pass'].'" maxlength="150"/><br/>'.
$lang['1326'].':<br/>'.
'<input type="text" name="nick" value="'.$q['nick'].'" maxlength="30"/><br/>'.
'<input type="submit" value="'.$lang['1061'].'"/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v=html&id='.$id.'&ps='.$ps.'">'.$lang['1027'].'</a>'.
'</form>';
}
else
{
$nick = trim($_POST['nick']);
$site = trim($_POST['site']);
$mail = trim($_POST['mail']);
$pass = trim($_POST['pass']);
$error = false;
if(strlen($nick) > 1)
{
$nick = stripslashes($nick);
$nick = str_replace("n", " ", $nick);
$nick = iconv('utf-8', 'windows-1251', $nick);
$nick = addslashes($nick);
}
if(strlen($nick) > 30) $error = $lang['1327'];
else if($site == 'http://') $error = $lang['1040'];
else if(strlen($site) > 150) $error = $lang['1040'];
else if(strlen($mail) > 150) $error = $lang['1042'];
else if(strlen($pass) > 150) $error = $lang['1044'];
else if(!preg_match('/^(?:http://)?((?:[-a-z0-9_]+.)*(?:info|mobi|name|biz|com|net|org|ae|au|az|be|br|by|bz|ca|cc|ch|cn|cz|de|dk|do|ee|eo|es|eu|fi|fr|hu|il|in|iz|jp|kg|kr|kz|lt|lv|mn|mx|nl|no|nz|pl|ro|ru|si|sk|su|tv|tw|ua|uk|us|uz|ws|yu|za)).?(?::d+)?(?:(?:/|?)(?:.*?))?$/i', $site, $site)) $error = $lang['1040'];
else if(!preg_match('/^([-a-z0-9_.]+)@((?:[-a-z0-9_]+.)*(?:info|mobi|name|biz|com|net|org|ae|au|az|be|br|by|bz|ca|cc|ch|cn|cz|de|dk|do|ee|eo|es|eu|fi|fr|hu|il|in|iz|jp|kg|kr|kz|lt|lv|mn|mx|nl|no|nz|pl|ro|ru|si|sk|su|tv|tw|ua|uk|us|uz|ws|yu|za)).?$/i', $mail, $mail)) $error = $lang['1042'];
else if(!preg_match('/^([-a-z0-9_.]+)$/i', $pass)) $error = $lang['1044'];
else{
$site = strtolower($site['1']);
$mail = strtolower($mail['1'].'@'.$mail['2']);
mysql_query("UPDATE `users` SET `nick` = '$nick', `site` = '$site', `mail` = '$mail', `pass` = '$pass' WHERE `id` = '$user';", $mysql);
}
if($config->vers == 'wml') print '<small>';
if($error)
echo '<u>'.$error.'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=edit&user='.$user.'">'.$lang['1029'].'</a><br/>';
else echo '<u>'.$lang['1070'].'</u><br/><br/>';
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
}
mysql_close($mysql); $config->finish(true);
}
/******************************************************************************/
if($act == 'show'){
if(strpos($config->conf['admin'], '|'.$id.'|') === false){
mysql_query("UPDATE `users` SET `status` = '2' WHERE `id` = '$id';", $mysql);
$config->start('ban', '');
if($config->vers == 'wml') print '<small>';
echo '<u>'.$lang['1303'].'</u><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
if(isset($_GET['status'])) $status = intval($_GET['status']);
elseif(isset($_POST['status'])) $status = intval($_POST['status']);
else $status = 0;
$config->start('show', $lang['1356']);
if($config->vers == 'wml') print '<small>';
if($status < 1 || $status > 7){
echo '<u>'.$lang['1357'].':</u><br/>'.
'- <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=show&status=1">'.$lang['1314'].'</a><br/>'.
'- <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=show&status=2">'.$lang['1315'].'</a><br/>'.
'- <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=show&status=3">'.$lang['1316'].'</a><br/>'.
'- <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=show&status=4">'.$lang['1317'].'</a><br/>'.
'- <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=show&status=5">'.$lang['1332'].'</a><br/>'.
'- <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=show&status=6">'.$lang['1333'].'</a><br/>'.
'- <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=show&status=7">'.$lang['1318'].'</a><br/><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
$q = mysql_query("SELECT COUNT(*) AS `count` FROM `users` WHERE `status` = '$status';", $mysql);
$q = mysql_fetch_array($q) or $q['count'] = 0;
$count = $q['count'];
if($count < 1) print '<u>'.$lang['1358'].'</u><br/><br/>';
else{
$page = intval($_GET['p']);
if($page < 1) $page = 1;
$limit = $page*10-10;
if($limit >= $count){ $limit = 0; $page = 1; }
$pages = round($count/10);
if($pages*10 < $count) $pages++;
$c = $limit+1;
$q = mysql_query("SELECT `id`, `nick`, `site`, `bank`, `money`, `credit` FROM `users` WHERE `status` = '$status' ORDER BY `id` DESC LIMIT $limit, 10;", $mysql);
while($d = mysql_fetch_array($q))
{
echo '<b>'.$c.'.</b> '.$d['site'].'|';
if($config->conf['nick'] == 'on')
{
if(strlen($d['nick']) > 0)
{
$d['nick'] = htmlspecialchars($d['nick']);
$d['nick'] = str_replace('$', '$$', $d['nick']);
echo $d['nick'].'; ';
}
}
echo 'ID='.$d['id'].'|'.
$lang['1359'].': <u>'.$d['credit'].'/'.$d['bank'].'</u>|'.
doubleval($d['money']).' WMR<br/>';
$c++;
}
echo '<br/>';
if($page > 1 || $page < $pages)
{
if($page > 1){
if($page-1 != 1)
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=show&status='.$status.'&p=1"><<</a> ';
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=show&status='.$status.'&p='.($page-1).'"><-</a> ';
}
if($page < $pages){
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=show&status='.$status.'&p='.($page+1).'">-></a> ';
if($page+1 != $pages)
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=show&status='.$status.'&p='.$pages.'">>></a> ';
}
echo '<br/><br/>';
}
}
echo '<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=show">'.$lang['1029'].'</a><br/>'.
'<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1009'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish(true);
}
/******************************************************************************/
$q = mysql_query("SELECT `time` FROM `news` ORDER BY `time` DESC LIMIT 0, 1", $mysql);
$q = mysql_fetch_array($q) or $q['time'] = time();
$last_news = date('d.m.y', $q['time']);
$q = mysql_query("SELECT COUNT(`id`) FROM `pochta` WHERE `to` = '$id' && `read` = '1' && `status` = '1';", $mysql);
$q = mysql_fetch_array($q) or $q['0'] = 0;
$pochta_new = $q['0'];
$q = mysql_query("SELECT `credit`, `bank`, `active`, `status` FROM `users` WHERE `id` = '$id';", $mysql);
$q = mysql_fetch_array($q) or $q = array('credit' => '0', 'active' => '2', 'status' => '2');
if($act == 'off' && $q['active'] == 1)
if(mysql_query("UPDATE `users` SET `active` = '2' WHERE `id` = '$id';", $mysql)) $q['active'] = 2;
if($act == 'on' && $q['active'] == 2)
if(mysql_query("UPDATE `users` SET `active` = '1' WHERE `id` = '$id';", $mysql)) $q['active'] = 1;
$config->start('panel', $lang['1009']);
if($config->vers == 'wml') print '<small>';
echo '<div class="header">'.$lang['1k'].' <b> '.$site.' </b></div><br/>
'.$lang['1020'].': <b>'.$id.'</b><br/>'.
$lang['1072'].': <b>'.$q['credit'].'</b><br/>'.
$lang['1073'].': <b>'.$q['bank'].'</b><br/>';
if($q['status'] == 1){
echo '<b>'.$lang['1291'].'</b>';
if($config->conf['mod_avto'] == 'on') echo ' (<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=check">'.$lang['1293'].'</a>)';
echo '<br/><br/>';
}
elseif($q['status'] == 2) echo '<b>'.$lang['1292'].'</b><br/><br/>';
elseif($q['active'] == 1) echo '<u>'.$lang['1290'].' '.$lang['1b'].' (<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=off">'.$lang['1066'].'</a>)</u><br/><br/>';
elseif($q['active'] == 2) echo '<u>'.$lang['1290'].' '.$lang['1r'].' (<a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=on">'.$lang['1065'].'</a>)</u><br/><br/>';
if($q['status'] == 4 || $q['status'] == 5 || $q['status'] == 7 || strpos($config->conf['admin'], '|'.$id.'|') !== false){
$qa = mysql_query("SELECT COUNT(`id`) FROM `users` WHERE `status` = '1';", $mysql);
$qa = mysql_fetch_array($qa) or $qa['0'] = 0;
$qb = mysql_query("SELECT COUNT(`id`) FROM `banners` WHERE `status` = '1';", $mysql);
$qb = mysql_fetch_array($qb) or $qb['0'] = 0;
echo '<u>'.$lang['1300'].':</u><br/>'.
'<img src="/images/act.png" alt=""> <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=ma">'.$lang['1301'].' ['.$qa['0'].']</a><br/>'.
'<img src="/images/act.png" alt=""> <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=mb">'.$lang['1302'].' ['.$qb['0'].']</a><br/>'.
'<div class="header">'.$lang['1w'].'</div>';
}
echo '<img src="/images/act.png" alt=""> <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=news">'.$lang['1121'].' </a>('.$last_news.')<br/>'.
'<img src="/images/act.png" alt=""> <a href="forum.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1171'].'</a><br/>'.
'<img src="/images/act.png" alt=""> <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=pochta">'.$lang['1138'].' </a>('.$pochta_new.')<br/>'.
'<img src="/images/act.png" alt=""> <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=stat">'.$lang['1071'].'</a><br/>'.
'<img src="/images/act.png" alt=""> <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=banner">'.$lang['1098'].'</a><br/>'.
'<img src="/images/act.png" alt=""> <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=prof">'.$lang['1022'].'</a><br/>'.
'<img src="/images/act.png" alt=""> <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=targ">'.$lang['1362'].'</a><br/>'.
'<img src="/images/act.png" alt=""> <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=code">'.$lang['1058'].'</a><br/>'.
'<img src="/images/act.png" alt=""> <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=rules">'.$lang['1024'].'</a><br/>';
if($config->conf['ref'] != 'off') echo '<img src="/images/act.png" alt=""> <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=ref">'.$lang['1365'].'</a><br/>';
echo '<img src="/images/act.png" alt=""> <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=bank">'.$lang['1089'].'</a><br/>'.
'<img src="/images/act.png" alt=""> <a href="birzha.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'">'.$lang['1122'].'</a><br/>'.
'<img src="/images/act.png" alt=""> <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=trans">'.$lang['1252'].'</a><br/>';
if($config->conf['sell'] != 'off') echo '<img src="/images/act.png" alt=""> <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=sc">'.$lang['1233'].'</a><br/>';
if(strpos($config->conf['admin'], '|'.$id.'|') !== false) echo '<img src="/images/act.png" alt=""> <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=dc">'.$lang['1308'].'</a><br/>';
echo '<img src="/images/act.png" alt=""> <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=history">'.$lang['1253'].'</a><br/>';
if(strpos($config->conf['admin'], '|'.$id.'|') !== false)
echo '<img src="/images/act.png" alt=""> <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=st">'.$lang['1311'].'</a><br/>'.
'<img src="/images/act.png" alt=""> <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=edit">'.$lang['1324'].'</a><br/>'.
'<img src="/images/act.png" alt=""> <a href="panel.php?l='.$config->lang.'&v='.$config->vers.'&id='.$id.'&ps='.$ps.'&act=show">'.$lang['1356'].'</a><br/>';
echo '<br/><img src="/images/act.png" alt=""> <a href="index.php?l='.$config->lang.'&v='.$config->vers.'">'.$lang['1026'].'</a><br/>';
echo '';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish();
?>