File: /var/www/sectest.concertium.com/public_bak/wp-content/themes/dt-the7/dt-scroing_system.php
<link href="<?php echo get_template_directory_uri(); ?>/css/style.css" rel="stylesheet">
<div class="scoring-wrapper">
<!-- Content part -->
<div class="scoring-container">
<!--<h1>DT Scoring Matrix</h1>-->
<div class="scoring-start-box text-center no-padding-top no-padding-bottom no-box-shadow">
<h1>DT Scoring Matrix</h1>
<p>These questions relate to IT Infrastructure Management, Security Management, Data Integration and digital transformation practices within your company.
</p>
<button type="button" class="scoring-button" id="question_start_button">OK</button>
</div>
</div>
<!-- /Content part -->
<!-- Question box -->
<div class="scoring-container" id="question-answer-container">
<div class="heading-wrapper">
<h2>DT Scoring Matrix</h2>
<?php
$all_questions_answer = get_posts(array(
'post_type' => 'scroing_system',
'numberposts' => -1
));
$total_question_answer = count($all_questions_answer);
$total_max_score = ($total_question_answer * 100);
?>
<div class="scoring-right-pan" id="progress_barHTML">
<span class="scor-ans-text">0 of <?php echo $total_question_answer;?> answered</span>
<div class="scor-preload-pan">
<span style="width: 0%"></span>
</div>
</div>
<div class="clearfix"></div>
</div>
<?php
$question_type = get_terms( 'scoring-category', 'orderby=id&hide_empty=0&parent=0' );
if(!empty($question_type))
{
$cat_count = 1;
$count = 1;
foreach($question_type as $question_type_val)
{
$question_type_id = $question_type_val->term_id;
$question_type = $question_type_val->name;
?>
<div class="question-type-cat" id="question-type-cat_<?php echo $question_type_id;?>">
<h3 class="question-heading"><span>A</span> <?php echo $question_type;?></h3>
<?php
$all_questions = get_posts(array(
'post_type' => 'scroing_system',
'numberposts' => -1,
'tax_query' => array(
array(
'taxonomy' => 'scoring-category',
'field' => 'term_id',
'terms' => $question_type_id,
)
)
));
//echo '<pre>';print_r($all_questions);
if(!empty($all_questions))
{
$total_max_marks = ((count($all_questions))*100);
foreach($all_questions as $all_questions_val)
{
$question_Id = $all_questions_val->ID;
# Fetch all the answers and its marks
$answer1 = get_post_meta($all_questions_val->ID,'answer1',true);
$answer2 = get_post_meta($all_questions_val->ID,'answer2',true);
$answer3 = get_post_meta($all_questions_val->ID,'answer3',true);
$answer4 = get_post_meta($all_questions_val->ID,'answer4',true);
$answer_score1 = get_post_meta($all_questions_val->ID,'answer1_marks',true);
$answer_score2 = get_post_meta($all_questions_val->ID,'answer2_marks',true);
$answer_score3 = get_post_meta($all_questions_val->ID,'answer3_marks',true);
$answer_score4 = get_post_meta($all_questions_val->ID,'answer4_marks',true);
?>
<div class="scoring-box-panel <?php if($count == 1){ ?>active<?php }?>">
<div class="scoring-question"><?php echo $count;?>. <?php echo $all_questions_val->post_title;?></div>
<form>
<div class="form-panel">
<?php if($answer1 != ''){?>
<div class="radio">
<input type="radio" name="radio" id="radio1_<?php echo $all_questions_val->ID;?>" value="<?php echo $answer1;?>" class="scor-click" data-score="<?php echo $answer_score1;?>" data-category="<?php echo $question_type_id;?>" data-question="<?php echo $question_Id;?>">
<label for="radio1_<?php echo $all_questions_val->ID;?>"><?php echo $answer1;?>
</label>
</div>
<?php }?>
<?php if($answer2 != ''){?>
<div class="radio">
<input type="radio" name="radio" id="radio2_<?php echo $all_questions_val->ID;?>" value="<?php echo $answer2;?>" class="scor-click" data-score="<?php echo $answer_score2;?>" data-category="<?php echo $question_type_id;?>" data-question="<?php echo $question_Id;?>">
<label for="radio2_<?php echo $all_questions_val->ID;?>"><?php echo $answer2;?>
</label>
</div>
<?php }?>
<?php if($answer3 != ''){?>
<div class="radio">
<input type="radio" name="radio" id="radio3_<?php echo $all_questions_val->ID;?>" value="<?php echo $answer3;?>" class="scor-click" data-score="<?php echo $answer_score3;?>" data-category="<?php echo $question_type_id;?>" data-question="<?php echo $question_Id;?>">
<label for="radio3_<?php echo $all_questions_val->ID;?>"><?php echo $answer3;?>
</label>
</div>
<?php }?>
<?php if($answer4 != ''){?>
<div class="radio">
<input type="radio" name="radio" id="radio4_<?php echo $all_questions_val->ID;?>" value="<?php echo $answer4;?>" class="scor-click" data-score="<?php echo $answer_score4;?>" data-category="<?php echo $question_type_id;?>" data-question="<?php echo $question_Id;?>">
<label for="radio4_<?php echo $all_questions_val->ID;?>"><?php echo $answer4;?>
</label>
</div>
<?php }?>
</div>
</form>
</div>
<?php
$count++;
} //all_questions foreach end
} //all_questions empty check end
else
{
$total_max_marks = 0;
}
unset($all_questions);
?>
<div class="scor-chart-pan" id="category_result_<?php echo $question_type_id;?>">
<div class="gauge-chart">
<canvas id="scor-chart_<?php echo $question_type_id;?>" class="scor-chart"></canvas>
</div>
<div class="scor-chart-right">
Your Total Score
<span class="scor-bog-text" id="scor-bog-text_<?php echo $question_type_id;?>"></span>
<div class="scor-thumb-pan">
<i class="fa fa-thumbs-up" aria-hidden="true"></i>
<span>*Max <?php echo $total_max_marks;?></span>
</div>
</div>
<div class="scor-chart-comment">
<label>Comments</label>
<div class="textarea-wrapper">
<textarea row="1" cols="6" class="input-panel" id="category_comments_<?php echo $question_type_id;?>"></textarea>
<button type="button" class="scoring-button-category scoring-button" id="category_comments_button_<?php echo $question_type_id;?>" data-category="<?php echo $question_type_id;?>">Send</button>
</div>
</div>
</div>
<?php if($cat_count == 4) {?>
<div id="help-us-container">
<div class="scoring-box-panel text-center active">
<p>Following review of your enterprise’s DT SCORE, feel free to reach out to us to see how Concertium can help you connect your data,
devices & people to create competitive advantage through digital transformation.
</p>
<button type="button" class="scoring-button" id="helpus_text_button">OK</button>
</div>
<div class="scoring-box-panel ">
<p class="scor-form-heading">Please provide your contact information to see the results.</p>
<form>
<div class="form-panel02">
<label>Your Name</label>
<input type="text" class="input-panel" name="your_name" id="your_name">
<span class="text-danger"></span>
</div>
<div class="form-panel02">
<label>Email Address</label>
<input type="email" class="input-panel" name="your_email" id="your_email">
<span class="text-danger"></span>
</div>
<div class="form-panel02">
<label>Phone Number</label>
<input type="tel" class="input-panel" name="your_phone" id="your_phone">
<span class="text-danger"></span>
</div>
<button type="button" class="scoring-button" id="helpus_button">Done</button>
</form>
</div>
</div>
<?php }?>
</div>
<?php
$cat_count++;
} //question_type foreach end
} //question_type empty check end
?>
<div id="final_score">
<div class="scor-chart-pan">
<div class="gauge-chart">
<canvas id="scor-chart1" class="scor-chart"></canvas>
</div>
<div class="scor-chart-right">
Your Total Score
<span class="scor-bog-text"></span>
<div class="scor-thumb-pan">
<i class="fa fa-thumbs-up" aria-hidden="true"></i>
<span>*Max <?php echo $total_max_score;?></span>
</div>
</div>
</div>
<div class="scoring-box-wrapper" id="all_category_result">
</div>
<div class="scor-chart-comment" id="final_comment">
<label>Comments</label>
<div class="textarea-wrapper">
<textarea row="1" cols="6" class="input-panel" id="final_comments"></textarea>
</div>
<div class="text-center">
<button type="button" class="scoring-button" id="complete_button">Done</button>
</div>
</div>
</div>
</div>
<!-- /Question box -->
<button type="button" class="scoring-button" id="scoring_submit_button" onclick="">Submit</button>
</div>