コード例 #1
0
        $comment = tep_db_prepare_input(utf8_decode($_POST['comment']));
        $comment = trim($comment);
        if ($comment != "") {
            $comment_by = $session_userinfo['username'];
            $comment_id = $class_jcs->insertComment($customer_id, $comment, $comment_by);
            //          $comment = $class_jcs->retrieveCommentDetail($comment_id);
            //          $comments = array($comment);
            //          $result = $class_jcs->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_jcs->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']));
        $result = $class_jcs->updateCustomer($jng_sp_customers_id, 'text_alert', $text_alert);
        exit;
    } elseif ($_POST['me_action'] == 'CHANGELISTTYPE') {
        $new_type = tep_db_prepare_input(utf8_decode($_POST['new_type']));
        $result = $class_jcs->updateCustomer($jng_sp_customers_id, 'list_type', $new_type);
        exit;
    }
}
//START TEMPLATE
$customer = $class_jcust->retrieveDetail($jng_sp_customers_id);
$sp_detail = $class_sp->retrieveDetail($customer['jng_sp_id']);