| Server IP : 64.202.187.69 / Your IP : 216.73.217.74 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/testadministrator/devsite/ |
Upload File : |
<?php
// Listing of active users
include 'header.php';
?>
<div class="row">
<div class="col-xs-12">
<div class="card">
<div class="card-header">
<h3 class="header-title">Vote Suggestions</h3>
</div>
<div class="card-body no-padding">
<div class="" style="margin-top: 10px; padding-left: 15px; padding-right: 15px;">
<div class="sentence-outer mb-2 pb-1 border-bottom">
<div class="mb-1"><strong>Original Sentence:</strong></div>
<div class="original_sentence"></div>
</div>
<div class="table-responsive">
<table class="datatable1 table table-striped primary " id="tblUser" cellspacing="0" width="100%">
<thead>
<tr>
<th>Suggestions</th>
<th>Email</th>
<th>Is Winning Sentence?</th>
<th>Credits</th>
<th>Winning TMN Credits</th>
<th>Total Votes</th>
<th>Suggested at</th>
<th>View</th>
</tr>
</thead>
<tbody class="team-members">
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Modal Small Size -->
<div class="modal fade" id="modalUsers" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="myModalLabel">Voted Users</h4>
</div>
<div class="modal-body">
<ul class="user-list"><div class="loader" style="display: block;"></div></ul>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<?php include 'footer.php'; ?>
<script type="text/javascript">
var colorName = "bg-green";
var placementFrom = "top";
var placementAlign = "right";
var animateEnter = "";
var animateExit = "";
$(document).ready(function () {
get_sentence();
function get_sentence() {
$.ajax({url: 'controllers/get_marketplace_sentence.php',
data: {
id: "<?php echo base64_decode($_GET['id']); ?>"
},
type: 'post',
dataType: 'JSON',
success: function (output) {
$('.original_sentence').html(output.html);
}
});
}
initialiseDatatable();
function initialiseDatatable() {
$('.datatable1').dataTable().fnDestroy();
$('.directory-list').html('');
if ($.fn.dataTable.isDataTable('.datatable1')) {
$('.datatable1').DataTable().clear().destroy();
}
var dataTable = $('.datatable1').DataTable({
"oLanguage": {"sLengthMenu": "\_MENU_", 'sSearch': '', 'sSearchPlaceholder': "Search..."},
"processing": true,
"bDestroy": true,
"serverSide": true,
"bAutoWidth": false,
"searching": true,
"destroy": true,
"columnDefs": [
{
"targets": [0],
"searchable": true,
"orderable": true,
"visible": true,
}, {
"targets": [1],
"searchable": true,
"orderable": true,
"visible": true,
}, {
"targets": [2],
"searchable": false,
"orderable": false,
"visible": true,
}, {
"targets": [3],
"searchable": false,
"orderable": false,
"visible": true,
}, {
"targets": [4],
"searchable": false,
"orderable": false,
"visible": true,
}, {
"targets": [5],
"searchable": false,
"orderable": false,
"visible": true,
}, {
"targets": [6],
"searchable": false,
"orderable": true,
"visible": true,
}, {
"targets": [7],
"searchable": false,
"orderable": false,
"visible": true,
}
],
"order": [
[6, "desc"]
],
"lengthMenu": [[25, 50, 100, 200], [25, 50, 100, 200]],
"ajax": {
url: "controllers/get_vote_suggestion_list_marketplace.php", // json datasource
type: "post", // method , by default get
data: {
id: "<?php echo base64_decode($_GET['id']); ?>"
},
error: function () { // error handling
$(".team-members").append('<tr><td colspan="9">No data found</td></tr>');
}
}
});
$('input[type="search"]').addClass('txt-search');
displayPageInfo();
}
$(".sh-checkbox-all").change(function () {
if (this.checked) {
$(".sh-checkbox").prop("checked", true);
$(".btn-multi-delete").attr('disabled', false);
} else {
$(".sh-checkbox").prop("checked", false);
$(".btn-multi-delete").prop('disabled', true);
$(".sh-checkbox-all").prop("checked", false);
}
});
$("body").on('change', '.sh-checkbox', function () {
if (!this.checked) {
$(".sh-checkbox-all").prop("checked", false);
}
$(".btn-multi-delete").attr('disabled', true);
enableButton();
});
function enableButton() {
$(".btn-multi-delete").attr('disabled', true);
$(".sh-checkbox").each(function () {
if ($(this).prop("checked") == true) {
$(".btn-multi-delete").attr('disabled', false);
}
});
}
$("body").on('click', '.btn-multi-delete', function () {
$('#modal-multi-delete').modal('show');
});
$("body").on('click', '.sh-delete', function () {
$("#inpUserId").val($(this).parent().attr('data-id'));
$('#modal-delete').modal('show');
});
$("body").on('click', '.total-votes', function () {
$('.user-list').html('<div class="loader" style="display: block;"></div>');
$.ajax({url: 'controllers/get_vote_users.php',
data: {
id: $(this).attr('data-id'),
tele_id: $(this).attr('data-tele'),
},
type: 'post',
success: function (output) {
$('.user-list').html(output);
}
});
});
$("body").on('click', '.btn-multi-delete-yes', function () {
var selchDeleteBox = []; // initialize empty array
$(".multiDelete:checked").each(function () {
selchDeleteBox.push($(this).val());
});
if (selchDeleteBox.length > 0)
{
$.ajax({url: 'controllers/delete_suggestion_marketplace.php',
data: {
id: selchDeleteBox,
type: 1,
},
type: 'post',
dataType: 'JSON',
success: function (output) {
// console.log(output.status);
if (output.status == "200") {
$('#modal-multi-delete').modal('hide');
$('.modal-backdrop').remove();
showNotification(colorName, "Deleted successfully", placementFrom, placementAlign, animateEnter, animateExit);
initialiseDatatable();
}
}
});
}
});
$('.btn-delete').click(function () {
$.ajax({url: 'controllers/delete_suggestion_marketplace.php',
data: {
id: $("#inpUserId").val(),
type: 0,
},
type: 'post',
dataType: 'JSON',
success: function (output) {
if (output.status == "200") {
$('#modal-delete').modal('hide');
$('.modal-backdrop').remove();
showNotification(colorName, "Deleted successfully ", placementFrom, placementAlign, animateEnter, animateExit);
// $(".team-members tr[data-id='" + $("#inpUserId").val() + "']").remove();
// $('#tblUser').DataTable( {destroy: true});
initialiseDatatable();
$(".btn-multi-delete").attr('disabled', true);
}
}
});
});
$(".submit-form").submit(function (e) {
if ($('.upload-excel').val() != '' && $('#select-category').val() != '') {
$(".submit-form").prop('disabled', true);
$('.main-div').addClass('__loading');
$('.loader-container').css('display', 'block');
var fd = new FormData(this);
fd.append('category_id', $('#select-category').val());
$.ajax({
url: 'controllers/import_excel.php',
type: 'post',
data: fd,
processData: false,
contentType: false,
dataType: 'JSON',
success: function (output) {
console.log(output);
if (output.status == 200) {
showNotification(colorName, "File processed succesfully", placementFrom, placementAlign, animateEnter, animateExit);
$('#info-table').html(output.error_table);
$('#modal-info').modal('show');
initialiseDatatable();
} else {
showNotification('bg-orange', "Error in processing. Please upload correct file.", placementFrom, placementAlign, animateEnter, animateExit);
}
$('.main-div').removeClass('__loading');
$('.loader-container').css('display', 'none');
$('.upload-excel').val('');
$(".submit-form").prop('disabled', false);
}
});
} else {
showNotification('bg-orange', "Please select file and category", placementFrom, placementAlign, animateEnter, animateExit);
}
e.preventDefault();
});
});
function displayPageInfo() {
$(".dataTables_info").each(function() {
$(this).prependTo($(this).closest(".dataTables_wrapper"));
});
}
</script>