File: /var/www/nclive/technc/exam_list_editor.php
<?php include 'header.php'; ?>
<style>
.total_ques_div
{
background-color: white;
border-color: #C8D5E0;
border-image: none;
border-style: solid;
border-width: 1px 1px 2px;
color: #1E598E;
font-weight: bold;
padding: 8px 10px;
text-decoration: none;
}
.form-table td
{
padding:0px !important;
}
.extLink{
text-decoration: none;
cursor: pointer;
}
.fancybox-skin
{ margin-left: 400px!important;
width: 500px!important;
}
.form-table td {
padding: 5px !important;
}
</style>
<script type="text/javascript" charset="utf8" src="https://code.jquery.com/jquery-3.3.1.js"></script>
<main id="main-container">
<div class="content content-narrow">
<div class="row">
<div class="col-lg-12">
<h2 class="content-heading">Exam Link List</h2>
<div class="table-responsive">
<table id="payu" class="table table-striped table-bordered dt-responsive nowrap" style="width: 100%; cellspacing: 0;">
<thead>
<tr>
<th>S.no</th>
<th>Status</th>
<th>Edit </th>
<th>Exam name</th>
<th>Type</th>
<th>Url Slug</th>
<th>Domain name</th>
<th>Category</th>
<th>State</th>
<th>Post name</th>
</tr>
</thead>
<tbody id="payu_list">
</tbody>
</table>
<script type="text/javascript">
jQuery.ajax({
url: '<?php echo ADMIN_URL;?>/exam_list_data.php',
data: {
format: 'json'
},
error: function() {
$('#payu').html('<p>An error has occurred</p>');
},
dataType: 'json',
success: function(data) {
console.log(data);
var Data = '';
var j=0;
var msg= "'Are you sure'";
for (var i = 0; i < data.length; i++) {
var k=parseInt(i+1);
var ty=1;
Data += '<tr><td>'+data[i].exam_id+'</td>';
if(data[i].status == 1){
Data += '<td><a style="cursor:pointer;" id='+data[i].exam_id+','+data[i].status+'><span id="status" style="color:green;">Active</span></a></td>';
} else if(data[i].status == 0) {
Data += '<td><a style="cursor:pointer;" id='+data[i].exam_id+','+data[i].status+'><span id="status" style="color:red;">Deactive</span></a></td>';
}
Data +='<td><a href="editor_exam_update.php?id='+data[i].exam_id+'"> Edit</a></td>';
Data +='<td>'+data[i].exam_name+ '</td>';
Data +='<td>'+data[i].type+'</td><td>'+data[i].url_slug+'</td><td>'+data[i].off_web_link+'</td><td>'+data[i].name+'</td><td>'+data[i].state_name+'</td><td>'+data[i].post_name+'</td></tr>';
}
document.getElementById('payu_list').innerHTML = Data;
jQuery('#payu').dataTable( {
"bPaginate": true,
"responsive": true,
"iDisplayLength": 20,
"lengthMenu": [[20, 50, 100, 500, 1000], [20, 50, 100, 500, 1000]]
});
},
type: 'GET'
});
</script>
</div>
</div>
</div>
</div>
<script type="text/javascript">
function update(id){
var str = id;
var array = str.split(',');
var status = array[1];
$.ajax('status_active.php', {
type: 'POST', // http method
data: { id:id }, // data to submit
success: function (data, status, xhr) {
//console.log(data);
var update_id=data.st;
if(status!=update_id){
location.reload();
}
},
error: function (jqXhr, textStatus, errorMessage) {
}
});
}
</script>
<?php include 'footer.php'; ?>