View file wu-engine/wu-actions/eshop_item_del.php

File size: 960B
<?php
require_once('../wu_init.php');
require('../wu-functions/wu_functions.php');
if (!wu_token()) { exit('wu-error'); }
if (!USER_LOGGED) { exit('3'); }

if(isset($_POST['id']) && isset($_POST['reas'])){
if(!empty($_POST['id']) && !empty($_POST['reas'])){
$id = intval($_POST['id']);
$nu = mysqli_fetch_assoc(mysqli_query($connect_db, "SELECT id,usr,ti FROM ".DB_PREFIX."_es WHERE id='$id' LIMIT 1"));
if ($nu['usr'] != $u_id) { exit('3'); }

mysqli_query($connect_db, "INSERT INTO `".DB_PREFIX."_tickets_main` (usr,cat,pr,th,dt) VALUES ('$u_id','4','2','Удаление товара id $id','$dt')");
$last = mysqli_insert_id($connect_db);
mysqli_query($connect_db, "INSERT INTO `".DB_PREFIX."_tickets_msg` (tid,msg,files,bb,sm,dt) VALUES ('$last','Здравствуйте, я хочу удалить товар id $id ($nu[ti]) по следующей причине: $reas','','1','1','$dt')");

exit('1');
} else { exit('0'); }
} else { exit('3'); }
?>