Files
2026-07-01 16:44:17 +03:00

207 lines
5.7 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
$(function(){
$('.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 sayac = Number($("#sayac").val()) || 0;
// Ekleme butonuna tıklama olayını ekle (delegation kullanarak)
$(document).on('click', '.add', function() {
sayac++;
var form = "<div class='control-group mb-3'><label class='control-label'>LINK" + sayac + " :</label><div class='controls d-flex align-items-center gap-2'>";
var form1 = "<select name='downlink[" + sayac + "][]' class='form-control count' style='width: auto;'><option value=''>Select Country</option></select>";
var form2 = "<input type='text' name='downlink[" + sayac + "][]' class='form-control' required placeholder='Download link'>";
var form3 = "<input type='hidden' name='downlink[" + sayac + "][]' value='0'><input type='hidden' name='downlink[" + sayac + "][]' value='1'>";
var deleteBtn = "<button type='button' class='btn btn-danger remove-link'><i class='fa fa-trash'></i></button>";
var newElement = $(form + form1 + form2 + form3 + deleteBtn + "</div></div>");
// Yeni elementi ekle
$(".download").append(newElement);
// Ülke verilerini yükle
$.getJSON('/countries.json')
.done(function(data) {
var select = newElement.find('.count');
$.each(data, function(idx, obj) {
select.append($('<option>', {
value: obj.id,
text: obj.name
}));
});
})
.fail(function(jqxhr, textStatus, error) {
console.error("Ülke verileri yüklenirken hata oluştu:", textStatus, error);
});
});
// Silme butonu için delegasyon
$(document).on('click', '.remove-link', function() {
$(this).closest('.control-group').remove();
});
$('.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();
})
})
});