I have 3 selects in my code where:
- If the user enters the start date and end date, they will display the data between them.
- If the user enters the invoice it will show the data with that note.
- If the user selects the peripheral it will show all the data with that name registered.
Now my question is: How to make the select stay:
- If you select start date / end date and peripheral , peripherals (with the name informed) registered within the dates defined?
- If you select invoice and peripheral just show the selected peripheral of that note!
Selection code:
if($w_op == "P"){ //P é o periférico
$w_query="where sai_tb_peri.seq_peri = '$w_cb_peri'";
}
else
if($w_op == "N"){ //N é a nota fiscal
$w_query="where sai_cad_nf.num_nf = '$w_tx_nota'";
}
else{ //Caso for nenhum é as datas
$w_query="where sai_cad_nf.dt_nota_fisc between '$w_tx_dt_inic' and '$w_tx_dt_fina'";
}
$w_querybusca="SELECT * FROM sai_cad_cara_peri
INNER JOIN sai_tb_peri on sai_cad_cara_peri.fk_seq_peri = sai_tb_peri.seq_peri
INNER JOIN sai_cad_nf ON sai_cad_cara_peri.fk_seq_nf = sai_cad_nf.seq_nf $w_query;";