| 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';
$sql1 = 'SELECT user_id FROM `tbl_user_votes_marketing_tmn` WHERE 1 group by user_id';
$result1 = $mysqli->query($sql1);
if ($result1->num_rows > 0) {
$data['status'] = 200;
while ($row1 = $result1->fetch_object()) {
$user_id = $row1->user_id;
$sql2 = 'SELECT t.suggestion_id, m.*, s.is_open_for_voting FROM `tbl_user_votes_marketing_tmn` t INNER JOIN tbl_user_suggestion_marketing_mapping m ON m.id = t.suggestion_id INNER JOIN tbl_sentence_marketing s on s.id = m.sentence_id WHERE t.user_id = "'.$user_id.'" AND m.is_winning = 1';
$result2 = $mysqli->query($sql2);
$winning_sentences = $result2->num_rows;
$sql3 = 'SELECT t.suggestion_id, m.*, s.is_open_for_voting FROM `tbl_user_votes_marketing_tmn` t INNER JOIN tbl_user_suggestion_marketing_mapping m ON m.id = t.suggestion_id INNER JOIN tbl_sentence_marketing s on s.id = m.sentence_id WHERE t.user_id = "'.$user_id.'" AND s.is_open_for_voting = 0';
$result3 = $mysqli->query($sql3);
$closed_sentences = $result3->num_rows;
$sql4 = 'SELECT t.suggestion_id, m.*, s.is_open_for_voting FROM `tbl_user_votes_marketing_tmn` t INNER JOIN tbl_user_suggestion_marketing_mapping m ON m.id = t.suggestion_id INNER JOIN tbl_sentence_marketing s on s.id = m.sentence_id WHERE t.user_id = "'.$user_id.'"';
$result4 = $mysqli->query($sql4);
$total_voted_sentences = $result4->num_rows;
/*$sql5 = 'UPDATE tbl_translators SET total_votes_marketing = "'.$total_voted_sentences.'", closed_votes_marketing = "'.$closed_sentences.'", winning_votes_marketing = "'.$winning_sentences.'" WHERE id = "'.$user_id.'"';
$result5 = $mysqli->query($sql5);*/
echo "<br>====".$user_id."==total==".$total_voted_sentences."==closed==".$closed_sentences."==winning==".$winning_sentences;
}
}
exit;
?>