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

 

Command :


[ Back ]     

Current File : /home/transmarket/translator/controllers/save_voting_marketing_map.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';

require_once('functions.voting_marketing.php');
$voting_marketing_obj = new Voting_marketing();

require_once('functions.suggestions_marketing.php');
$suggestions_marketing_obj = new Suggestions_marketing();

require_once('functions.suggestions.php');
$suggestions_obj = new Suggestions();

if (isset($_POST['sentence_id']) && isset($_POST['suggestion_id']) && isset($_SESSION['tm_id'])) {
	
    $sentence_id = $_POST['sentence_id'];
    $suggestion_id = $_POST['suggestion_id'];
    $user_id = $_SESSION['tm_id'];
    $language_id = $_SESSION['tm_language_id'];
	
	if (is_numeric($sentence_id) && is_numeric($suggestion_id)) {		
		
		//get success voting count for sentence		
		$success_voting_count = $voting_marketing_obj->get_success_marketplace_voting_count_by_sentence_id($sentence_id);
		
		//check success voting count less than maximum voting (11)
		if ( $success_voting_count < $global_max_voting_count ) {
			
			//update suggestion pending started at date in tbl_sentence_marketing (if not updated yet)
			$suggestions_marketing_obj->updateMarketplaceSentencePendingAtDate( $sentence_id );
				
			//update voting started at date in tbl_sentence_marketing (if not updated yet)
			$suggestions_marketing_obj->updateMarketplaceSentenceVotingStartedAtDate( $sentence_id );

			//get sentence count which user has not voted for sentence 			
			$user_voting_count = $voting_marketing_obj->get_marketplace_user_empty_vote_count_by_sentence_id_and_user_id($sentence_id, $user_id);
		
		    //check if user not voted count is 1
			if( $user_voting_count == 1 ) {

				//apply user vote. update user vote for sentence suggestion to success				
				$resultUpdateS = $voting_marketing_obj->applySuccessUserVoteForSMarketplaceSentenceSuggestion($suggestion_id,$sentence_id,$user_id);
								
				if ($resultUpdateS == true) {
					
					//after submit again check success vote count for sentence 
					$success_voting_count2 = $voting_marketing_obj->get_success_marketplace_voting_count_by_sentence_id($sentence_id);
					
					//get no. of success voting to single suggestion
					$no_of_success_voting_to_single_suggestion = $suggestions_obj->getSettingsValuesByColumnName( 'no_of_success_voting_to_single_suggestion' );
					
					//get count - sentence has reached No. of Target Success Voting To a Particular Suggestion 
					$check_sentence_reached_no_of_success_voting_suggestion = $voting_marketing_obj->checkMarketplaceSentenceHasReachedNoOfSuccessVotesForSuggestion($sentence_id, $no_of_success_voting_to_single_suggestion);
					
					//check count greater or equal to maximum voting count (11) or if any sentence suggestion got max no. of success voting (5) then return 1
					if( $success_voting_count2 >= $global_max_voting_count || $check_sentence_reached_no_of_success_voting_suggestion >= 1 ) {			
					
						// Close Sentence for voting. Voting completed for sentence suggestion
						$voting_marketing_obj->closeMarketplaceVotingForSentence($sentence_id);
						
						//require_once('functions.winning_suggestion_voting_credits.php');						
						//$wsvc_obj = new Winning_Suggestion_Voting_Credits();

						//Process winning suggestion user credits and winning suggestion voted user id credits by sentence id
						//$wsvc_obj->processWinningSuggestionVotingCreditsBySentenceId( $sentence_id );
						
					}
				
					$data['status'] = 200;
				    $data['msg'] = "Vote submitted successfully.";
					
				} else {					
					$data['status'] = 300;
				    $data['msg'] = "Vote timed out took more than 5 mins";
				}				
				
			
			} else {
				
				$data['status'] = 300;
				$data['msg'] = "You have already submitted vote for this suggestion.";
				
			}
			
		} else {	
			
			//make user vote failed. 				
			$voting_marketing_obj->makeMarketplaceUserVoteFailedBySentenceIdAndUserId($sentence_id,$user_id);
			
			$data['status'] = 300;
			$data['msg'] = "This sentence has already reached " . $global_max_voting_count . " votes.<br> Please skip this and contribute on a new one.";
			
		}
		
	} 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);

Youez - 2016 - github.com/yon3zu
LinuXploit