| Server IP : 64.202.187.69 / Your IP : 216.73.216.192 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';
if (isset($_SESSION['tm_id'])) {
//default 5, if not set any
$min_days_for_next_tmn_claim = 5;
$sql_uud_settings = 'SELECT * FROM settings WHERE id = 1';
$result_uud_settings = $mysqli->query( $sql_uud_settings );
while( $row_uud_settings = $result_uud_settings->fetch_object() ) {
$min_days_for_next_tmn_claim = $row_uud_settings->min_days_for_next_tmn_claim;
}
$sql = 'SELECT * FROM `tbl_translators` WHERE id="' . $_SESSION['tm_id'] . '"';
$result = $mysqli->query($sql);
while ($row = $result->fetch_object()) {
$name = $row->name;
$email = $row->email;
$neo_address = $row->neo_address;
$is_verified = $row->is_verified;
//$tmn_credits = $row->tmn_credits;
$language_id = $row->language_id;
$phone = $row->phone;
$country_id = $row->country_id;
$is_neo_verified = $row->is_neo_verified;
$_SESSION['tm_email'] = $email;
$_SESSION['tm_name'] = $name;
$_SESSION['tm_phone'] = $phone;
$_SESSION['tm_country_id'] = $country_id;
$_SESSION['tm_language_id'] = $language_id;
$_SESSION['tm_neo'] = $neo_address;
$_SESSION['tm_neo3'] = trim($row->neo3_address);
//$_SESSION['tm_credits'] = $tmn_credits;
$_SESSION['tm_is_email_verified'] = $is_verified;
$_SESSION['tm_is_neo_verified'] = $is_neo_verified;
$_SESSION['tm_is_claim_pending'] = 0;
$_SESSION['tm_marketplace_access'] = $row->marketplace_access;
$_SESSION['tm_proof_alignment_access'] = $row->alignment_access;
$_SESSION['tm_user_level'] = $row->user_level;
$_SESSION['tm_test_voting_level'] = $row->test_voting_level;
$_SESSION['tm_test_voting_completed_at'] = $row->test_voting_completed_at;
$_SESSION['tm_confirm_watched_intro_video'] = $row->confirm_watched_intro_video;
$sqlClaim = 'select id from translator_claimed_credits where user_id = ' . $_SESSION['tm_id'].' and status = 0';
$resultClaim = $mysqli->query($sqlClaim);
if($resultClaim->num_rows > 0){
$_SESSION['tm_is_claim_pending'] = 1;
}
//get status & no. of days from last request
$sqlClaim2 = 'SELECT status, DATEDIFF( NOW(), created_at ) AS days_from_request_claim FROM translator_claimed_credits WHERE user_id = ' . $_SESSION['tm_id'].' ORDER BY id DESC LIMIT 1';
$resultClaim2 = $mysqli->query($sqlClaim2);
if($resultClaim2->num_rows > 0){
while ($rowClaim2 = $resultClaim2->fetch_object()) {
$status = $rowClaim2->status;
//user last claim days
$no_of_days_from_request_claim = $rowClaim2->days_from_request_claim;
//paid & less than 5 days default if not set any or check with value assigned from admin for this
if( $status == 1 && $no_of_days_from_request_claim <= $min_days_for_next_tmn_claim ) {
$_SESSION['tm_is_claim_pending'] = 1;
}
}
}
$_SESSION['tm_is_topup_pending'] = 0;
$sqlClaim = 'select id from translator_claimed_topups where user_id = ' . $id.' and status = 0';
$resultClaim = $mysqli->query($sqlClaim);
if($resultClaim->num_rows > 0){
$_SESSION['tm_is_topup_pending'] = 1;
}
$language_name = '';
$whatsapp_link = '';
$link_type = 0;
if ($language_id > 0) {
$sqlLang = 'select name, whatsapp_link from languages where id = ' . $language_id;
$resultLang = $mysqli->query($sqlLang);
while ($rowLang = $resultLang->fetch_object()) {
$language_name = $rowLang->name;
$whatsapp_link = $rowLang->whatsapp_link;
if (strpos(strtolower($whatsapp_link), 'whatsapp') !== false) {
$link_type = 1;
}
}
}
$_SESSION['tm_language_name'] = $language_name;
$_SESSION['whatsapp_link'] = $whatsapp_link;
$_SESSION['link_type'] = $link_type;
// print_r($_SESSION); exit;
}
//get total tmn credits
/**$tmn_credits = 0;
$sql_tmn_credits = "SELECT SUM(winning_credits) as tmn_credits FROM winning_suggestion_voting_credits WHERE user_id = " . $_SESSION['tm_id'];
$result_tmn_credits = $mysqli->query( $sql_tmn_credits );
while( $row_tmn_credits = $result_tmn_credits->fetch_object() ) {
$tmn_credits = $row_tmn_credits->tmn_credits ? $row_tmn_credits->tmn_credits : 0;
}
$_SESSION['tm_credits'] = number_format((float)$tmn_credits, 2, '.', '');**/
$tmn_balance = 0;
$sql_tmn_balance = "SELECT tmn_balance FROM translator_tmn_transactions WHERE user_id = " . $_SESSION['tm_id'] . " ORDER BY id DESC LIMIT 1";
$result_tmn_balance = $mysqli->query( $sql_tmn_balance );
if( $result_tmn_balance->num_rows > 0 ) {
while( $row_tmn_balance = $result_tmn_balance->fetch_object() ) {
$tmn_balance = $row_tmn_balance->tmn_balance;
}
}
$_SESSION['tm_credits'] = $tmn_balance;
}