Pass some values from a dynamic form to the Database

-2

I'm making a dynamic form that stores formulas for accounting reports.

All form data is entered in the same id (fields), and the account and operation fields have indexes (account1 and operation1).

Return example:

array(30) { [0]=> string(1) "(" ["conta1"]=> string(13) "1.02.01.01.55" ["operacao1"]=> string(5) "saldo" [1]=> string(1) "+" [2]=> string(0) "" [3]=> string(0) "" [4]=> string(1) "(" ["conta2"]=> string(13) "1.01.11.01.70" ["operacao2"]=> string(7) "credito" [5]=> string(1) "-" [6]=> string(0) "" [7]=> string(0) "" [8]=> string(0) "" ["conta3"]=> string(13) "1.01.10.01.90" ["operacao3"]=> string(6) "debito" [9]=> string(0) "" [10]=> string(0) "" [11]=> string(1) ")" [12]=> string(0) "" ["conta4"]=> string(0) "" ["operacao4"]=> string(0) "" [13]=> string(0) "" [14]=> string(0) "" [15]=> string(1) ")" [16]=> string(0) "" ["conta5"]=> string(0) "" ["operacao5"]=> string(0) "" [17]=> string(1) "/" [18]=> string(1) "3" [19]=> string(0) "" }

I made an implode to generate another return:

( 1.02.01.01.55 saldo + ( 1.01.11.01.70 credito - 1.01.10.01.90 debito ) ) / 3 

Well, I want to get each value of these, each ACCOUNT and respective OPERATIONS to search the database and return the results within the hierarchy:

(Resultado1 + (Resultado2 - resultado3)) / 3

I have tried to do with array return and string return. Please help me.

The code used is in the repository: link

    
asked by anonymous 28.12.2018 / 15:00

0 answers