Файл: in4at/pod.php
Строк: 72
<?php
##################################################################################################
## Script name : In4at ##
## Version : Final ##
## Made by : XPYCT(Сергей Мищенко) ##
## E-mail : bce-ok@bk.ru ##
## ICQ : 447-50-50-62 ##
## Site : http://vkontakte.ru/id31604521 ##
## Внимание! Скрипт распространяется бесплатно! Модификация W4at by XPYCT ##
##################################################################################################
define('REQ_2_chat', true);
require('4at_set.php');
require('db_con.php');
require('style.php');
if ($py !== spy_code) require('us_info.php');
$cm = mysql_query("select count(id) as num from pod WHERE 1;");
$cmc = mysql_fetch_array($cm);
$news = $cmc['num'];
echo head;
if ($mod=='delpod'){
if ($vv!=0) echo '<div class="d0"><b>Удалить</b></div>';
else echo '<card id="news" title="Удалить"><p>';
echo $fsize1;
if(($row['level']==7)){
$p = mysql_query("select img from pod WHERE id='$mid';");
$ph = mysql_fetch_array($p);
$photo = $ph['img'];
unlink("$photo");
if(mysql_query("delete from pod where id='$mid' limit 1;")){
echo '<b>Подарок удален!</b><br/>';}
if(mysql_query("delete from us_pod where pod='$mid';")){
echo '<b>Подарки для юзеров удалены удалены!</b><br/>';}
}else{echo '<b>Не удалено!</b><br/>';}
echo divide;
echo '<a href="pod.php?'.$wp.'">Подарки</a><br/>';
echo '<a href="enter.php?'.$wp.'">Пpuxoжaя</a><br/>';
echo $fsize2;
echo foot;
mysql_close ($link);
exit;
}
if ($mod=='pod'){
if ($vv!=0) echo '<div class="d0"><b>Подарить</b></div>';
else echo '<card id="news" title="Подарить"><p>';
$setting = mysql_query("Select * from pod where id=$mid");
$set = mysql_fetch_array($setting);
$uposts=$row['posts'];
echo $fsize1;
if ($uposts<$set['cena']){
echo'У вас не хватает постов...<br/>';
}else{
echo "<img src="".$set['img']."" alt="."/><br/><u>".$set['descr']."</u><br/>---<br/>";
$uposts=$uposts-$set['cena'];
mysql_query("insert into us_pod values(0,'$id','$komu','$mid','$comm');");
mysql_query("Update users set posts='".$uposts."' where id='".$id."' LIMIT 1;");
$kt = mysql_query("select user from users WHERE id='".$komu."';");
$to = mysql_fetch_array($kt);
echo'Вы сделали подарок для <b>'.$to['user'].'</b>, теперь у вас <b>'.$uposts.'</b> постов.<br/>';
$adm = "[Система]";
$data = date("d-M-Y [H:i]");
$kol = rand(0,99999999);
$time = time();
$topic = "Подарок!";
$message = "".$row['user']." Подарил вам подарок! <i>".$comm."</i>";
mysql_query("Insert into zapiski set klu4='".$kol."', who ='".$adm."', idwho ='1', message = '".$message."', towhom = '".$to['user']."', idtowhom = '".$komu."', time = '".$time."', readd = '0', topic = '".$topic."', date='".$data."'");
}
echo '<a href="pod.php?'.$wp.'">Подарки</a><br/>';
echo '<a href="enter.php?'.$wp.'">Пpuxoжaя</a><br/>';
echo $fsize2;
echo foot;
mysql_close ($link);
exit;
}
if ($mod=='raz'){
if ($vv!=0) echo '<div class="d0"><b>Подарки</b></div>';
else echo '<card id="news" title="Подарки"><p>';
echo $fsize1;
if(empty($page)) $page=0;
$query = mysql_query("select * from `pod` where raz=$mid");
$num_of_rows=mysql_num_rows($query);
$total_mat_number=$num_of_rows;
$mat_per_page=5;
$total_pages=ceil($total_mat_number/$mat_per_page);
$print = mysql_query("select * from `pod` where raz=$mid order by id desc limit ".$page.",".($mat_per_page).";");
echo 'Всего подарков <b>'.$news.'</b><br/>У вас постов: <b>'.$row['posts'].'</b><br/>';
echo divide;
if (mysql_affected_rows() == 0) {
echo 'Подарков нет...<br/>';
}
while($arr = mysql_fetch_array($print)) {
echo "<img src="".$arr['img']."" alt="."/><br/><u>".$arr['descr']."</u><br/>Цена: <b>".$arr['cena']."</b> постов<br/>";
$kt = mysql_query("select user from users WHERE id='".$arr['uid']."';");
$to = mysql_fetch_array($kt);
if($row['level']==7){echo "Добавил: <a href="search.php?go=view&$wp&nk=".$arr['uid']."">".$to['user']."</a><br/>n";
echo "<a href="pod.php?$wp&mid=".$arr['id']."&mod=delpod">Удалить</a><br/>n";
}
if($mid2!=$arr['id']){
echo "<a href="pod.php?$wp&mid2=".$arr['id']."&mod=raz&mid=".$mid."&page=$page">Подарить</a><br/>n";
}else{
echo "<a href="pod.php?$wp&mod=raz&mid=".$mid."&page=$page">Скрыть поле</a><br/>n";
if($vv!=0) echo "<form action="pod.php?$wp&mid=".$arr['id']."&mod=pod" method="post">";
echo 'Кому(ID юзера):<br/>';
echo "<input name="komu$ref" maxlength="10" size="10" /><br/>";
echo 'Комментарий к подарку:<br/>';
echo "<input name="comm$ref" maxlength="500" size="20" /><br/>";
if($vv!=0){
echo "<input class="ibutton" type="submit" value="Подарить!"/></form>";
}else{
echo "<anchor>Подарить!<go href="pod.php?$wp&mid=".$arr['id']."&mod=pod" method="post">";
echo "<postfield name="komu" value="$(komu$ref)"/>";
echo "<postfield name="comm" value="$(comm$ref)"/>";
echo '</go></anchor><br/>';
}
}
echo divide;}
for ($v=0;$v<$total_pages;$v++){
$page_number=$v*$mat_per_page;
if ($page_number!=$page) {
echo "<a href="pod.php?$wp&page=$page_number&mod=raz&mid=".$mid."">|".($v+1)."|</a> ";
} else {
echo '|<b>'.($v+1).'</b>| ';
}
}
echo '<br/>'.divide;
echo '<a href="pod.php?'.$wp.'">Категории</a><br/>';
echo '<a href="enter.php?'.$wp.'">Пpuxoжaя</a><br/>';
echo $fsize2;
echo foot;
mysql_close($link);
exit;
}
if ($vv!=0) echo '<div class="d0"><b>Подарки</b></div>';
else echo '<card id="pod" title="Подарки"><p>';
echo $fsize1;
$print = mysql_query("select * from `raz_pod` order by id desc ;");
echo 'Всего подарков <b>'.$news.'</b><br/>У вас постов: <b>'.$row['posts'].'</b><br/>';
echo divide;
echo 'Категории:<br/>';
if (mysql_affected_rows() == 0) {
echo 'Разделов нет...<br/>';
}
while($arr = mysql_fetch_array($print)) {
$bl = mysql_fetch_array(mysql_query("select count(id) as num from pod where raz='".$arr['id']."'"));
$tm = $bl['num'];
echo "→ <a href="pod.php?$wp&mod=raz&mid=".$arr['id']."">".$arr['title']."($tm)</a><br/>";}
echo divide;
echo '<a href="cabinet.php?'.$wp.'">Кабинет</a><br/>';
echo '<a href="enter.php?'.$wp.'">Пpuxoжaя</a><br/>';
echo '---<br/>© XPYCT<br/>';
echo $fsize2;
echo foot;
mysql_close($link);
?>