ruạṛ
<?php /** * Remove customer from the database * @version 0.9 * @author Robert Urquhart <programmer@activatedesign.co.nz> * @package WEP-CMS */ session_start(); require_once $_SERVER['DOCUMENT_ROOT'].'/admin/scripts-includes/universal.php'; $conn_ID = connect_to_db(); /** * get and validate id * @var int $cust_id * @var object $n * @var string $message */ if(!$cust_id = is_numeric_id($_GET['customer'])) { getout('Customer not found','../customers.php'); exit; } $n = new user($cust_id); $message = ''; if(!$n->user_id){ getout('Invalid customer id'); exit; } //else $n->delete(); mysql_query("update orders set customer_id = '0' where customer_id='$cust_id'"); $message .= 'Customer deleted successfully.'; getout($message, '../customers.php'); exit; ?>
cải xoăn