View file moduls/favorit_del.php

File size: 3.83Kb
<?php
/**********************************************/
/* Автор скрипта: Александр Есин              */
/* E-Mail: [email protected] ([email protected]) */
/* ICQ: 6464729                               */
/* Site: http://ticlove.ru                    */
/**********************************************/
?>
<?php define ('SECURED', true); ?>
<?php require (dirname(__FILE__).'/../_inc/sql.php'); ?>
<?php require (dirname(__FILE__).'/../_inc/config.php'); ?>
<?php require (dirname(__FILE__).'/../_inc/function.php'); ?>
<?php
	 if (!empty($_SESSION['auth_id']) && (intval($_POST['user_id']) == $_SESSION['auth_id']))
	 {
	      $uid = intval($_POST['uid']);
	      if (mysql_num_rows(mysql_query("SELECT * FROM `q_favorits` WHERE `user_uid` = '".$uid."' AND `user_id` = '".$_SESSION['auth_id']."' LIMIT 1;")) > 0)
	      {
		   $page = isset($_GET['page']) ? $_GET['page'] : NULL;
		   switch($page)
		   {
		   case 'update':
		   if (mysql_query("DELETE FROM `q_favorits` WHERE `user_uid` = '".$uid."' AND `user_id` = '".$_SESSION['auth_id']."';")) echo '<div>Анкета успешно удалена из избранного</div>';
		   break;
		   
		   default:
		   $sql = mysql_query("SELECT * FROM `q_users` WHERE `id_user` = '".$uid."' LIMIT 1;");
		   $array = mysql_fetch_array($sql);
		   ?>
		   <div class="box_bg" style="width: 370px;">
		   <div class="box_title">
		   <div class="left" style="padding-top: 2px; padding-left: 10px;">Удалить анкету из избранного</div><div class="box_close right b-modal_close arcticmodal-close"></div>
		   </div>
		   <div class="clear"></div>
		   <div class="box_conetnt">
		   <div style="padding: 10px;">
		   <div id="favorit_del_status">
		   <div style="padding: 10px 0;">
		   <table cellspacing="0" cellpadding="0">
		   <tr>
		   <td width="65">
		   <a href="/user.php?id=<?php echo $array['id_user']; ?>">
		   <?php if (!empty($array['avatar'])) { ?>
		   <img class="<?php echo ($array['vip_status'] == 1 ? 'photo_bor_vip' : 'photo_bor'); ?>" src="<?php echo DIR_PHOTOS; ?>/<?php echo $array['id_user']; ?>/<?php echo $array['avatar']; ?>" alt="" />
		   <?php } else { ?>
		   <img class="<?php echo ($array['vip_status'] == 1 ? 'photo_bor_vip' : 'photo_bor'); ?>" src="/images/no_photo_small.png" alt="" />
		   <?php } ?>
		   </a>
		   </td>
		   <td valign="top">
		   <?php if ($array['vip_status'] == 1) { ?><img src="/images/vip.gif" alt="" width="16" height="16" title="VIP-пользователь" /> <?php } ?>
		   <a class="<?php echo ($array['pol'] == 1 ? 'm_color' : 'zh_color'); ?>" href="user.php?id=<?php echo $array['id_user']; ?>"><?php echo htmlspecialchars($array['name'], ENT_QUOTES); ?></a>
		   <?php if (function_online($array['online']) == TRUE) { ?> <img src="/images/on.gif" alt="Онлайн" title="Онлайн" /><?php } ?><br/>
		   <span class="vozrast">Возраст: <?php echo function_vozrast_n($array['god'].'-'.$array['mes'].'-'.$array['day']); ?></span><br/>
		   <span class="city"><?php echo htmlspecialchars($array['city'], ENT_QUOTES); ?>, <?php echo htmlspecialchars($array['country'], ENT_QUOTES); ?></span>
		   </td>
		   </tr>
		   </table>
		   </div>
		   <div style="padding-bottom: 10px;">Вы действительно хотите удалить эту анкету из избранного?</div>
		   <div style="padding-bottom: 10px; text-align: center;">
		   <input class="submit" type="submit" onclick="javascript:favorit_del_update('<?php echo $uid; ?>')" value="Удалить" />
		   </div>
		   </div>
		   </div>
		   <div class="box_footer">
		   <div class="right"><button class="submit_red b-modal_close arcticmodal-close">Отмена</button></div>
		   </div>
		   <div class="clear"></div>
		   </div>
		   <?php
		   break;
		   }
	      }
	 }
?>