208 lines
5.1 KiB
JavaScript
208 lines
5.1 KiB
JavaScript
$(function(){
|
||
|
||
$('#example1').DataTable();
|
||
$('#datatable').DataTable();
|
||
$('#activemembers').DataTable();
|
||
$('#wiki_list').DataTable({
|
||
"language": {"url": "https://cdn.datatables.net/plug-ins/1.10.19/i18n/Turkish.json"}
|
||
});
|
||
|
||
$('.username').select2();
|
||
|
||
$('.ayarSec').click(function(){
|
||
var id = $(this).attr("data-id")
|
||
var title = $(this).attr("data-title")
|
||
var value = $(this).attr("data-value")
|
||
$(".modal-body #title").val( title );
|
||
$(".modal-body #value").val( value );
|
||
$(".modal-body #id").val( id );
|
||
});
|
||
|
||
$('.logoValue').click(function(){
|
||
var value = $(this).attr("data-value");
|
||
$.post('selectLogo', {value:value}, function(rest){
|
||
location.reload();
|
||
// alert(rest)
|
||
});
|
||
|
||
});
|
||
|
||
$('body').on('click', '#selectAll', function () {
|
||
if ($(this).hasClass('allChecked')) {
|
||
$('input[type="checkbox"]', '#example').prop('checked', false);
|
||
} else {
|
||
$('input[type="checkbox"]', '#example').prop('checked', true);
|
||
}
|
||
$(this).toggleClass('allChecked');
|
||
})
|
||
|
||
$('.link').click(function(){
|
||
var name = $(this).attr("data-link");
|
||
$("#title").val(name);
|
||
|
||
});
|
||
|
||
$('.status').click(function(){
|
||
var stat = $(this).data("status");
|
||
var id = $(this).data("id");
|
||
$.post('ajax/duyuruStatusChange', {id:id, status:status}, function(response){
|
||
|
||
location.reload();
|
||
});
|
||
})
|
||
|
||
$('.sliderStat').click(function(){
|
||
var id = $(this).attr("data-id");
|
||
var status = $(this).attr("data-status");
|
||
$.post('slayt/sliderStatusChange', {id:id, status:status}, function(response){
|
||
location.reload();
|
||
});
|
||
})//sliderStat end
|
||
|
||
|
||
$(".activetionSend").click(function(){
|
||
var param = $(this).data("id");
|
||
|
||
$.post('/panel/user/activemailSendAjax',{par:param},function(data, status, xhr){
|
||
Swal.fire({
|
||
title: data,
|
||
showConfirmButton: false,
|
||
icon: 'success',
|
||
|
||
});
|
||
});
|
||
|
||
|
||
|
||
});//activetionSend
|
||
|
||
$(".sendform").click(function(){
|
||
$.ajax({
|
||
type: 'post',
|
||
url: 'ajax/emailSend',
|
||
data: $('#cevap1').serialize(),
|
||
success:function(cvp){
|
||
|
||
$.confirm({
|
||
title: 'Pisilinux Eposta!',
|
||
content: cvp,
|
||
theme: 'dark',
|
||
buttons: {
|
||
Mesajlar: function(){
|
||
$(location).attr('href', '/panel/iletisim');
|
||
},
|
||
Anasayfa: function(){
|
||
$(location).attr('href', '/panel');
|
||
}
|
||
}
|
||
});
|
||
}
|
||
|
||
});
|
||
});
|
||
|
||
$(".delete_member").click(function(){
|
||
|
||
var param = $(this).data("id");
|
||
Swal.fire({
|
||
title: 'Üyeyi Silmek İstediğinizden Eminmisiniz?',
|
||
text: "Bu işlemi geri alamazsınız",
|
||
icon: 'error',
|
||
showCancelButton: true,
|
||
confirmButtonColor: '#3085d6',
|
||
cancelButtonColor: '#d33',
|
||
confirmButtonText: 'EVET ÜYEYİ SİL',
|
||
cancelButtonText: 'Silme'
|
||
}).then((result) => {
|
||
if (result.isConfirmed) {
|
||
|
||
$.post('user/deleteMemberAjax',{par:param},function(response){
|
||
Swal.fire({
|
||
title: response,
|
||
timer: 1500,
|
||
timerProgressBar: true,
|
||
showConfirmButton: false,
|
||
icon: 'success',
|
||
willClose: () => {
|
||
location.reload();
|
||
}
|
||
});
|
||
});
|
||
}
|
||
})
|
||
});
|
||
|
||
|
||
$(".disable_member").click(function(){
|
||
var param = $(this).data("id");
|
||
$.post('user/disableMemberAjax',{par:param},function(response){
|
||
Swal.fire({
|
||
title: response,
|
||
timer: 2000,
|
||
timerProgressBar: true,
|
||
showConfirmButton: false,
|
||
icon: 'success',
|
||
willClose: () => {
|
||
location.reload();
|
||
}
|
||
});
|
||
});
|
||
});
|
||
|
||
|
||
var sayac1 = Number($("#sayac").val())-1;
|
||
|
||
if(sayac1){
|
||
|
||
var sayac=sayac1+1;
|
||
}else{
|
||
var sayac=1;
|
||
}
|
||
|
||
$('.add').click(function() {
|
||
sayac++;
|
||
var form = "<div class='control-group'><label class='control-label'>LINK"+sayac+" :</label><div class='controls pals' >";
|
||
var form1 = "<select name='downlink["+sayac+"][]' class='span2 count' id='count'><option >Selected Countries</option></select>";
|
||
var form2 = "<input type='text' name='downlink["+sayac+"][]' class='span8' required placeholder='link'><input type='hidden' name='downlink["+sayac+"][]' value='0'><input type='hidden' name='downlink["+sayac+"][]' value='1'></div></div></div>";
|
||
|
||
$.getJSON('/countries.json', null, function(data) {
|
||
$.each(data, function(idx, obj) {
|
||
$(".count").append('<option value="'+obj.id+'">'+obj.name+'</option>' );
|
||
});
|
||
});
|
||
|
||
$(".download").append(form + form1+ form2);
|
||
|
||
|
||
});
|
||
|
||
|
||
$('.downlinkstatus').click(function(){
|
||
var id = $(this).attr("data-id");
|
||
var status = $(this).attr("data-status");
|
||
$.post('/panel/download/downlinkdStatusChange', {id:id, status:status}, function(response){
|
||
//alert(response);
|
||
location.reload();
|
||
});
|
||
})
|
||
|
||
$('.downlinkDelete').click(function(){
|
||
var id = $(this).attr("data-id");
|
||
$.post('/panel/download/downlinkDelete', {id:id}, function(response){
|
||
location.reload();
|
||
})
|
||
})
|
||
|
||
$('.downloadStatusChange').click(function(){
|
||
var id = $(this).attr("data-id");
|
||
var status = $(this).attr("data-status");
|
||
$.post('/panel/download/downloadStatusChange', {id:id, status:status}, function(response){
|
||
location.reload();
|
||
})
|
||
})
|
||
|
||
|
||
|
||
});
|
||
|