Файл: index.php
Строк: 511
<?
session_start();
define('IN_SCRIPT', true);
include "includes/ini.php";
include "includes/header.php";
include "smiles/smiles.php";
#=====================================================================#
function BBcode($txt)
{
//$txt=preg_replace_callback('{(?:(w+://)|www.|wap.)[w-]+(.[w-]+)*(?: : d+)?[^<>"'()[]s]*(?:(?<! [[:punct:]])|(?<= [-/&+*;]))}xis', "hrefCallback", $txt);
$txt=preg_replace('#[big](.*?)[/big]#si','<big>1</big>',$txt);
$txt=preg_replace('#[b](.*?)[/b]#si','<b>1</b>',$txt);
$txt=preg_replace('#[i](.*?)[/i]#si','<i>1</i>',$txt);
$txt=preg_replace('#[u](.*?)[/u]#si','<u>1</u>',$txt);
$txt=preg_replace('#[small](.*?)[/small]#si','<small>1</small>',$txt);
$txt=preg_replace('#[c](.*?)[/c]#si','<b>Цитата:</b> 1<br/>',$txt);
$txt=preg_replace("/[color=([0-9a-f]{6})](.*?)[/color]/i","<font color="#$1">$2</font>",$txt);
$txt=eregi_replace("(.*)\[url\](.*)\[/url\](.*)","\1<a href=http://\2>\2</a>\3",$txt);
$txt=eregi_replace("(.*)\[url=(.*)\](.*)\[/url\]","\1<a href="\2">\3</a>",$txt);
return $txt;
}
function hrefCallback($p)
{
$href = !empty($p[1]) ? $p[0] : 'http://' . $p[0];
return '<a href="' . $href . '">' . $p[0] . '</a>';
}
function roundTo($number)
{
return floor(($number + 10 / 10) / 10) * 10;
}
function pagenav($base_url, $start, $max_value, $num_per_page)
{
$pgcont = 4;
$pgcont = (int)($pgcont - ($pgcont % 2)) / 2;
if ($start >= $max_value)
$start = max(0, (int)$max_value - (((int)$max_value % (int)$num_per_page) == 0 ? $num_per_page : ((int)$max_value % (int)$num_per_page)));
else
$start = max(0, (int)$start - ((int)$start % (int)$num_per_page));
$base_link = '<a class="navpg" href="' . strtr($base_url, array('%' => '%%')) . 'start=%d' . '">%s</a> ';
$pageindex = $start == 0 ? '' : sprintf($base_link, $start - $num_per_page, '<<');
if ($start > $num_per_page * $pgcont)
$pageindex .= sprintf($base_link, 0, '1');
if ($start > $num_per_page * ($pgcont + 1))
$pageindex .= '<span style="font-weight: bold;"> ... </span>';
for ($nCont = $pgcont; $nCont >= 1; $nCont--)
if ($start >= $num_per_page * $nCont)
{
$tmpStart = $start - $num_per_page * $nCont;
$pageindex .= sprintf($base_link, $tmpStart, $tmpStart / $num_per_page + 1);
}
$pageindex .= '[<b>' . ($start / $num_per_page + 1) . '</b>] ';
$tmpMaxPages = (int)(($max_value - 1) / $num_per_page) * $num_per_page;
for ($nCont = 1; $nCont <= $pgcont; $nCont++)
if ($start + $num_per_page * $nCont <= $tmpMaxPages)
{
$tmpStart = $start + $num_per_page * $nCont;
$pageindex .= sprintf($base_link, $tmpStart, $tmpStart / $num_per_page + 1);
}
if ($start + $num_per_page * ($pgcont + 1) < $tmpMaxPages)
$pageindex .= '<span style="font-weight: bold;"> ... </span>';
if ($start + $num_per_page * $pgcont < $tmpMaxPages)
$pageindex .= sprintf($base_link, $tmpMaxPages, $tmpMaxPages / $num_per_page + 1);
if ($start + $num_per_page < $max_value)
{
$display_page = ($start + $num_per_page) > $max_value ? $max_value : ($start + $num_per_page);
$pageindex .= sprintf($base_link, $display_page, '>>');
}
return $pageindex;
}
function check($per)
{
$value1=array("&","$","'",""","<",">","`","~");
$value2=array("","","","","","","","");
$per=str_replace($value1,$value2,$per);
$per=htmlspecialchars($per);
$per = str_replace("'", "'", $per);
$per = str_replace('\', "\", $per);
$per = str_replace("|", "I", $per);
$per = str_replace("||", "I", $per);
$per = str_replace("/\$/", "$", $per);
$per = mysql_real_escape_string($per);
return $per;
}
#=====================================================================================#Global var
$id = isset($_REQUEST['id']) ? abs(intval($_REQUEST['id'])) : 0;
$start = isset($_GET['start']) ? abs(intval($_GET['start'])) : 0;
$kmess=10;
$realtime=time();
#======================================================================================#
If (!isset($_GET['do']) || !ereg("^[a-z0-9_-]{1,15}$",$_GET['do'])) $do=false; else $do=$_GET['do'];
If (!isset($_GET['to']) || !ereg("^[a-z0-9_-]{1,15}$",$_GET['to'])) $to=false; else $to=$_GET['to'];
switch ($do) {
case 'onas':
if (isset($_SESSION['auth'])){
$login = $_SESSION['login'];
$login = htmlspecialchars(trim($login));
$login = mysql_real_escape_string($login);
$qy=mysql_query("select* from `inbox` where (`idto`='".$count['id']."' && `status`='0');");
$ne=mysql_num_rows($qy);
if($ne > 0){
echo '<div class="output_err"><center>У Вас <b><a href="mail.php?do=inbox">'.$ne.'</a></b> новых сообщений.</center></div>';
}
}
echo '<div class="title_page"><img src="imag/akc.png" >О Магазине</div>';
echo '<div class="box_1">'.$settings['text'].'</div>';
echo '<div class="title_page"><img src="imag/home.png" ><a href="index.php">Главная</a></div>';
break;
case 'buy':
if (isset($_SESSION['auth'])){
$login = $_SESSION['login'];
$login = htmlspecialchars(trim($login));
$login = mysql_real_escape_string($login);
$count = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE login='$login'"));
$qy=mysql_query("select* from `inbox` where (`idto`='".$count['id']."' && `status`='0');");
$ne=mysql_num_rows($qy);
if($ne > 0){
echo '<div class="output_err"><center>У Вас <b><a href="mail.php?do=inbox">'.$ne.'</a></b> новых сообщений.</center></div>';
}
echo '<div class="title_page"><img src="imag/dir.png" >Каталог Товаров</div>';
$res = mysql_query("SELECT * FROM shop WHERE `id`='".$_POST['id']."' and status='1'");
$rows = mysql_fetch_array($res);
$resi = mysql_query("SELECT * FROM shoppokypki WHERE `ids`='".$_POST['id']."'");
$rowsi = mysql_fetch_array($resi);
if ($rows['fail']==2) {
include 'WebIcqLite.class.php';
$uins=$rows['nazva'];
$passwod=$rows['parol'];
$icq = new WebIcqLite();
}
if (empty($_POST['id'])) {
$errorrr .=('Не задан <b>иди</b> товара!<br/>');
}
elseif (mysql_num_rows($res) == 0){
$errorrr .=('Товар не найден!<br/>');
}
elseif ($count['money']<$rows['stoim']) {
$errorrr .=('У Вас не достаточно денег!<br/>');
}
elseif ($count['id']==$rows['user_id']) {
$errorrr .=('Вы не можите покупать собственный товар!<br/>');
}
elseif ($count['id']==$rowsi['user_idin']) {
$errorrr .=('Товар уже куплен!<br/>');
}
elseif ($rows['fail']==2) {
If($icq->connect($uins, $passwod)){
$text=''.utf8win1251('UIN:'.$uins.' успешно прошел проверку в магазине http://'.$settings['copi'].'').'';
If(!$icq->send_message($uins, $text)){
If($icq->error<10){
If($icq->error==5){
$result=@mysql_query("UPDATE `shop` SET `status`='2' WHERE `id`='".$_POST['id']."'");
}
$errorrr .=$icq->oshibka;
}
}else{
If($icq->error<10){
If($icq->error==5){
$result=@mysql_query("UPDATE `shop` SET `status`='2' WHERE `id`='".$_POST['id']."'");
}
$errorrr .=$icq->oshibka;
}
}
$icq->disconnect();
}else{
If($icq->error<10){
If($icq->error==5){
$result=@mysql_query("UPDATE `shop` SET `status`='2' WHERE `id`='".$_POST['id']."'");
}
$errorrr .=$icq->oshibka;
}
}
}
if(!empty($errorrr))
{
echo '<div class="output_err">';
echo $errorrr;
echo '</div>';
}
else
{
$result=@mysql_query("INSERT INTO `shoppokypki` SET `user_idot`='".$rows['user_id']."',`user_idin`='".$count['id']."', `ids`='".$rows['id']."',`nazva`='".$rows['nazva']."',`opis`='".$rows['opis']."',`stoim`='".$rows['stoim']."',`parol`='".$rows['parol']."',`fail`='".$rows['fail']."', `ts`='".time()."';");
If (!$result){
echo 'Ошибка запроса к бд...<br/>';
break;
}
if($rows['vid']==1){
$stoims=$rows['stoim']*$settings['c_ot'];
$stoim=$rows['stoim']-$stoims;
}
else
{
$stoims=$rows['stoim']*$settings['c_ot'];
$stoim=$rows['stoim']-$stoims;
}
$r=@mysql_query("UPDATE `users` SET `money`=`money`+'".$stoim."' WHERE `id`='".$rows['user_id']."'");
If (!$r){
echo 'Ошибка запроса к бд...<br/>';
break;
}
$r=@mysql_query("UPDATE `users` SET `money`=`money`-'".$rows['stoim']."' WHERE `id`='".$count['id']."'");
If (!$r){
echo 'Ошибка запроса к бд...<br/>';
break;
}
if($rows['fail']==1){
echo '<div class="box_2">
<span style="color:#000099">Товар:</span><br/>
<a href="'.htmlspecialchars(trim($rows['parol'])).'"><b>СКАЧАТЬ</b></a>
</div>';
}
if($rows['fail']==2){
echo '<div class="box_2">
<span style="color:#000099">Товар:</span><br/>
UIN: <b>'.htmlspecialchars(trim($rows['nazva'])).'</b> Пароль: <b>'.htmlspecialchars(trim($rows['parol'])).'</b>
</div>';
}
if($rows['fail']==3){
echo '<div class="box_2">
<span style="color:#000099">Товар:</span><br/>
<b>'.htmlspecialchars(trim($rows['parol'])).'</b>
</div>';
}
$row = mysql_fetch_array(mysql_query("SELECT * FROM `shoppokypki` WHERE `user_idin` = '".$count['id']."' and `ids`='".$rows['id']."';"));
if($rows['vid']==1){
mysql_query("DELETE FROM `shop` WHERE `id` = '".$id."';");
}
}
echo '<div class="title_page"><img src="imag/home.png" ><a href="index.php">Главная</a><br/><img src="imag/dir.png" ><a href="index.php?do=shop&ids='.$rows['ids'].'&idss='.$rows['idss'].'">Каталог</a></div>';
}else{
echo '<div class="title_page">Ошибка!!!</div>';
echo '<div class="box_1">Вы не авторизованы!<br/>
Если Вы не регистрировались, пожалуйста пройдите <b><a href="reg.php">регистрацию</a></b>!<br/>
Если Вы зарегистрированный пользователь, просто <b><a href="login.php">авторизируйтесь</a></b>!</div>';
echo '<div class="title_page"><img src="imag/home.png" ><a href="index.php">Главная</a></div>';
}
break;
case 'products':
if (isset($_SESSION['auth'])){
$login = $_SESSION['login'];
$login = htmlspecialchars(trim($login));
$login = mysql_real_escape_string($login);
$qy=mysql_query("select* from `inbox` where (`idto`='".$count['id']."' && `status`='0');");
$ne=mysql_num_rows($qy);
if($ne > 0){
echo '<div class="output_err"><center>У Вас <b><a href="mail.php?do=inbox">'.$ne.'</a></b> новых сообщений.</center></div>';
}
}
echo '<div class="title_page"><img src="imag/dir.png" >Каталог Товаров</div>';
$id=$_GET['id'];
(int)$id;
$res = mysql_query("SELECT * FROM shop WHERE `id`='".$id."' and status='1'");
$rows = mysql_fetch_array($res);
if (mysql_affected_rows() != 0)
{
do
{
$msg=$rows['opis'];
$msg=BBcode($msg);
if($rows['icq_status']==1){
$icq_status='<b>vis</b>';
}
if($rows['icq_status']==2){
$icq_status='<b>inv</b>';
}
if($rows['icq_status']==3){
$icq_status='<b>clean</b>';
}
$ur = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '".$rows['user_id']."';"));
echo '<div class="box_2">
<span style="color:#000099">Товар:</span><br/>
<b>'.htmlspecialchars(trim($rows['nazva'])).'</b> '.$icq_status.'<br/>
<span style="color:#000099">Описание:</span><br/>
<b>'.$msg.'</b><br/>
<span style="color:#000099">Цена:</span> <b>'.htmlspecialchars(trim($rows['stoim'])).' </b> руб.<br/>
<span style="color:#000099">В продаже с:</span> <b>'.date("d.m.y",$rows['ts']).'</b><br/>
<span style="color:#000099">Продавец:</span> <b>'.$ur['login'].'</b>
</div>';
echo '<div class="box_1">
<form action="index.php?do=buy" method="post">
<input type="hidden" name="id" value="'.intval($rows['id']).'"/>
<input type="submit" value="Купить Товар"/></form></div>';
}
while($rows = mysql_fetch_array($res));
}else{
echo '<div class="box_1">Товар не найден!</div>';
}
$res = mysql_query("SELECT * FROM shop WHERE `id`='".$id."'");
$rows = mysql_fetch_array($res);
echo '<div class="title_page"><img src="imag/home.png" ><a href="index.php">Главная</a><br/><img src="imag/dir.png" ><a href="index.php?do=shop&ids='.$rows['ids'].'&idss='.$rows['idss'].'">Каталог</a></div>';
break;
case 'shop':
if (isset($_SESSION['auth'])){
$login = $_SESSION['login'];
$login = htmlspecialchars(trim($login));
$login = mysql_real_escape_string($login);
$qy=mysql_query("select* from `inbox` where (`idto`='".$count['id']."' && `status`='0');");
$ne=mysql_num_rows($qy);
if($ne > 0){
echo '<div class="output_err"><center>У Вас <b><a href="mail.php?do=inbox">'.$ne.'</a></b> новых сообщений.</center></div>';
}
}
echo '<div class="title_page"><img src="imag/dir.png" >Каталог Товаров</div>';
$ids=$_GET['ids'];
(int)$ids;
$idss=$_GET['idss'];
(int)$idss;
$qwq = mysql_query("SELECT `shop` FROM shop WHERE `ids`='$id' and `idss`='$idss'");
$ss = mysql_fetch_array($qwq);
$page = intval(@$_GET['page']);
$start = intval(@$_GET['start']);
$onpage = 5;
$all = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM `shop` WHERE `ids`='$ids' and `idss`='$idss'"));
$all = $all[0];
$pages = ceil($all/$onpage);
if(!$pages) $pages = 1;
if($page>$pages or $page<=0) $page=1;
if($start>$all or $start<=0) $start = 0;
if($page) $start = ($page - 1) * $onpage; else $start = 0;
$res = mysql_query("SELECT * FROM shop WHERE `ids`='$ids' and `idss`='$idss' and status='1' ORDER BY id LIMIT $start,$onpage");
$rows = mysql_fetch_array($res);
if (mysql_affected_rows() != 0)
{
do
{
if($rows['icq_status']==1){
$icq_status='<b>vis</b>';
}
if($rows['icq_status']==2){
$icq_status='<b>inv</b>';
}
if($rows['icq_status']==3){
$icq_status='<b>clean</b>';
}
$kols = mysql_num_rows(mysql_query("SELECT * FROM `shoppokypki` WHERE `ids`='".$rows['id']."'"));
echo '<div class="box_2"><span style="color:#000099">Товар:</span><br/>
<b>'.htmlspecialchars(trim($rows['nazva'])).'</b> '.$icq_status.'<br/>
<span style="color:#000099">Цена:</span> <b>'.htmlspecialchars(trim($rows['stoim'])).' </b>руб.</div>';
echo '<div class="box_1"><b style="color:#45719B">»</b> <a href="index.php?do=products&id='.intval($rows['id']).'"><b>Купить</b></a></div>';
}
while($rows = mysql_fetch_array($res));
}else{
echo '<div class="box_1">В данном Каталоге нет товаров!</div>';
}
if($all > 5){
echo '<div class="box_2">Страницы: ';
}
$asd = $page - 2;
$asd2 = $page + 3; if ($pages>1){
if($asd<$all && $asd>0 && $page>3 ) echo ' <a href="index.php?do=shop&ids='.$ids.'&idss='.$idss.'&page=1">1</a> ... ';
for($i=$asd; $i<$asd2;$i++)
{
if($i<$all && $i>0)
{
if ($i > $pages ) break;
if ($page==$i) echo '<span><b>'.$i.'</b></span> ';
else echo '<a href="index.php?do=shop&ids='.$ids.'&idss='.$idss.'&page='.$i.'">'.$i.'</a> ';
}
}
if ($i <= $pages)
{
if($asd2<$all) echo ' ... <a href="index.php?do=shop&ids='.$ids.'&idss='.$idss.'&page='.$pages.'">'.$pages.'</a>';
}
echo '</div>';
}
echo '<div class="title_page"><img src="imag/home.png" ><a href="index.php">Главная</a><br/><img src="imag/dir.png" ><a href="index.php?do=kat&id='.$ids.'">Каталог</a></div>';
break;
case 'kat':
if (isset($_SESSION['auth'])){
$login = $_SESSION['login'];
$login = htmlspecialchars(trim($login));
$login = mysql_real_escape_string($login);
$qy=mysql_query("select* from `inbox` where (`idto`='".$count['id']."' && `status`='0');");
$ne=mysql_num_rows($qy);
if($ne > 0){
echo '<div class="output_err"><center>У Вас <b><a href="mail.php?do=inbox">'.$ne.'</a></b> новых сообщений.</center></div>';
}
}
echo '<div class="title_page"><img src="imag/dir.png" >Каталог Товаров</div>';
if (isset($_GET['id']) || is_numeric($_GET['id'])){
$res = mysql_query("SELECT * FROM `shopkategor` WHERE `ids`='".$_GET['id']."' ORDER BY `num`");
$rows = mysql_fetch_array($res);
if (mysql_affected_rows() != 0)
{
do
{
$c = mysql_result(mysql_query("SELECT COUNT(*) FROM `shop` WHERE ids='".$rows['ids']."' and idss='".$rows['id']."' and status='1'"), 0);
getfont();
echo ''.$font_row.'<b class="b">»</b> <a href="index.php?do=shop&ids='.$rows['ids'].'&idss='.$rows['id'].'">'.$rows['nazva'].'</a> ['.$c.'] ';
if (isset($_SESSION['auth'])){
$login = $_SESSION['login'];
$login = htmlspecialchars(trim($login));
$login = mysql_real_escape_string($login);
$count = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE login='$login'"));
if($count['tyuioteteeitruytripoetiweero']==1){
echo '<a href="'.$adminka.'/shop.php?do=kat_edit&id='.$rows['id'].'">изм</a>';
}
}
echo '</div>';
}
while($rows = mysql_fetch_array($res));
}else{
echo '<div class="box_1">Нет созданных категорий!</div>';
}
}else{
echo '<div class="box_1">Нe выбрана катигория!</div>';
}
echo '<div class="title_page"><img src="imag/home.png" ><a href="index.php">Главная</a></div>';
break;
case 'index':
default:
$result=@mysql_query("SELECT `ts` FROM `news` ORDER by `ts` desc LIMIT 0,1");
If (!$result || mysql_num_rows($result)!=1) $data='нету'; else $data=''.date("d.m.y",mysql_result($result,0,'ts')).'';
$stock=@mysql_num_rows(mysql_query("SELECT `ts` FROM `stock` "));
if (isset($_SESSION['auth'])){
$login = $_SESSION['login'];
$login = htmlspecialchars(trim($login));
$login = mysql_real_escape_string($login);
$count = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE login='$login'"));
$n = $count['id'];
$qi=mysql_query("select* from `inbox` where `idto`='$n';");
$vho=mysql_num_rows($qi);
$qy=mysql_query("select* from `inbox` where (`idto`='".$count['id']."' && `status`='0');");
$ne=mysql_num_rows($qy);
if($ne > 0){
echo '<div class="output_err"><center>У Вас <b><a href="mail.php?do=inbox">'.$ne.'</a></b> новых сообщений.</center></div>';
}
$guest=mysql_num_rows(mysql_query("select* from `guest`;"));
$quot=mysql_result(mysql_query("SELECT SUM(quota) FROM `shop` WHERE `user_id`='".$count['id']."' and `fail`='1'"),0);
if(!$quot){
$quot=0;
}
if($quot >= 1073741824){
$fail = round($quot / 1073741824 * 100) / 100 . " Gb";
}
elseif($quot >= 1048576){
$fail = round($quot / 1048576 * 100) / 100 . " Mb";
}
elseif($quot >= 1024){
$fail = round($quot / 1024 * 100) / 100 . " Kb";
}
else{
$fail = $quot . " Byte";
}
if($count['quota'] >= 1073741824){
$quota = round($count['quota'] / 1073741824 * 100) / 100 . " Gb";
}
elseif($count['quota'] >= 1048576){
$quota = round($count['quota'] / 1048576 * 100) / 100 . " Mb";
}
elseif($count['quota'] >= 1024){
$quota = round($count['quota'] / 1024 * 100) / 100 . " Kb";
}
else{
$quota = $count['quota'] . " Byte";
}
echo '
<div class="box_1">
<img src="imag/wmr.png" ><b>'.$count['money'].'</b> руб. (<b><a style="color:blue" href="money.php?do=input">+</a></b>/<b><a style="color:red" href="money.php?do=output">-</a></b>)<br/>
<img src="imag/qote.gif" ><b>'.$quota.'/'.$fail.'</b> (<b><a style="color:red" href="profile.php?do=quota">+</a></b>)<br/>
</div>';
if($count['tyuioteteeitruytripoetiweero']==1){
$wmin=@mysql_num_rows(mysql_query("SELECT * FROM `input` WHERE `statys`='1'"));
$wmout=@mysql_num_rows(mysql_query("SELECT * FROM `output` WHERE `statys`='1'"));
//////////
$wmin_new=@mysql_num_rows(mysql_query("SELECT * FROM `input` WHERE `statys`='0'"));
$wmout_new=@mysql_num_rows(mysql_query("SELECT * FROM `output` WHERE `statys`='0'"));
//////////
$u = mysql_result(mysql_query("SELECT COUNT(*) FROM `users`"), 0);
/////////
$support_new=@mysql_num_rows(mysql_query("SELECT * FROM `support` WHERE `stus`='0'"));
$support=@mysql_num_rows(mysql_query("SELECT * FROM `support` WHERE `stus`<>'0'"));
////////
$produkt_new = @mysql_num_rows(mysql_query("SELECT * FROM `shop` WHERE `status`='0'"));
$produkt_aktiv = mysql_result(mysql_query("SELECT COUNT(*) FROM `shop` WHERE `status`='1'"), 0);
////////
echo '<div class="title_page"><img src="imag/5.gif" ><b>Админ панель:</b></div>
<div class="box_1"><b class="b">»</b> <a href="'.$adminka.'/index.php?do=setting">Настройки</a></div>
<div class="box_2"><b class="b">»</b> <a href="'.$adminka.'/user.php?do=index">Все юзеры</a> ['.$u.']</div>
<div class="box_1"><b class="b">»</b> <a href="'.$adminka.'/finance.php?do=wm_in">Ввод</a> ['.$wmin.'';
if($wmin_new!==0) {echo '/<a href='.$adminka.'/finance.php?do=wm_innew><b style="color:red">+'.$wmin_new.'</b></a>';}
echo ']</div><div class="box_2"><b class="b">»</b> <a href="'.$adminka.'/finance.php?do=wm_out">Выввод</a> ['.$wmout.'';
if($wmout_new!==0) {echo '/<a href='.$adminka.'/finance.php?do=wm_newout><b style="color:red">+'.$wmout_new.'</b></a>';}
echo ']</div>
<div class="box_1"><b class="b">»</b> <a href="'.$adminka.'/support.php?do=index">Суппорт</a> ['.$support.'';
if($support_new!==0) echo '/<a href="'.$adminka.'/support.php?do=support_new"><b style="color:red">+'.$support_new.'</b></a>';
echo ']</div>
<div class="box_2"><b class="b">»</b> <a href="'.$adminka.'/shop.php?do=index">Товары</a> ['.$produkt_aktiv.'';
if($produkt_new!==0) echo '/<a href="'.$adminka.'/shop.php?do=produkt&sort=0"><b style="color:red">+'.$produkt_new.'</b></a>';
echo ']</div><div class="box_1"><b class="b">»</b> <a href="'.$adminka.'/shop.php?do=kat_add">Новая Катигория</a></div>
<div class="box_2"><b class="b">»</b> <a href="'.$adminka.'/shop.php?do=sub_add">Суб Катигория</a></div>';
}
echo '<div class="title_page"><img src="imag/dir.png" ><b>Каталог Товаров:</b></div>';
$kateg = mysql_query("SELECT * FROM `shopkategor` WHERE `ids`='0' and `idss`='0' ORDER BY `num`");
$shopkategor = mysql_fetch_array($kateg);
if (mysql_affected_rows() != 0)
{
do
{
getfont();
$c = mysql_result(mysql_query("SELECT COUNT(*) FROM `shop` WHERE ids='".$shopkategor['id']."' and status='1'"), 0);
echo ''.$font_row.'<b class="b">»</b> <a href="index.php?do=kat&id='.$shopkategor['id'].'">'.$shopkategor['nazva'].'</a> ['.$c.'] ';
if($count['tyuioteteeitruytripoetiweero']==1){
echo '<a href="'.$adminka.'/shop.php?do=kat_edit&id='.$shopkategor['id'].'">изм</a>';
}
echo '</div>';
}
while($shopkategor = mysql_fetch_array($kateg));
}else{
echo '<div class="box_1">Нет созданных категорий!</div>';
}
$my_products=mysql_num_rows(mysql_query("SELECT * FROM `shop` WHERE `user_id`='".$count['id']."'"));
$my_sales=mysql_num_rows(mysql_query("SELECT * FROM `shoppokypki` WHERE `user_idot`='".$count['id']."'"));
$my_purchases=mysql_num_rows(mysql_query("SELECT * FROM `shoppokypki` WHERE `user_idin`='".$count['id']."'"));
echo '<div class="title_page"><img src="imag/settings.png" >Управление:</div>';
echo '
<div class="box_1"><b class="b">»</b> <a href="shop.php?do=goods_add">Добавить Товар</a></div>
<div class="box_2"><b class="b">»</b> <a href="shop.php?do=my_products">Мои Товары</a> ['.$my_products.']</div>
<div class="box_1"><b class="b">»</b> <a href="shop.php?do=my_purchases">Мои Покупки</a> ['.$my_purchases.']</div>
<div class="box_2"><b class="b">»</b> <a href="profile.php?do=index">Настройки</a></div>
<div class="box_1"><b class="b">»</b> <b><a href="money.php?do=index">Финансы</a></b></div>
';
echo '<div class="title_page"><img src="imag/info.gif" ><b>Информация:</b></div>';
echo '
<div class="box_1"><b class="b">»</b> <a href="news.php">Новости</a> [<b>'.$data.'</b>]</div>
<div class="box_2"><b class="b">»</b> <a href="stock.php"><b>Наши Акции</b></a> ['.$stock.']</div>
<div class="box_1"><b class="b">»</b> <a href="mail.php?do=index">Почта</a> [<b>'.$ne.'</b>/'.$vho.']</div>
<div class="box_2"><b class="b">»</b> <a href="guest.php?do=index">Гостевая книга</a> [<b>'.$guest.'</b>]</div>
<div class="box_1"><b class="b">»</b> <a href="library.php?do=razd&razd=1"><b>Правила</b></a></div>
<div class="box_2"><b class="b">»</b> <a href="statistik.php?do=index">Статистика</a></div>
<div class="box_2"><b class="b">»</b> <a href="support.php?do=index">Тех.Поддержка</a></div>';
echo '<div class="title_page"><b class="b"><img src="imag/exit.png" ></b> <a href="out.php">Выход</a><b>['.$count['login'].']</b><b class="b"></b></div>';
}else{
echo '<div class="title_page"><img src="imag/keys.gif" ><a href="login.php?do=index">Авторизация</a> <br/><img src="imag/closed.gif" ><a href="reg.php?do=index">Регистрация</a></div>';
echo '<div class="box_2">
'.implode(' ', array_slice(explode(' ', $settings['text']), 0, 24)).'<br/><a href="index.php?do=onas"><b>Подробней ...</b></a>
</div>';
echo '<div class="title_page"><img src="imag/dir.png" ><b>Каталог Товаров:</b></div>';
$kateg = mysql_query("SELECT * FROM `shopkategor` WHERE `ids`='0' and `idss`='0' ORDER BY `num`");
$shopkategor = mysql_fetch_array($kateg);
if (mysql_affected_rows() != 0)
{
do
{
getfont();
$c = mysql_result(mysql_query("SELECT COUNT(*) FROM `shop` WHERE ids='".$shopkategor['id']."' and status='1'"), 0);
echo ''.$font_row.'<b class="b">»</b> <a href="index.php?do=kat&id='.$shopkategor['id'].'">'.$shopkategor['nazva'].'</a> ['.$c.'] ';
if($count['tyuioteteeitruytripoetiweero']==1){
echo '<a href="'.$adminka.'/shop.php?do=kat_edit&id='.$shopkategor['id'].'">изм</a>';
}
echo '</div>';
}
while($shopkategor = mysql_fetch_array($kateg));
}else{
echo '<div class="box_1">Нет созданных категорий!</div>';
}
echo '<div class="title_page"><img src="imag/info.gif" >Информация:</div>';
echo '<div class="box_2"><b class="b">»</b> <a href="news.php"><b>Новости</b></a> ['.$data.']</div>';
echo '<div class="box_1"><b class="b">»</b> <a href="stock.php"><b>Наши Акции</b></a> ['.$stock.']</div>';
echo '<div class="box_2"><b class="b">»</b> <a href="index.php?do=onas">О Магазине</a></div>';
echo '<div class="box_1"><b class="b">»</b> <a href="library.php?do=index">Библотека</a></div>';
echo '<div class="title_page"><b class="b"><img src="imag/support.png" ></b> <a href="support.php">Тех.Поддержка</a> <b class="b"></b></div>';
}
break;
}
include "includes/footer.php";
mysql_close();
?>