File: //proc/thread-self/root/proc/thread-self/cwd/counselor/question-sotal.php
<?php
include_once('header.php');
$spaceArray = array(
"<p> </p>", "<br />", "<strong> </strong>", "<strong></strong>", "</strong><strong>", "<p></p>", "<p class=\"Style\"> </p>", " </p>", "<p> ",
" <br/><br/></p>", "<p><strong><br/></strong></p>", "<br/><br/></p>", "<p> ", "<p> </p>", "<p><strong></strong></p>",
"<p> </p>", "<p> </p>", "<br>", " ", "<br/>", "<br >", "<p><strong><br /></strong></p>", "font-size: small;", "src=https", "https://selfanalyse.com/wp-content/plugins/tet-india/files/", "../wp-content/plugins/tet-india/files/"
);
$replaceSpaceArray = array("", "", "", "", "", "", "", "</p>", "<p>", "</p>", "", "</p>", "<p>", "", "", "", "", "", "", "", "", "", "", "src=\"https", "https://selfanalyse.com/", "");
$getQuesAptQuery = "SELECT el.id, el.question_id, el.display_order, el.topic_id, q.question_statement, q.option_1, q.option_2, q.option_3, q.option_4, q.option_5, e.category_name FROM `wp_psy_sp_exam_question_linkage` as el LEFT JOIN `wp_psy_sp_question` as q ON q.question_id=el.question_id LEFT JOIN `wp_psy_exams` as e ON e.exam_category_id=el.topic_id where el.exam_type_id='54786' order by el.display_order";
$getQuesAptData = $wpdb->get_results($getQuesAptQuery);
if (isset($_REQUEST["editOrder"])) {
$qlid = $_POST['qlid'];
$ques_order = $_POST['ques_order'];
if ($qlid != '' && $ques_order != '') {
$updateQuery = $wpdb->query("update `wp_psy_sp_exam_question_linkage` set display_order='$ques_order' where id='$qlid'");
echo "update `wp_psy_sp_exam_question_linkage` set display_order='$ques_order' where id='$qlid'";
//echo '<meta http-equiv="refresh" content="0">';
}
}
?>
<style>
.modal-backdrop {
z-index: 999 !important;
}
table.dataTable.nowrap th,
table.dataTable.nowrap td {
white-space: nowrap !important;
}
.page-title {
float: left;
width: 100%;
}
</style>
<div class="page-inner">
<div class="page-title">
<div class="col-md-4">
<h3>Psychometric Test</h3>
<div class="page-breadcrumb">
<ol class="breadcrumb">
<li><a href="dashboard">Home</a></li>
<li class="active">SOTAL Test Questions </li>
</ol>
</div>
</div>
<div class="col-md-8">
<div class="navbar-right">
<ul class="navul">
<li><a href="question-apt">Aptitude</a></li>
<li><a href="question-per-a">Personality (Adult)</a></li>
<li><a href="question-per-t">Personality (Teenagers)</a></li>
<li><a href="question-sa">Self-Assessment</a></li>
<li><a href="question-sotal" style="color:#000;">SOTAL</a></li>
</ul>
</div>
</div>
</div>
<div id="main-wrapper">
<div class="col-md-12" style="padding:0;">
<div class="panel panel-info">
<div class="panel-heading clearfix">
<h4 class="panel-title">SOTAL Test Questions</h4>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="display " id="userList" style="font-size: 13px;">
<thead>
<tr>
<th>Id</th>
<th>Question Id</th>
<th>Order</th>
<th>Question</th>
<th>Option1</th>
<th>Option2</th>
<th>Option3</th>
<th>Option4</th>
<th>Option5</th>
<th>Ability</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
foreach ($getQuesAptData as $qdt) {
$question_option_1_answer = $qdt->option_1;
$question_option_2_answer = $qdt->option_2;
$question_option_3_answer = $qdt->option_3;
$question_option_4_answer = $qdt->option_4;
$question_option_5_answer = $qdt->option_5;
$question_test_passage = $qdt->question_instruction;
$question_statement = $qdt->question_statement;
$root_link = '"' . get_bloginfo('url') . '/';
$qID = $test_question_id;
$question = str_replace('"../', $root_link, $question_statement);
$question = str_replace($spaceArray, $replaceSpaceArray, $question);
$option1 = str_replace('"../', $root_link, $question_option_1_answer);
$option1 = str_replace($spaceArray, $replaceSpaceArray, $option1);
$option2 = str_replace('"../', $root_link, $question_option_2_answer);
$option2 = str_replace($spaceArray, $replaceSpaceArray, $option2);
if ($question_option_3_answer) {
$option3 = str_replace('"../', $root_link, $question_option_3_answer);
$option3 = str_replace($spaceArray, $replaceSpaceArray, $option3);
} else {
$option3 = "";
}
if ($question_option_4_answer) {
$option4 = str_replace('"../', $root_link, $question_option_4_answer);
$option4 = str_replace($spaceArray, $replaceSpaceArray, $option4);
} else {
$option4 = "";
}
if ($question_option_5_answer) {
$option5 = str_replace('"../', $root_link, $question_option_5_answer);
$option5 = str_replace($spaceArray, $replaceSpaceArray, $option5);
} else {
$option5 = "";
}
?>
<tr>
<td><?php echo $i; ?></td>
<td><?php echo $qdt->question_id; ?></td>
<td><?php echo $qdt->display_order; ?><span class="glyphicon glyphicon-sort-by-attributes" aria-hidden="true" title="Update display order" style="cursor:pointer;font-size:20px;" data-toggle="modal" data-id="<?php echo $qdt->id; ?>" data-target="#updateQuesOrder"></span></td>
<td><?php echo $question ?></td>
<td><?php echo $option1; ?></td>
<td><?php echo $option2; ?></td>
<td><?php echo $option3; ?></td>
<td><?php echo $option4; ?></td>
<td><?php echo $option5; ?></td>
<td><?php echo $qdt->category_name; ?></td>
<td><a href="edit-question?quesId=<?php echo $qdt->question_id; ?>" target="_blank"><span class="glyphicon glyphicon-edit" aria-hidden="true" style="cursor:pointer;font-size:20px;"></span></a></td>
</tr>
<?php $i++;
} ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div><!-- Main Wrapper -->
<!-------------------edit ability modal---------------->
<div class="modal fade" id="updateQuesOrder" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content" style="border: 3px solid #ccc;">
<div class="modal-header" style="padding: 5px 10px 0px 0px; height: 20px;">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<div class="modal-body" id="update_ques_order"></div>
</div>
</div>
</div>
<div class="page-footer">
<p class="no-s">shinemetrics.com</p>
</div>
</div><!-- Page Inner -->
<script type="text/javascript" charset="utf-8">
jQuery.noConflict();
jQuery(function($) {
$('#userList').dataTable({
"bPaginate": true,
"iDisplayLength": 200,
"responsive":true,
"lengthMenu": [
[200, 300, 400, 500, 1000],
[200, 300, 400, 500, 1000]
]
});
jQuery('#updateQuesOrder').on('show.bs.modal', function(event) {
var button = $(event.relatedTarget);
var qlid = button.data('id');
//alert(qlid);
var url = "/counselor/question-per-a-edit.php";
jQuery.ajax({
url: url,
type: 'POST',
data: {
qlid: qlid
},
success: function(data) {
document.getElementById("update_ques_order").innerHTML = data;
}
});
});
});
function submitAprForm() {
if (document.getElementById("descr").value == '') {
alert("Description can not empty");
document.getElementById("descr").focus();
event.preventDefault();
return false;
}
}
</script>
<link href="assets/css/jquery.dataTables.min.css" rel="stylesheet">
<link href="assets/css/responsive.dataTables.min.css" rel="stylesheet">
<script src="assets/js/jquery.dataTables.min.js"></script>
<script src="assets/js/dataTables.responsive.min.js"></script>
<?php
include_once('footer.php');
?>