$then) {unlink ("$datadir/$lines[$k]");} // ���� ������� ����������� usort($fline,"prcmp"); $numip="0"; $numsys="0"; $hi=0; $ab="0"; $ac="0"; do { $dt=explode("|",$fline[$hi]); if ($ab!=$dt[0]) {$ab=$dt[0]; $numip++;} if (isset($dt[2])) {if ($ac!=$dt[2]) {$ac=$dt[2]; $numsys++;}} $hi++; } while ($hi<$fitogo); $text.="$then|$fitogo|$numip|$numsys|\r\n"; } unset($fitogo); unset($fline); $k++; } while ($k<$itogo); $fp=fopen("$datadir/mainbase.dat","w"); flock ($fp,LOCK_EX); fputs($fp,"$text"); fflush ($fp);//�������� ��������� ������ flock ($fp,LOCK_UN); fclose($fp); @chmod("$datadir/mainbase.dat", 0644); // ��������� ������ $lines=file("$datadir/mainbase.dat"); $maxi=count($lines); usort($lines,"prcmp"); print"
���������� �� ������������
\r\n "; $graph1=""; $graph2=""; // ��������� ������ ��� �������� $g1shapka="
"; if (sizeof($lines)>=1) { // ���� ���� ������ - �� ������� ������� if ($gtype=="1") { // ������������ ������ $xdaym="
����
\r\n"; $g2shapka="
�
�
�
�
�
�
�
\r\n"; for ($i=0; $i<$maxi; $i++) { // ������ FOR $dtt=explode("|",$lines[$i]); $dttn1=round($dtt[1]*$scale1); // ����� 1-�� ������� $dttn2=round($dtt[2]*$scale2); // ����� 2-�� ������� $graph1.="\r\n"; $graph2.="\r\n"; if (!isset($m0)) {$m0=date("m",$dtt[0])-1;} if ($i==$maxi-1) {$m1=date("m",$dtt[0])-1;} $xday=date("d",$dtt[0]); $xdaym.="\r\n"; } // ����� FOR $mm1=$months[$m0]; $mm2=$months[$m1]; if ($mm1==$mm2) {$mm1="";} else {$mm1.=" - ";} $msdat="
�
�
�
�
�
�
�
�
�
�
�
$dtt[1]
$dtt[2]
$xday
������:
$mm1 $mm2
\r\n"; print"$g1shapka $graph1 $xdaym "; // �������� 1-�� ������ print"$g2shapka $graph2 $xdaym $msdat
"; // �������� 2-�� ������ } else { // �������������� ������ $g1shapka="\r\n"; $g2shapka="
����
���-��
�������
\r\n"; $xdaym=""; $graph1=""; $graph2=""; // ��������� ������ ��� �������� for ($i=0; $i<$maxi; $i++) { // ������ FOR $dtt=explode("|",$lines[$i]); //$dtt[0]=date("d.m.y",$dtt[0]); if (!isset($m0)) {$m0=date("m",$dtt[0])-1;} if ($i==$maxi-1) {$m1=date("m",$dtt[0])-1;} $xday=date("d",$dtt[0]); $dttn1=round($dtt[1]*$scale1); // ����� 1-�� ������� $dttn2=round($dtt[2]*$scale2); // ����� 2-�� ������� $graph1.=""; $graph2.=""; } // ����� FOR $mm1=$months[$m0]; $mm2=$months[$m1]; if ($mm1==$mm2) {$mm1="";} else {$mm1.=" - ";} $msdat="
����
���-��
�����������
$xday
$dtt[1]
$xday
$dtt[2]
������:
$mm1 $mm2
\r\n"; print"
$g1shapka $graph1 $xdaym
"; // �������� 1-�� ������ print"
$g2shapka $graph2 $xdaym $msdat
"; // �������� 2-�� ������ } // else ($gtype) print"
"; } else {print"
������ ��� ������� �����������.
��������� �� ��������� ������ �� ����.
";} ?>