01.
$DATABASE
->select_sql(
'SELECT * FROM owner WHERE population_id= '
.
$id_population
.
' '
);
02.
03.
04.
if
(
count
(
$DATABASE
->dataresult ) > 0 ) {
05.
foreach
(
$DATABASE
->dataresult
as
$result
) {
06.
07.
08.
09.
$populationID
=
$result
[
'population_id'
];
10.
$DATABASE
->select_sql(
'SELECT * FROM permit WHERE population_id="'
.
$populationID
.
'"'
);
11.
foreach
(
$DATABASE
->dataresult
as
$result_1
);
12.
13.
14.
$permitTypeID
=
$result_1
[
'permit_type_id'
];
15.
$permitResiveNO
=
$result_1
[
'permit_recieve_no'
];
16.
$issuedToDate
=
$result_1
[
'issued_to_date'
];
17.
$controlName
=
$result_1
[
'control_name'
];
18.
$calculateName
=
$result_1
[
'calculate_name'
];
19.
$amountDate
=
$result_1
[
'amount_date'
];
20.
21.
22.
$DATABASE
->select_sql(
'SELECT * FROM permit_type WHERE permit_type_id="'
.
$permitTypeID
.
'"'
);
23.
foreach
(
$DATABASE
->dataresult
as
$result_2
);
24.
25.
$DATABASE
->select_sql(
'SELECT * FROM building WHERE population_id="'
.
$populationID
.
'"'
);
26.
foreach
(
$DATABASE
->dataresult
as
$result_3
);
27.
28.
29.
$DATABASE
->select_sql(
'SELECT * FROM land WHERE population_id="'
.
$populationID
.
'"'
);
30.
foreach
(
$DATABASE
->dataresult
as
$result_4
);
31.
32.
$DATABASE
->select_sql(
'SELECT * FROM sys_tambon WHERE tambon_id="'
.
$result_4
[
'tambon_id'
].
'"'
);
33.
foreach
(
$DATABASE
->dataresult
as
$result_5
);
34.
35.
$DATABASE
->select_sql(
'SELECT * FROM road_table WHERE road_id="'
.
$result_4
[
'road_id'
].
'"'
);
36.
foreach
(
$DATABASE
->dataresult
as
$result_6
);
37.
38.
$DATABASE
->select_sql(
'SELECT * FROM soi_table WHERE soi_id="'
.
$result_4
[
'soi_id'
].
'"'
);
39.
foreach
(
$DATABASE
->dataresult
as
$result_7
);
40.
41.
$DATABASE
->select_sql(
'SELECT * FROM doc_attach WHERE population_id="'
.
$populationID
.
'"'
);
42.
foreach
(
$DATABASE
->dataresult
as
$result_8
);
43.
}