41 lines
980 B
PHP
41 lines
980 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
ini_set ('error_reporting', E_ALL);
|
||
|
|
ini_set ('display_errors', '1');
|
||
|
|
|
||
|
|
session_start();
|
||
|
|
|
||
|
|
require_once('../../_config.php');
|
||
|
|
require_once('../../_incl/datosClass.php');
|
||
|
|
require_once('../../_incl/code.php');
|
||
|
|
|
||
|
|
// session handling
|
||
|
|
if($SESSION_CHECK) {
|
||
|
|
require_once('../_incl/usersClass.php');
|
||
|
|
|
||
|
|
$usuario = new usersClass('_config.php');
|
||
|
|
if($usuario) {
|
||
|
|
if(!$usuario->sessionRegistered()){
|
||
|
|
Header('Location:' . $SESSION_LOGIN_PAGE);
|
||
|
|
exit;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
if(isset($_REQUEST['op'])){
|
||
|
|
$operacion = $_REQUEST['op'];
|
||
|
|
$rec_id = $_REQUEST['id'];
|
||
|
|
|
||
|
|
if($operacion == 'dal') {
|
||
|
|
$db = new datosClass($DATA_USER, $DATA_PWD, $DATA_DATABASE, $DATA_HOST);
|
||
|
|
if($db) {
|
||
|
|
$db->query('DELETE FROM shoop_pedidos WHERE pedido_id = ' . $rec_id);
|
||
|
|
$db->query('DELETE FROM shoop_pedi_productos WHERE pp_id_pedido = ' . $rec_id);
|
||
|
|
$db->query('DELETE FROM shoop_clientes WHERE cliente_id = ' . $rec_id );
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
header('Location:pedidos.php');
|
||
|
|
?>
|