- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
<?php
//...
foreach ($month as $key=>$value)
{
if($value!=0)
{
$leased[$year[$key]] = $pay_leased->get_leased_pay($year[$key],$value);
$dialup[$year[$key]] = $pay_dialup->get_billing_pay($year[$key],$value);
$domain[$year[$key]] = $pay_domain->get_domain_pay($year[$key],$value);
$web[$year[$key]] = $pay_web->get_hosting_pay($year[$key],$value);
for ($d=1;$d<=31;$d++) // во всех месяцах по 31 дню, да
{
$leased[$year[$key]][$value][$d] = isset($leased[$year[$key]][$value][$d]) ? $leased[$year[$key]][$value][$d] : 0;
$dialup[$year[$key]][$value][$d] = isset($dialup[$year[$key]][$value][$d]) ? $dialup[$year[$key]][$value][$d] : 0;
$domain[$year[$key]][$value][$d] = isset($domain[$year[$key]][$value][$d]) ? $domain[$year[$key]][$value][$d] : 0;
$web[$year[$key]][$value][$d] = isset($web[$year[$key]][$value][$d]) ? $web[$year[$key]][$value][$d] : 0;
}
ksort($leased[$year[$key]][$value]);
ksort($dialup[$year[$key]][$value]);
ksort($domain[$year[$key]][$value]);
ksort($web[$year[$key]][$value]);
for ($c=1;$c<=31;$c++) // и еще
{
$leased[$year[$key]][$value][$c] = $leased[$year[$key]][$value][$c-1]+$leased[$year[$key]][$value][$c];
$dialup[$year[$key]][$value][$c] = $dialup[$year[$key]][$value][$c-1]+$dialup[$year[$key]][$value][$c];
$domain[$year[$key]][$value][$c] = $domain[$year[$key]][$value][$c-1]+$domain[$year[$key]][$value][$c];
$web[$year[$key]][$value][$c] = $web[$year[$key]][$value][$c-1]+$web[$year[$key]][$value][$c];
$sum[$year[$key]][$value][$c] = $leased[$year[$key]][$value][$c]+$dialup[$year[$key]][$value][$c]+$domain[$year[$key]][$value][$c]+$web[$year[$key]][$value][$c]; // вау, какая большая строка
}
}
}
//...
Досталось в подарок от предыдущих разработчиков. Наверное, я хреновый программист, если ничего не могу здесь понять...
Комментарии мои, исходник вообще лишен комментариев.
LispGovno 29.08.2012 20:44 # 0