| Server IP : 64.202.187.69 / Your IP : 216.73.217.74 Web Server : Apache System : Linux 69.187.202.64.host.secureserver.net 3.10.0-1160.144.1.el7.tuxcare.els6.x86_64 #1 SMP Fri May 29 16:22:24 UTC 2026 x86_64 User : transmarket ( 1001) PHP Version : 7.2.34 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/transmarket/translator/controllers/ |
Upload File : |
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
include 'connection.php';
//ini_set('display_errors',1);
//error_reporting(E_ALL);
require_once('functions.real_sentences_suggestions.php');
$real_sentences_sugg_obj = new Real_sentences_suggestions();
if ( isset($_POST['real_sentence_id']) && isset($_POST['suggested_text']) && isset($_SESSION['tm_id'])) {
$real_sentence_id = $_POST['real_sentence_id'];
$user_id = $_SESSION['tm_id'];
$suggested_text = $_POST['suggested_text'];
if ( is_numeric($real_sentence_id) ) {
//get real sentence extra suggestions count
$extra_suggestions_count = $real_sentences_sugg_obj->getRealSentenceExtraSuggestionsCountBySentenceId( $real_sentence_id );
if ( $extra_suggestions_count < 3 ) {
//save extra suggestion
$result_save_extra_suggestion = $real_sentences_sugg_obj->saveRealSentenceExtraSuggestion( $real_sentence_id, $user_id, $suggested_text );
if ($result_save_extra_suggestion == true) {
$data['status'] = 200;
$data['msg'] = "Suggestion submitted successfully!";
} else {
$data['status'] = 300;
$data['msg'] = "Something went wrong! Vote could not submit at the moment, Please try again.";
}
} else {
$data['status'] = 300;
$data['msg'] = "Your suggestion could not submit, we have already received 3 suggestions.";
}
} else {
$data['status'] = 300;
$data['msg'] = "Something went wrong, Please try again.";
}
} else {
$data['status'] = 300;
$data['msg'] = "Something went wrong, Please try again.";
}
echo json_encode($data);