$temp_rec[$q] = $temp_record_ST[$q];
$temp_rec[21] = $temp_record_ST[21] + $temp_record[6];
dbase_replace_record ($bd_ST, $temp_rec, $e);
break;
}
}
}
//Внесення даних по ВЗ
for ($i=1; $i<=$records_counter; $i++) {
$temp_record = dbase_get_record ($bd_21, $i);
$records_counter_ST = dbase_numrecords($bd_ST);
for ($e=1; $e<=$records_counter_ST; $e++) {
$temp_record_ST = dbase_get_record ($bd_ST, $e);
if ($temp_record[0] == $temp_record_ST[0]) {
for ($q=0;$q<=29;$q++)
$temp_rec[$q] = $temp_record_ST[$q];
$temp_rec[22] = $temp_record_ST[22] + $temp_record[6];
dbase_replace_record ($bd_ST, $temp_rec, $e);
break;
}
}
}
//Внесення даних по ВЗ
for ($i=1; $i<=$records_counter; $i++) {
$temp_record = dbase_get_record ($bd_22, $i);
$records_counter_ST = dbase_numrecords($bd_ST);
for ($e=1; $e<=$records_counter_ST; $e++) {
$temp_record_ST = dbase_get_record ($bd_ST, $e);
if ($temp_record[0] == $temp_record_ST[0]) {
for ($q=0;$q<=29;$q++)
$temp_rec[$q] = $temp_record_ST[$q];
$temp_rec[23] = $temp_record_ST[23] + $temp_record[6];
dbase_replace_record ($bd_ST, $temp_rec, $e);
break;
}
}
}
//Внесення даних по ВЗ
for ($i=1; $i<=$records_counter; $i++) {
$temp_record = dbase_get_record ($bd_23, $i);
$records_counter_ST = dbase_numrecords($bd_ST);
for ($e=1; $e<=$records_counter_ST; $e++) {
$temp_record_ST = dbase_get_record ($bd_ST, $e);
if ($temp_record[0] == $temp_record_ST[0]) {
for ($q=0;$q<=29;$q++)
$temp_rec[$q] = $temp_record_ST[$q];
$temp_rec[24] = $temp_record_ST[24] + $temp_record[6];
dbase_replace_record ($bd_ST, $temp_rec, $e);
break;
}
}
}
//Внесення даних по ВЗ
for ($i=1; $i<=$records_counter; $i++) {
$temp_record = dbase_get_record ($bd_24, $i);
$records_counter_ST = dbase_numrecords($bd_ST);
for ($e=1; $e<=$records_counter_ST; $e++) {
$temp_record_ST = dbase_get_record ($bd_ST, $e);
if ($temp_record[0] == $temp_record_ST[0]) {
for ($q=0;$q<=29;$q++)
$temp_rec[$q] = $temp_record_ST[$q];
$temp_rec[25] = $temp_record_ST[25] + $temp_record[6];
dbase_replace_record ($bd_ST, $temp_rec, $e);
break;
}
}
}
//Внесення даних по ВЗ
for ($i=1; $i<=$records_counter; $i++) {
$temp_record = dbase_get_record ($bd_25, $i);
$records_counter_ST = dbase_numrecords($bd_ST);
for ($e=1; $e<=$records_counter_ST; $e++) {
$temp_record_ST = dbase_get_record ($bd_ST, $e);
if ($temp_record[0] == $temp_record_ST[0]) {
for ($q=0;$q<=29;$q++)
$temp_rec[$q] = $temp_record_ST[$q];
$temp_rec[26] = $temp_record_ST[26] + $temp_record[6];
dbase_replace_record ($bd_ST, $temp_rec, $e);
break;
}
}
}
//Внесення даних по ВЗ
for ($i=1; $i<=$records_counter; $i++) {
$temp_record = dbase_get_record ($bd_26, $i);
$records_counter_ST = dbase_numrecords($bd_ST);
for ($e=1; $e<=$records_counter_ST; $e++) {
$temp_record_ST = dbase_get_record ($bd_ST, $e);
if ($temp_record[0] == $temp_record_ST[0]) {
for ($q=0;$q<=29;$q++)
$temp_rec[$q] = $temp_record_ST[$q];
$temp_rec[27] = $temp_record_ST[27] + $temp_record[6];
dbase_replace_record ($bd_ST, $temp_rec, $e);
break;
}
}
}
//Внесення даних по ВЗ
for ($i=1; $i<=$records_counter; $i++) {
$temp_record = dbase_get_record ($bd_27, $i);
$records_counter_ST = dbase_numrecords($bd_ST);
for ($e=1; $e<=$records_counter_ST; $e++) {
$temp_record_ST = dbase_get_record ($bd_ST, $e);
if ($temp_record[0] == $temp_record_ST[0]) {
for ($q=0;$q<=29;$q++)
$temp_rec[$q] = $temp_record_ST[$q];
$temp_rec[28] = $temp_record_ST[28] + $temp_record[6];
dbase_replace_record ($bd_ST, $temp_rec, $e);
break;
}
}
}
//Внесення даних по ВЗ Золочів
$records_counter = dbase_numrecords($bd_Zl);
for ($i=1; $i<=$records_counter; $i++) {
$temp_record = dbase_get_record ($bd_Zl, $i);
$records_counter_ST = dbase_numrecords($bd_ST);
for ($e=1; $e<=$records_counter_ST; $e++) {
$temp_record_ST = dbase_get_record ($bd_ST, $e);
if ($temp_record[0] == $temp_record_ST[0]) {
$temp_rec[0] = $temp_record_ST[0];
$temp_rec[1] = $temp_record_ST[1];
for ($q=2;$q<29;$q++)
$temp_rec[$q] = $temp_record_ST[$q];
$temp_rec[29] = $temp_record_ST[29] + $temp_record[6];
dbase_replace_record ($bd_ST, $temp_rec, $e);
break;
}
}
}
dbase_close ($bd_1);
dbase_close ($bd_2);
dbase_close ($bd_3);
dbase_close ($bd_4);
dbase_close ($bd_5);
dbase_close ($bd_6);
dbase_close ($bd_7);
dbase_close ($bd_8);
dbase_close ($bd_9);
dbase_close ($bd_10);
dbase_close ($bd_11);
dbase_close ($bd_12);
dbase_close ($bd_13);
dbase_close ($bd_14);
dbase_close ($bd_15);
dbase_close ($bd_16);
dbase_close ($bd_17);
dbase_close ($bd_18);
dbase_close ($bd_19);
dbase_close ($bd_20);
dbase_close ($bd_21);
dbase_close ($bd_22);
dbase_close ($bd_23);
dbase_close ($bd_24);
dbase_close ($bd_25);
dbase_close ($bd_26);
dbase_close ($bd_27);
dbase_close ($bd_Zl);
dbase_close ($bd_ST);
?>
Додаток 4. Скріпт виводу сортувальної таблиці для друку.
<?php
$bd = dbase_open ("C:\\Apache2\\htdocs\\BD\\2004_04_ST.DBF", 0);
$rec_counter = dbase_numrecords ($bd);
echo "<TABLE BORDER>
";
echo "<TR><TD>Індекс</TD><TD>Назва видання</TD><TD>Б.К</TD><TD>Біб</TD><TD>Бор</TD><TD>В.В</TD><TD>Вор</TD><TD>Глн</TD><TD>Гол</TD><TD>Гонч</TD><TD>Єл</TD><TD>Жук</TD><TD>Заст</TD><TD>Кур</TD><TD>Кол</TD><TD>Нов</TD><TD>Підг</TD><TD>Плг</TD><TD>Пом</TD><TD>Пол</TD><TD>Поч</TD><TD>Ремз</TD><TD>Сас</TD><TD>Скв</TD><TD>Слв</TD><TD>Снв</TD><TD>Стр</TD><TD>Чер</TD><TD>Ясн</TD><TD>Зол</TD></TR>";
for ($i=1; $i<=$rec_counter; $i++) {
// if ($i==100) break;
$temp_record2 = dbase_get_record ($bd, $i);
if ($temp_record2[2] != 0) {
echo "<TR><TD><CENTER>$temp_record2[0]</CENTER></TD>";
echo "<TD>$temp_record2[1]</TD>";
for ($t=2; $t<29; $t++)
if ($temp_record2[$t] == 0)
echo "<TD><CENTER> </CENTER></TD>";
else
echo "<TD><CENTER>$temp_record2[$t]</CENTER></TD>";