Вход Регистрация
Файл: region_clean/delmsg.php
Строк: 174
<?
#######################################
## Mod By KoT (borispol) [76-75-072] ##
#######################################

require_once "start.php";
require_once 
"sid.php";

header("Cache-Control: no-cache");
if (
$ver == "wml")header ("Content-type:text/vnd.wap.wml; charset=utf-8");
else 
header("Content-Type:text/html; charset=UTF-8");

require_once 
"inc.php";
$link connect_db();
list(
$row$id$ps$fsize1$fsize2) = check_login($link);
require_once 
"version.php";

if (isset(
$rm) and !ctype_digit($rm)) { header('Location: index.php?'); }
$im intval($im);
$mod = isset($_GET['mod']) ? $_GET['mod'] : NULL;
switch(
$mod) {

case 
'delall':
if (isset(
$go)) {
mysql_query ("update zapiski set insend = '0' WHERE idwho = '".$id."'");
mysql_query ("update zapiski set ininc = '0' WHERE idtowhom = '".$id."'");
mysql_query ("delete from zapiski WHERE (insend = '0')and(ininc = '0')");
if (
$ver == "wml") {
echo 
$xml;
echo 
$dtd;
echo 
"<wml>n
      <card id="
deleted" title="Готово!" ontimer="chatmail.php?$ses&amp;ref=$ref"><timer value="10"/>n
      <p align="
center">n";
} else {
echo 
"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      
<html xmlns="http://www.w3.org/1999/xhtml">
      <
head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
      <
title>Нет писем</title>
      <
META HTTP-EQUIV="Refresh" CONTENT="2; URL=chatmail.php?$ses&amp;ref=$ref">
      <
meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>
      <
div align="center">";
}
echo 
$fsize1;
echo 'Все твои письма удалены!<br/>';
echo 
$fsize2;
include_once 'foot.php';
mysql_close (
$link);
exit;
}
$r = mysql_query ("Select idtowhom,idwho from zapiski WHERE klu4 '".$im."' ");
$a = mysql_fetch_array($r);
if ((mysql_affected_rows() != 0) and ((
$a["idtowhom"] == $id) or ($a["idwho"] == $id))) {
if (
$ver == "wml") {
echo 
$xml;
echo 
$dtd;
echo "
<wml>n";
echo "
<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>n";
if (isset(
$ininc)) echo "<card id="deleted" title="Удалено" ontimer="inbox.php?s=$s&amp;$ses&amp;ref=$ref"><timer value="10"/>n";
else echo "
<card id="deleted" title="Удалено" ontimer="outbox.php?s=$s&amp;$ses&amp;ref=$ref"><timer value="10"/>n";
echo "
<p align="center">n";
} else {
echo "
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <
html xmlns="http://www.w3.org/1999/xhtml">
      <
head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
      <
title>Нет писем</title>";
if (isset(
$ininc)) echo "<META HTTP-EQUIV="Refresh" CONTENT="2; URL=inbox.php?s=$s&amp;$ses&amp;ref=$ref">";
else echo "
<META HTTP-EQUIV="Refresh" CONTENT="2; URL=outbox.php?s=$s&amp;$ses&amp;ref=$ref">";
echo "
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>";
echo "
<div align="center">";
}
echo 
$fsize1;
echo 'Письмо удалено!<br/>';
echo 
$fsize2;
if (isset(
$insend)) mysql_query ("update zapiski set insend '0' WHERE klu4 '".$im."' ");
if (isset(
$ininc)) mysql_query ("update zapiski set ininc '0' WHERE klu4 '".$im."' ");
mysql_query ("
delete from zapiski WHERE (insend '0')and(ininc '0')");
include_once 'foot.php';
mysql_close (
$link);
} else {
if (
$ver == "wml") {
echo 
$xml;
echo 
$dtd;
echo "
<wml>n
      
<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>n
      
<card id="error" title="Ошибка" ontimer="chatmail.php?$ses&amp;ref=$ref"><timer value="10"/>n
      
<p align="center">n";
} else {
echo "
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <
html xmlns="http://www.w3.org/1999/xhtml">
      <
head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
      <
title>Ошибка</title>
      <
META HTTP-EQUIV="Refresh" CONTENT="2; URL=chatmail.php?$ses&amp;ref=$ref">
      <
meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>
      <
div align="center">";
}

echo 
$fsize1;
echo 'Ошибка при удалении (это сообщение не твое или его вообще нет)!<br/>';
echo 
$fsize2;
include_once 'foot.php';
mysql_close (
$link);
}
break;

case 'delusermsg':
settype(
$usid, 'integer');
$select = mysql_query ("select id,user from users where id '".$usid."'");
$rows = mysql_fetch_array ($select);
$user = $rows["user"];
if (isset(
$insend)) mysql_query ("update zapiski set insend '0' WHERE idwho '".$id."' and idtowhom '".$usid."'");
if (isset(
$ininc)) mysql_query ("update zapiski set ininc '0' WHERE idtowhom '".$id."' and idwho '".$usid."'");
mysql_query ("
delete from zapiski WHERE (insend '0')and(ininc '0') and idtowhom '".$id."'");
if (
$ver == "wml") {
echo 
$xml;
echo 
$dtd;
echo "
<wml>n";
if (isset(
$ininc)) echo "<card id="deleted" title="Удалено" ontimer="inbox.php?s=$s&amp;$ses&amp;ref=$ref"><timer value="10"/>n";
else echo "
<card id="deleted" title="Удалено" ontimer="outbox.php?s=$s&amp;$ses&amp;ref=$ref"><timer value="10"/>n";
echo "
<p align="center">n";
} else {
echo "
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <
html xmlns="http://www.w3.org/1999/xhtml">
      <
head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
      <
title>Удалено</title>";
if (isset(
$ininc)) echo "<META HTTP-EQUIV="Refresh" CONTENT="2; URL=inbox.php?s=$s&amp;$ses&amp;ref=$ref">";
else echo "
<META HTTP-EQUIV="Refresh" CONTENT="2; URL=outbox.php?s=$s&amp;$ses&amp;ref=$ref">";
echo "
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>";
echo "
<div align="center">";
}
echo 
$fsize1;
echo "
Все твои письма от <b>".col_n($user)."</bудалены!n";
echo 
$fsize2;
include_once "
foot.php";
break;
}
?>
Онлайн: 1
Реклама