$arr_to_bd[9] = $_GET['07'];
$arr_to_bd[10] = $_GET['08'];
$arr_to_bd[11] = $_GET['09'];
$arr_to_bd[12] = $_GET['10'];
$arr_to_bd[13] = $_GET['11'];
$arr_to_bd[14] = $_GET['12'];
$arr_to_bd[15] = $_GET['smsp'];
$arr_to_bd[16] = $_GET['month'];
$arr_to_bd[17] = $_GET['year'];
//$records_counter = dbase_numrecords( $bd);
dbase_add_record ($bd, $arr_to_bd);
//dbase_replace_record ($bd, $arr_to_bd, $records_counter);
echo "<br> $temp";
echo "Запис добавлено. <br>";
dbase_close($bd);
echo "<A HREF=\"\\SP1_Zl_in.html\"> Ввести нову квитанцію. </A>";
?>
Додаток 3. Скріпт створення файлу бази даних сортувальної таблиці.
<?php
$bd_1 = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_1_SP5.DBF", 0);
$bd_2 = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_2_SP5.DBF", 0);
$bd_3 = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_3_SP5.DBF", 0);
$bd_4 = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_4_SP5.DBF", 0);
$bd_5 = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_5_SP5.DBF", 0);
$bd_6 = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_6_SP5.DBF", 0);
$bd_7 = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_7_SP5.DBF", 0);
$bd_8 = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_8_SP5.DBF", 0);
$bd_9 = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_9_SP5.DBF", 0);
$bd_10 = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_10_SP5.DBF", 0);
$bd_11 = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_11_SP5.DBF", 0);
$bd_12 = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_12_SP5.DBF", 0);
$bd_13 = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_13_SP5.DBF", 0);
$bd_14 = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_14_SP5.DBF", 0);
$bd_15 = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_15_SP5.DBF", 0);
$bd_16 = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_16_SP5.DBF", 0);
$bd_17 = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_17_SP5.DBF", 0);
$bd_18 = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_18_SP5.DBF", 0);
$bd_19 = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_19_SP5.DBF", 0);
$bd_20 = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_20_SP5.DBF", 0);
$bd_21 = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_21_SP5.DBF", 0);
$bd_22 = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_22_SP5.DBF", 0);
$bd_23 = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_23_SP5.DBF", 0);
$bd_24 = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_24_SP5.DBF", 0);
$bd_25 = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_25_SP5.DBF", 0);
$bd_26 = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_26_SP5.DBF", 0);
$bd_27 = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_27_SP5.DBF", 0);
$bd_Zl = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_Zl_SP5.DBF", 0);
$bd_ST = dbase_open("C:\\Apache2\\htdocs\\BD\\2004_04_ST.DBF", 2);
$records_counter = dbase_numrecords($bd_1);
//Внесення даних по ВЗ Б.К
for ($i=1; $i<=$records_counter; $i++) {
$temp_record = dbase_get_record ($bd_1, $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[2] = $temp_record_ST[2] + $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_2, $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[3] = $temp_record_ST[3] + $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_3, $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[4] = $temp_record_ST[4] + $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_4, $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[5] = $temp_record_ST[5] + $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_5, $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[6] = $temp_record_ST[6] + $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_6, $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[7] = $temp_record_ST[7] + $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_7, $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[8] = $temp_record_ST[8] + $temp_record[6];
dbase_replace_record ($bd_ST, $temp_rec, $e);