コード例 #1
0
global $db;
require_once '../confy.php';
require_once '../functions.php';
require_once '../functions-2.php';
require_once DIR_WS_FUNCTIONS . 'html_output.php';
tep_db_connect();
use_class('jng_sp_orders');
$class_jo = new jng_sp_orders();
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'DELETEDUPLIORDERS') {
        if (isset($_POST['orders']) && is_array($_POST['orders'])) {
            $success = array();
            $fail = array();
            foreach ($_POST['orders'] as $oid) {
                $class_jo->deleteOrder($oid);
                $success[] = $oid;
            }
            $total_success = count($success);
            $total_fail = count($fail);
            if ($total_success > 0) {
                echo '<h3>Successfully deleted ' . $total_success . ' Order(s)</h3>';
                foreach ($success as $oid) {
                    echo '<div>' . $oid . '</div>';
                }
            }
            if ($total_fail > 0) {
                echo '<h3>Problem when deleting ' . $total_fail . ' Order(s)</h3>';
                foreach ($fail as $oid) {
                    echo '<div>' . $oid . '</div>';
                }