View file apanel/pages/delete_users.php

File size: 2.35Kb
<?php
/**********************************************/
/* Автор скрипта: Александр Есин              */
/* E-Mail: [email protected] ([email protected]) */
/* ICQ: 6464729                               */
/* Site: http://ticlove.ru                    */
/**********************************************/
?>
<?php if (!defined('SECURED')) die("SORRY! Unknown Error!"); ?>
<h3>Удаление анкет</h3>
<?php $count = count($_POST['sel']); ?>
<?php if ($count > 0) { ?>
<?php for ($i = 0; $i < $count; $i++) { ?>
<?php
$user_id = intval($_POST['sel'][$i]);

$sql = mysql_query("SELECT * FROM `q_users` WHERE `id_user` = '".$user_id."' LIMIT 1;");
$user_arr = mysql_fetch_array($sql);
if (mysql_num_rows($sql) > 0)
{
mysql_query("DELETE FROM `q_anketa` WHERE `id_user` = '".$user_id."';");
mysql_query("DELETE FROM `q_black_list` WHERE `user_id` = '".$user_id."' OR `user_uid` = '".$user_id."';");
mysql_query("DELETE FROM `q_favorits` WHERE `user_id` = '".$user_id."' OR `user_uid` = '".$user_id."';");
mysql_query("DELETE FROM `q_gifts` WHERE `send_user_id` = '".$user_id."';");
mysql_query("DELETE FROM `q_guest` WHERE `id_user` = '".$user_id."' OR `uid_user` = '".$user_id."';");
mysql_query("DELETE FROM `q_lider` WHERE `id_user` = '".$user_id."';");
mysql_query("DELETE FROM `q_messages` WHERE `user_uid` = '".$user_id."' OR `user_id` = '".$user_id."';");
mysql_query("DELETE FROM `q_news_class` WHERE `id_user` = '".$user_id."';");
mysql_query("DELETE FROM `q_news_comm` WHERE `id_user` = '".$user_id."';");
mysql_query("DELETE FROM `q_photo` WHERE `id_user` = '".$user_id."';");
mysql_query("DELETE FROM `q_photo_comm` WHERE `id_user` = '".$user_id."' OR `uid_user` = '".$user_id."';");
mysql_query("DELETE FROM `q_photo_vote` WHERE `id_user` = '".$user_id."' OR `uid_user` = '".$user_id."';");
mysql_query("DELETE FROM `q_smschat` WHERE `user_id` = '".$user_id."';");
mysql_query("DELETE FROM `q_vip` WHERE `id_user` = '".$user_id."';");
mysql_query("DELETE FROM `q_users` WHERE `id_user` = '".$user_id."';");
if ($user_arr['photo'] > 0) del_dir_photos('../'.DIR_PHOTOS.'/'.$user_id);
}
?>
<?php } ?>
<div style="padding-top: 10px;">Удалено анкет: <strong><?php echo $count; ?></strong></div>
<?php } else { ?>
<div style="padding-top: 10px;">Вы не отметили анкеты для удаления</div>
<?php } ?>