<?php
$title = 'Действие';
include_once($_SERVER["DOCUMENT_ROOT"].'/php/style/head.php');
admin(3);
$_GET['id'] = abs(intval($_GET['id']));
$query = $db->query("SELECT * FROM `purchased` WHERE `id`=".$_GET['id']."");
if($query->num_rows == 0){
	header('location:/admin/orders');
}
$order = $query->fetch_assoc();
if($_GET['act'] == "delete"){
	$db->query("DELETE FROM `purchased` WHERE `id`=".$_GET['id']."");
}elseif($_GET['act'] == "ok"){
	$db->query("UPDATE `purchased` SET `status`=2 WHERE `id`=".$_GET['id']."");
}elseif($_GET['act'] == "send"){
	$db->query("UPDATE `purchased` SET `status`=1 WHERE `id`=".$_GET['id']."");
}
header('location:/admin/orders');
?>