HEX
Server: Apache/2.4.65 (Debian)
System: Linux srv39710 6.1.0-41-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.158-1 (2025-11-09) x86_64
User: root (0)
PHP: 8.4.11
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
Upload Files
File: /var/www/www-root/data/www/peeer.click/tds/files/js/bottom.js
//календарь
$(function(){
	$('#from, #to').datepicker({
		dateFormat: 'yy-mm-dd',
		changeMonth: true,
		numberOfMonths: 1,
		beforeShow: function(textbox, instance){
			marginLeftDatepicker = $(instance.dpDiv).outerWidth() - $(textbox).outerWidth();
			datePickerWidth = $(instance.dpDiv).outerWidth();
			var datepickerOffset = $(textbox).offset();
			if(datepickerOffset.left > datePickerWidth){
				instance.dpDiv.css({marginLeft: - marginLeftDatepicker + 'px'});
			}
			else{
				instance.dpDiv.css({marginLeft: 0});
			}
		}
	});
	from = $("#from").on("change", function(){
		to.datepicker("option", "minDate", getDate(this));
	}),
	to = $("#to").on("change", function(){
		from.datepicker("option", "maxDate", getDate(this));
	});
	function getDate(element){
		var date;
		try{
			date = $.datepicker.parseDate(dateFormat, element.value);
		}
		catch(error){
			date = null;
		}
		return date;
	}
});
//выбор даты pb
var val = $("#pb_range option:selected").val();
if(val == '12'){
	$('.range_selection').show();
	$('input[name="from"]').prop('disabled', false);
	$('input[name="to"]').prop('disabled', false);
}
else{
	$('.range_selection').hide();
	$('input[name="from"]').prop('disabled', true);
	$('input[name="to"]').prop('disabled', true);
}
$('#pb_range').change(function(){
	var val= $(this).val();
	if(val == '12'){
		$('.range_selection').show();
		$('input[name="from"]').prop('disabled', false);
		$('input[name="to"]').prop('disabled', false);
	}
	else{
		$(".range_submit").hide();
		$('.range_selection').hide();
		$('input[name="from"]').prop('disabled', true);
		$('input[name="to"]').prop('disabled', true);
	}
});
if(window.location.search.match("range=12")){
	$(".range_submit").show();
}
$("#pb_range").change(function(){
	if($(this).val() != 12){
		this.form.submit();
	}
	else{
		$(".range_submit").show();
	}
});
//выбор даты статистики
$("#stat_date").change(function(){
	this.form.submit();
});
//подсветка пунктов меню
$(function(){
	$('.editor-menu [href]').each(function(){
		if(this.href == window.location.href){
			$(this).addClass('active');
		}
	});
});
//сортировка потоков
$(function(){
	$("#sorting").sortable({
		opacity: 0.7,
		delay: 300,
		axis: "y",
		cursor: "move",
		update: function(event, ui){
			var data = $(this).sortable("serialize");
			var urlParams = new URLSearchParams(window.location.search);
			if(urlParams.get('g')){
				function reorder(){
					var g = urlParams.get('g');
					$.ajax({
						data: data,
						type: 'POST',
						url: 'files/reorder.php?g='+g,
						success: function(){
							var path = window.location.pathname;
							window.location.href=path+'?g='+g;
						}
					});
				};
				setTimeout(function(){
					res = confirm('Reorder streams?');
					if(res){
						reorder();
					}
					else{
						$("#sorting").sortable("cancel");
					}
				}, 300);
			}
		}
	});
});
//
$(document).ready(function(){
//main
//redirect
	$('select[name=redirect]').change(function(){
		if(this.value == 'api'){
			$("#j1").hide();
		}
		else{
			$("#j1").show();
		}
	});
	if($('select[name=redirect]').val() == 'api'){
		$("#j1").hide();
	}
	else{
		$("#j1").show();
	};
//out
	$('select[name=redirect]').change(function(){
		if(this.value == '403_forbidden' || this.value == '404_not_found' || this.value == '500_server_error'){
			$("#j2").hide();
		}
		else{
			$("#j2").show();
		}
	});
	if($('select[name=redirect]').val() == '403_forbidden' || $('select[name=redirect]').val() == '404_not_found' || $('select[name=redirect]').val() == '500_server_error'){
		$("#j2").hide();
	}
	else{
		$("#j2").show();
	};
//curl
	$('select[name=redirect]').change(function(){
		if(this.value == 'curl'){
			$("#j3").show();
		}
		else{
			$("#j3").hide();
		}
	});
	if($('select[name=redirect]').val() == 'curl'){
		$("#j3").show();
	}
	else{
		$("#j3").hide();
	};
//separation_file
	$('input[name=separation]').click(function(){
		if($(this).is(':checked')){
			$("#j4").show();
		}
		else{
			$("#j4").hide();
		}
	});
	if($('input[name=separation]').is(':checked')){
		$("#j4").show();
	}
	else{
		$("#j4").hide();
	};
//chance
	$('select[name=redirect]').change(function(){
		if(this.value == 'javascript'){
			$("#j5").show();
		}
		else{
			$("#j5").hide();
		}
	});
	if($('select[name=redirect]').val() == 'javascript'){
		$("#j5").show();
	}
	else{
		$("#j5").hide();
	};
//geo
	if(geo == 'cf'){
		$("#j13").hide();
		$("#j14").hide();
		$("#j15").hide();
		$("#j16").hide();
		$("#j17").hide();
		$("#j18").hide();
	}
	if(geo == 'sypex'){
		$("#j15").hide();
		$("#j16").hide();
		$("#j17").hide();
		$("#j18").hide();
	};
//filters
//list_ip_file
	$('select[name=ch_list_ip_flag]').change(function(){
		if(this.value == '2'){
			$("#j6").hide();
		}
		else{
			$("#j6").show();
		}
	});
	if($('select[name=ch_list_ip_flag]').val() == '2'){
		$("#j6").hide();
	}
	else{
		$("#j6").show();
	};
//bots
//bot_redirect
	$('select[name=redirect]').change(function(){
		if(this.value == 'api'){
			$("#j7").hide();
		}
		else{
			$("#j7").show();
		}
	});
	if($('select[name=redirect]').val() == 'api'){
		$("#j7").hide();
	}
	else{
		$("#j7").show();
	};
//out_bot
	$('select[name=bot_redirect]').change(function(){
		if(this.value == '403_forbidden' || this.value == '404_not_found' || this.value == '500_server_error'){
			$("#j8").hide();
		}
		else{
			$("#j8").show();
		}
	});
	if($('select[name=bot_redirect]').val() == '403_forbidden' || $('select[name=bot_redirect]').val() == '404_not_found' || $('select[name=bot_redirect]').val() == '500_server_error'){
		$("#j8").hide();
	}
	else{
		$("#j8").show();
	};
//b_curl
	$('select[name=bot_redirect]').change(function(){
		if(this.value == 'curl'){
			$("#j9").show();
		}
		else{
			$("#j9").hide();
		}
	});
	if($('select[name=bot_redirect]').val() == 'curl'){
		$("#j9").show();
	}
	else{
		$("#j9").hide();
	};
//ch_ua
	$('input[name=ch_ua]').click(function(){
		if($(this).is(':checked')){
			$("#j12").show();
		}
		else{
			$("#j12").hide();
		}
	});
	if($('input[name=ch_ua]').is(':checked')){
		$("#j12").show();
	}
	else{
		$("#j12").hide();
	};
//schedule
//limit_type
	$('input[name=limit]').click(function(){
		if($(this).is(':checked')){
			$("#j10").show();
		}
		else{
			$("#j10").hide();
		}
	});
	if($('input[name=limit]').is(':checked')){
		$("#j10").show();
	}
	else{
		$("#j10").hide();
	};
//check
//av_list
	$('select[name=av]').change(function(){
		if(this.value == '0'){
			$("#j20").hide();
		}
		else{
			$("#j20").show();
		}
	});
	if($('select[name=av]').val() == '0'){
		$("#j20").hide();
	}
	else{
		$("#j20").show();
	}
//av&rkn
	$('select[name=av]').change(function(){
		if(this.value == '0' && $('select[name=rkn]').val() == '0'){
			$("#j19").hide();
		}
		else{
			$("#j19").show();
		}
	});
	$('select[name=rkn]').change(function(){
		if(this.value == '0' && $('select[name=av]').val() == '0'){
			$("#j19").hide();
		}
		else{
			$("#j19").show();
		}
	});
	if($('select[name=av]').val() == '0' && $('select[name=rkn]').val() == '0'){
		$("#j19").hide();
	}
	else{
		$("#j19").show();
	};
//ch_option
	$('select[name=ch_option]').change(function(){
		if(this.value == '0' || this.value == '1'){
			$("#j11").show();
		}
		else{
			$("#j11").hide();
		}
	});
	if($('select[name=ch_option]').val() == '0' || $('select[name=ch_option]').val() == '1'){
		$("#j11").show();
	}
	else{
		$("#j11").hide();
	};
//remote_ip_ch
	$('input[name=remote_ip_ch]').click(function(){
		if($(this).is(':checked')){
			$("#j21").show();
		}
		else{
			$("#j21").hide();
		}
	});
	if($('input[name=remote_ip_ch]').is(':checked')){
		$("#j21").show();
	}
	else{
		$("#j21").hide();
	};
});