ComboBox with PHP changing the status in the database

0

HowcanIchangetheStatusFieldinthedatabasethroughtheComboBoxinPHP?Igotitmountastatuschangewithonclick,butnowIneedtochangewiththeComboBox.

//PERMISSÃONº31=BLOQUEAR/DESBLOQUEAROSif((array_key_exists(31,$sessao->getMenuPermissao()))&&$qtOsIniciada==0){if($os->getStatus()=='BLQ'){$bloquearOrdemServico="<a href='javascript:bloquearOrdemServico( ".$os->getIdOrdemServico().", true )' id='cancelarOrdemServico'
                                            title='Desbloquear OS'>
                                            <img style='width:30px; height:30' src='comum/img/cadeadoAberto.png'>
                                        </a>";
            }
            else{

                $bloquearOrdemServico = "<a href='javascript:bloquearOrdemServico( ".$os->getIdOrdemServico().", false )' id='cancelarOrdemServico'
                                            title='Bloquear OS'>
                                            <img style='width:30px; height:30' src='comum/img/cadeadoFechado.png'>
                                        </a>";
            }
        }
        else{

            $bloquearOrdemServico = '';
        }
    
asked by anonymous 06.11.2014 / 00:53

1 answer

1

Since work orders are in a database, instead of performing a query with a constraint for the order ID, you have to perform another query without restriction, or with restrictions that apply to the mode user view. Ex:

Instead of using

UPDATE TBL_ORDEM SET STATUS = 'BLOQUEADO' WHERE ID = 123

You will have to use

UPDATE TBL_ORDEM SET STATUS = 'BLOQUEADO'

This will vary from your system, that is, you will have to (probably) create another function to send the command to the program and reload the screen the same way you do today, but without the order code. / p>     

13.11.2014 / 18:32