Ejemplo n.º 1
0
     $product = $class_o->retrieveProductDetail($opid);
     if ($product['status'] == $old_status) {
         $products = $class_o->retrieveProducts($product['orders_id']);
         $opids = array();
         foreach ($products as $p) {
             $class_o->updateProductStatus($p['orders_products_id'], $new_status, $session_userinfo['username']);
             $opids[] = $p['orders_products_id'];
         }
         $class_o->sendProductStatusNotification($opids, $new_status, $languages[2]['path'], $useAltContent);
         //Auto Blacklist Customer
         $order = $class_o->retrieveDetail($product['orders_id']);
         use_class('customers_special_list');
         $class_csl = new customers_special_list();
         $class_csl->addCustomer('B', $order['customers_id']);
         $comment_text = 'Customer is added to blacklist automatically because of Unpaid Vorkasse Cancellation';
         $class_csl->insertComment($order['customers_id'], $comment_text, 'System');
         $result = array();
         $result['op_id'] = implode(',', $opids);
         $result['old_status'] = $old_status;
         $result['new_status'] = $new_status;
         ajaxReturn($result);
     }
 } elseif ($_POST['me_action'] == 'ONHOLDNOTIFICATION') {
     $status = '13';
     $opid = tep_db_prepare_input($_POST['op_id']);
     $product = $class_o->retrieveProductDetail($opid);
     if ($product['status'] == $status) {
         $products = $class_o->retrieveProducts($product['orders_id']);
         $opids = array();
         foreach ($products as $p) {
             if ($p['status'] == $status && $p['last_sent_date'] == '') {
if ($customers_id == '') {
    exit;
}
$detail = $class_csl->getCustomerDetail($customers_id);
if (is_null($detail)) {
    exit;
}
//AJAX ACTION
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'ADDNEWCOMMENT') {
        $customer_id = tep_db_prepare_input($_POST['customer_id']);
        $comment = tep_db_prepare_input(utf8_decode($_POST['comment']));
        $comment = trim($comment);
        if ($comment != "") {
            $comment_by = $session_userinfo['username'];
            $comment_id = $class_csl->insertComment($customer_id, $comment, $comment_by);
            //            $comment = $class_csl->retrieveCommentDetail($comment_id);
            //            $comments = array($comment);
            //            $result = $class_csl->drawComments($comments, true);
            $result = drawSingleComment($comment_id, $comment_by, time(), $comment);
            echo utf8_encode($result);
        }
        exit;
    } elseif ($_POST['me_action'] == 'DELETECOMMENT') {
        $customer_id = tep_db_prepare_input($_POST['customer_id']);
        $comment_id = tep_db_prepare_input($_POST['comment_id']);
        $class_csl->deleteComment($customer_id, $comment_id);
        echo utf8_encode($comment_id);
        exit;
    } elseif ($_POST['me_action'] == 'SAVETEXTALERT') {
        $text_alert = tep_db_prepare_input(utf8_decode($_POST['text_alert']));