foreach($sklad_one as $index => $item_mas_one){
$items_one[$index] = [
'positionId' => 1,
'name' => $item_mas_one['NAME'],
'quantity' => array(
'value' => 1,
'measure' => 'шт'
),
'itemAmount' => 1 * (500 * 100),
'itemCode' => $item_mas_one['ID'],
'tax' => array(
'taxType' => 0,
'taxSum' => 0
),
'itemPrice' => 500 * 100,
];
}
while($row = mysql_fetch_assoc($w))
{
$now = time();
$daysInMonth = date('t', $now);
$dayOfWeek = date('w', mktime(0,0,0, date('m', $now),date('d', $now), date('y', $now)));
$isHoliday = $dayOfWeek == 6 || $dayOfWeek == 0;
$rand = $isHoliday ? $random['holiday'] : $random['workweek'];
$rand = rand($rand[0],$rand[1]);
$daily = $total / $daysInMonth;
$part = round($total / $daysInMonth / 100 * $rand);
$modification = round($row['modification'] + ($daily + $part) / 24);
$sql = "UPDATE `betaintranet`.`ad_stat_cleaned` SET `betaintranet`.`ad_stat_cleaned`.`modification` = '{$modification}' WHERE
`betaintranet`.`ad_stat_cleaned`.`bid` = '{$row['bid']}' AND
`betaintranet`.`ad_stat_cleaned`.`date` = '{$row['date']}'";
mysql_query($sql) or die(mysql_error());
}