0
How can I change the Status Field in the database via Combobox in PHP? I did it
mount a change of status with onclick
, but now I need to change with Combobox.
//PERMISSÃO Nº31 = BLOQUEAR/DESBLOQUEAR OS
if((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 = '';
}
You will need to give more tips than you want... You want to change what, so what, what the reason, what you want to do?
– KhaosDoctor
well wanted to understand how do to getStatus() == 'BLQ') instead of staying BLQ it goes to null by a combobox. when selecting in the locked or unlocked field respectively it changes the status.
– Wesley Costa
Yes so far I understood, but I’m trying to understand the practical application, explain a little more about its application so I can understand what it has to do and help you in this.
– KhaosDoctor
Khaosdoctor, sorry Brow was full of problems and I didn’t even have time to go inside to see the answers, so if you can help me, I’d appreciate it. Explain better I have some class.php and what I need to do and update several fields at once through php and javascript, would be a block and unlock field of various information at the same, in case this information comes from the database and is presented to me in a site guy you could pass me your email because then I would send you the screen print and explain you with more details.
– Wesley Costa
You can recover the value of the selected status?
– KhaosDoctor
with you yes! this top code it works a good he blocks and unlocks a good, what I wanted was instead of lock/unlock by clicking on the icon I wanted to lock/ unlock all of them at once
– Wesley Costa
Let me understand, do you want a single combo at the top that blocks all inputs below? Put a photo please.
– KhaosDoctor
That’s right!! follow the picture!
– Wesley Costa
Oh yes, but are these Orders in the correct database? You would have to execute a query in the database to block them?
– KhaosDoctor
that’s right.....
– Wesley Costa