Jump to content

if(@$id != "") em 2 botoões


klasss

Recommended Posts

Olá a todos, 

Tenho aqui um erro parvo não estou a ver como resolver . 

Na minha View tenho um botão que será para fazer a aprovação de documentos , que abre uma modal para fazer a confirmação : 
O problema é que quis fazer a mesma coisa para rejeitar. 

<a href="{{route('despesas.modal', $item)}}" ><i class="fas fa-check text-info mr-1"></i></a>
<a href="{{route('despesas.modal2', $item)}}" ><i class="fas fa-ban text-danger mr-1"></i></a>
<?php 
if(@$id != ""){
  echo "<script>$('#modalaceitar').modal('show');</script>";
}
?>
<?php 
if(@$id != ""){
  echo "<script>$('#modalrejeitar').modal('show');</script>";
}
?>

O problema está no código acima. Se fosse só para um funcionava. Mas como vou buscar o ID em ambos os casos ao clicar num botão ele vai abrir as 2 modal's . 

Existe alguma forma de fazer mais alguma condição no IF para conseguir abrir apenas uma delas? 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.