Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //php
- <?php
- // Para conectar-se ao banco.
- require("../config.php");
- $id_agendamento = $_GET['agendamento'];
- $sql = "DELETE FROM agendamento WHERE id = $id_agendamento";
- $query = mysql_query($sql);
- //if ($query) {
- // echo "alert('Agendamento Excluído com Sucesso!');";
- //}
- ?>
- //javascript
- <script type="text/javascript">
- $(document).ready(function() {
- $("#agendamento_excluir").click(function(){
- alert( $("#agendamento_excluir").attr('href'));
- var yes = confirm("Você tem certeza que deseja excluir esse agendamento");
- if(yes)
- {
- $.get( $("#agendamento_excluir").attr('href'));
- alert('Agendamento Excluído com Sucesso!');
- window.location="./index.php?pagina=agenda";
- }
- else
- {
- window.location="./index.php?pagina=agenda";
- }
- return false;
- });
- });
- </script>
- // html
- <a href="<?php echo "agendamento/agendamento_excluir.php?agendamento={$agendamento->getId()}"; ?>" id="agendamento_excluir"><img alt="Excluir" title="Excluir" src="atendimento/img/botao_excluir.gif" /></a>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement