function SaveRateResult($_result)
 {
     if (Feedback::IsResourceRating($this->Id)) {
         return;
     }
     $fb = new Feedback(getId(32));
     $fb->ResourceId = $this->Id;
     $fb->CriteriaList["hf"] = intval($_result);
     $fb->Save();
 }
         Visitor::CloseAllOverlays($chat->UserId);
     } else {
         if ($ticket != null) {
             $feedback->UserId = $ticket->SenderUserId;
             $feedback->TicketId = $ticket->Id;
             if (!empty($ticket->Editor)) {
                 $feedback->OperatorId = $ticket->Editor->Editor;
                 $feedback->GroupId = $ticket->Editor->GroupId;
             }
             $feedback->UserData = UserData::FromTicketMessage($ticket->Messages[0]);
         }
     }
     $isSpam = !empty(Server::$Configuration->File["gl_sfc"]) && Visitor::CreateSPAMFilter($userid, false);
     if (!$isSpam) {
         $feedback->AddCriteriaDataFromServerInput();
         $feedback->Save();
     } else {
         Logging::GeneralLog("Feedback matches SPAM filter rule.");
     }
     $fb_html = str_replace("<!--sub_title-->", "<br>" . LocalizationManager::$TranslationStrings["client_feedback_success"] . "<script>parent.parent.lz_chat_feedback_result();</script>", $fb_html);
     $fb_html = str_replace("<!--title-->", "<br><br><br>" . LocalizationManager::$TranslationStrings["client_thank_you"], $fb_html);
     $fb_html = str_replace("<!--visible-->", "none", $fb_html);
 } else {
     $inputs_html = $js_id_list = "";
     foreach (Server::$Configuration->Database["gl_fb"] as $id => $criteria) {
         if (!empty($js_id_list)) {
             $js_id_list .= ",";
         }
         $js_id_list .= "'" . $id . "'";
         $inputs_html .= $criteria->GetHTML();
     }