function alert1(){
Excluir = confirm("Deseja realmente apagar ?")//a variavel Excluir aguarda um comando ok ou cancelar retornando assim false ou true
if ( Excluir ==false){// testa se o usuario clicou em cancelar
alert("Cancelando")
}
if ( Excluir ==true){// testa se o usuario clicou em ok
alert("Apagando")
location.href = "../alterarFormularioNome.php"
}
}
Pergunta
jatobas
Meu scrapit
function alert1(){ Excluir = confirm("Deseja realmente apagar ?")//a variavel Excluir aguarda um comando ok ou cancelar retornando assim false ou true if ( Excluir ==false){// testa se o usuario clicou em cancelar alert("Cancelando") } if ( Excluir ==true){// testa se o usuario clicou em ok alert("Apagando") location.href = "../alterarFormularioNome.php" } }TODO O CODIGO<?php require_once('../control/PessoaJuridicaControl.php'); $pes_nome = $_POST['PES_NOME_FANT']; $pessoaJuridicaDao = new PessoaJuridicaDao(); $dados = $pessoaJuridicaDao->buscarDadosNome($pes_nome); if(!$dados){ echo " <script>alert('Usuario não encontrado.');</script> <meta HTTP-EQUIV='refresh' CONTENT='0;URL=../alterarFormularioPJAdmin.php'> "; }else{ //header("location:../"."alterarFormularioNome.php"); } ?> <html> <head> <title>Abla</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link href="../estilo.css" type="text/css" rel="stylesheet" /> <script type="text/javascript"> function alert1(){ Excluir = confirm("Deseja realmente apagar ?")//a variavel Excluir aguarda um comando ok ou cancelar retornando assim false ou true if ( Excluir ==false){// testa se o usuario clicou em cancelar alert("Cancelando") } if ( Excluir ==true){// testa se o usuario clicou em ok alert("Apagando") location.href = "../alterarFormularioNome.php" } } } </script> </head> <body> <div id="cont" class="cent" align="center"> <ul id="dropmenu"> <li class="current_page_item"><a href="admin.php"> Privado </a></li> <li class="page_item page-item-2"><a href="../adminPerfil.php">Perfil do Associado</a> <li class="page_item page-item-2"><a href="../adminLocadoras.php"> Locadoras </a> <li class="page_item page-item-2"><a href="../formularioVeiculos.php"> Veículos </a> <li class="page_item page-item-2"><a href="../administracao.php">Relatórios </a> <li class="page_item page-item-2"><a href="http://www.abla.com.br/">Sair</a> </ul> <div id="conteudo"> <img class="cent" align="center" style="margin-top: 100px;" src='../img/logo-ABLA-cinza.jpg' /><br/><br/><br/> </div> </div> <div id="tabela" style="margin-top: 50px;"> <div id="id" align="center" style="color:#666;"> <table style="width:590px;border-width: 1px;border-style: solid;bordercolor:#DCDCDC;margin-top:0px;"cellspacing="0" cellpadding="0"> <tr> <th align="center" style="width:350px;border-width: 1px;border-style: solid;border-color:#DCDCDC;" >Cliente</th> <th align="center" style="width:118px;border-width: 1px;border-style: solid;border-color:#DCDCDC;" >Atualizar</th> <th align="center" style="width:118px;border-width: 1px;border-style: solid;border-color:#DCDCDC;" >Remover</th> <tr> </table> </div> <?php require_once('../dao/PessoaJuridicaDao.php'); $PessoaJuridicaDao=new PessoaJuridicaDao(); $objPessoaJuridca = $PessoaJuridicaDao->buscarDadosNome($pes_nome); while($linha = mysql_fetch_array($objPessoaJuridca)){ ?> <div id="id" align="center"> <table style="width:590px;border-width: 1px;border-style: solid;border-color:#DCDCDC;"cellspacing="0" cellpadding="0"> <tr> <th align="left" style="width:350px;color:#666;" ><?php echo $linha['PES_NOME_FANT']?></th> <th align="center" style="width:105;border-width: 1px;border-style: solid;border-color:#DCDCDC;" > <form method="post" action="../alterarFormularioNome.php?PES_CNPJ=<?php echo $linha['PES_CNPJ']?>&PES_NOME_FANT=<?php echo $linha['PES_NOME_FANT']?> &PES_RAZAO_SOC=<?php echo $linha['PES_RAZAO_SOC']?> &PES_INSC_EST=<?php echo $linha['PES_INSC_EST']?> &PES_INSC_MUN=<?php echo $linha['PES_INSC_MUN']?> &PES_DATA_FUND=<?php echo $linha['PES_DATA_FUND']?> &PES_CONTATO=<?php echo $linha['PES_CONTATO']?> &PES_TEL1=<?php echo $linha['PES_TEL1']?> &PES_TEL2=<?php echo $linha['PES_TEL2']?> &PES_FAX=<?php echo $linha['PES_FAX']?> &PES_CEL1=<?php echo $linha['PES_CEL1']?> &PES_CEL2=<?php echo $linha['PES_CEL2']?> &PES_EMAIL1=<?php echo $linha['PES_EMAIL1']?> &PES_SITE=<?php echo $linha['PES_SITE']?> &PES_ID_STATUS=<?php echo $linha['PES_ID_STATUS']?> &PES_ANOS_SETOR=<?php echo $linha['PES_ANOS_SETOR']?> &PES_ANO_FILIACAO_ABLA=<?php echo $linha['PES_ANO_FILIACAO_ABLA']?> &PES_ANO_FILIACAO_SINDLOC=<?php echo $linha['PES_ANO_FILIACAO_SINDLOC']?> " > <input name="opcao" type="image" value="Alterar" src="img/alterar.png" /></th> </form> <th> <form method="post" action="buscarDadosPJNome.php?opcao=Excluir&PES_CNPJ=<?php echo $linha['PES_CNPJ']?>"> <input name="opcao" type="image" value="Excluir" src="img/remover.png" onClick='return alert1()'> </form> </th> <?php } ?> </table> </div> <?php @$opcao=$_POST['opcao']; if($opcao=="Excluir") { @$pesCnpj=$_GET['PES_CNPJ']; $query=$PessoaJuridicaDao->remover($pesCnpj); } ?> <body> </html>Link para o comentário
Compartilhar em outros sites
3 respostass a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.