Make a WHILE run from the click of a button

0

I have a form that should fill in automatically. But this padding depends on a user's choice, so it should be run after the choice, I believe a button would be ideal.

For example: I have several car assemblers (Volkswagen, Ford, Peugeot). The user will choose which car maker he wants in a drop down field. Depending on your choice, a form must be completed in an "automatic" form with all the cars of this automaker (registered in the BD). For example: You have chosen Volkswagen in the drop down menu, so the form should be filled with the vehicles Parati, Gol, Santana ...

I did a "while" that brings all the drugs in a particular group of drugs. However, it does not bring any result that is executed when the page opens. I need to create a "button" or a way to run only after the user chooses the type of medication group, then my while to run and fill the entire form.

Follow the While:

        while (($exibe = oci_fetch_array($parsed_medicamento_s, OCI_ASSOC+OCI_RETURN_NULLS)) != false) {
                                                $DS_MATERIAL                = $exibe ['DS_MATERIAL'];
                                                $DS_VIA_APLICACAO           = $exibe ['DS_VIA_APLICACAO'];
                                                $QT_DOSE                    = $exibe ['QT_DOSE'];
                                                $DS_INTERVALO               = $exibe ['DS_INTERVALO'];
                                                $CD_UNIDADE_MEDIDA          = $exibe ['CD_UNIDADE_MEDIDA'];
                                                $DS_DIAS_APLICACAO          = $exibe ['DS_DIAS_APLICACAO'];
                                                $DS_CICLOS_APLICACAO        = $exibe ['DS_CICLOS_APLICACAO'];
                                                $DILUICAO_RECONSTITUINTE    = $exibe ['DILUICAO_RECONSTITUINTE'];
                                                $DS_RECONSTITUINTE          = $exibe ['DS_RECONSTITUINTE'];
                                                $UNID_MED_RECONSTITUINTE    = $exibe ['UNID_MED_RECONSTITUINTE'];
                                                $DS_DILUINTE                = $exibe ['DS_DILUINTE'];
                                                $QT_DOSE_DILUENTE           = $exibe ['QT_DOSE_DILUENTE'];
                                                $CD_UNIDADE_MEDIDA_DILUENTE = $exibe ['CD_UNIDADE_MEDIDA_DILUENTE'];

    echo '<div class="tbline"><div class="tbcel1 excluir"><a href="?exclui=ok&id='.$idsession.'&nr_sequencia='.$NR_SEQUENCIA.'"><font color="#FFFFFF">excluir</font></a></div><div class="tbcel3">'.$DS_MATERIAL.'</div><div class="tbcel2">'.$DS_VIA_APLICACAO.'</div><div class="tbcel2">'.$QT_DOSE.'</div><div class="tbcel2">'.$DS_UNIDADE_MEDIDA.'</div><div class="tbcel3">'.$DS_DIAS_APLICACAO.'</div><div class="tbcel3">'.$DS_CICLOS_APLICACAO.'</div><div class="tbcel3">'.$DS_DILUENTE.'</div><div class="tbcel2">'.$QT_DOSE_DILUENTE.'</div><div class="tbcel2">'.$DS_UNID_MEDIDA_DILUENTE.'</div></div>';

Here's where the user chooses the type of medication group, named protocol:

                               <div class="label">
                                <label>Protocolo</label><br />
                                <select name="protocolo" id="protocolo" class="protocolo input">
                                <option selected="selected" value="selecione">--- Selecione uma opção ---</option>
                                <?php
                                while (($exibe = oci_fetch_array($parsed_prot, OCI_ASSOC+OCI_RETURN_NULLS)) != false) {
                                                                        $CD_PROTOCOLO   = $exibe ['CD_PROTOCOLO'];  
                                                                        $NM_PROTOCOLO   = $exibe ['NM_PROTOCOLO'];
                                echo '<option value="'.$CD_PROTOCOLO.'">'.$NM_PROTOCOLO.'</option>';
                                } ?>
                                </select> 
                                </div>

Only after this choice, while must be executed.

    
asked by anonymous 11.05.2017 / 20:28

0 answers