if ($jng_sp_customers_id == '') { exit; } $detail = $class_jcs->getCustomerDetail($jng_sp_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_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']));