HEX
Server: Apache
System: Linux server1.panigaletech.com 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/sectest.concertium.com/public_bak/wp-content/themes/dt-the7/dt_scroing_result.php
<?php
global $wpdb;
$all_contact_details = $wpdb->get_results( "SELECT * FROM `dt_scoring_contactdetails_master` WHERE i_id >0 ORDER BY dt_created_on DESC" );
if(!empty($all_contact_details))
{
?>
	<table width="100%" border="1">
		<tr>
			<th>#</th>
			<th>Name</th>
			<th>Email</th>
			<th>Phone No</th>
			<th>Total Score</th>
	<?php
		$question_type = get_terms( 'scoring-category', 'orderby=id&hide_empty=0&parent=0' );
		if(!empty($question_type))
		{
			foreach($question_type as $question_type_val)
			{
	?>
				<th><?php echo $question_type_val->name;?></th>
	<?php
			}
		}
	?>
			<th>Date</th>
		</tr>	
<?php
	$count = 1;
	foreach($all_contact_details as $all_contact_details_val)
	{
		$contact_id = $all_contact_details_val->i_id;
		$all_answered_marks = $wpdb->get_results( "SELECT SUM(s_answer_marks) as total_score FROM `dt_scoring_details` WHERE i_reviewer_id = ".$contact_id."" );
?>
		<tr>
			<td><?php echo $count;?></td>
			<td><?php echo $all_contact_details_val->s_name;?></td>
			<td><?php echo $all_contact_details_val->s_email;?></td>
			<td><?php echo $all_contact_details_val->s_phone_number;?></td>
			<td style="text-align:center;"><?php echo $all_answered_marks[0]->total_score;?></td>
	<?php
		if(!empty($question_type))
		{
			foreach($question_type as $question_type_val)
			{
				$question_type_id = $question_type_val->term_id;
				$all_answered_marks_categorywise = $wpdb->get_results( "SELECT SUM(s_answer_marks) as total FROM `dt_scoring_details` WHERE i_reviewer_id = ".$contact_id." AND i_question_type_id = ".$question_type_id."" );
				if(!empty($all_answered_marks_categorywise))
				{
					$marks = $all_answered_marks_categorywise[0]->total;
				}
				else
				{
					$marks = 0;
				}
	?>
				<td style="text-align:center;"><?php echo $marks;?></td>
	<?php
			}
		}
	?>
			<td><?php echo date('m-d-Y',strtotime($all_contact_details_val->dt_created_on));?></td>
		</tr>
<?php 
	$count++;
	}
?>
	</table>
<?php
}
?>