в ajax.php происходит примерно следующее:
if (isset($_GET['monthsId'])) {
$resultAll = explode(',', $_GET['monthsId']);
$code = $_SESSION['1czup']['code'];
$SNILS = $_SESSION['1czup']['snils'];
$currentYear = date('Y');
$currentMonth = date('m');
foreach ($resultAll as $month) {
$nmonth = date("m", strtotime($month));
$paramDate = strtotime("05." . $nmonth . '.' . $currentYear);
$check = CKL1C::LoadPayListData1C($code, $SNILS, $paramDate);
$summForOneMonth = array();
foreach ($check['ROW'] as $element) {
$summForOneMonth[$element['Group']]['Type'][$element['Type']]['Summ'] += $element['Summ'];
}
$resForAllMonth[$month] = number_format(allSumForGroup($summForOneMonth['Выплачено']), 2, ',', ' ');
}
header("Content-type: application/json; charset=utf-8");
echo json_encode($resForAllMonth);
}