Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

delete contact

  • Loading branch information...
commit 05aa6a4de501847cbd400d90f3f41967a641af2a 1 parent b6b0c2c
elionaz authored
View
4 cake/app/Controller/ContactsController.php
@@ -49,9 +49,9 @@ public function ajax_del(){
$ismyplace = $this->Contact->find('first',array('conditions'=>array('Contact.id' => $idget)));
$ismyplace = $ismyplace['Contact']['place_id'];
if($ismyplace == $placeid){
- pr("borra");die();
+ $this->Contact->delete($idget);
}else{
- pr("no borres");die();
+ pr("error");die();
}
die();
}
View
4 cake/app/View/Contacts/ajax_list.ctp
@@ -4,7 +4,7 @@
$name = $contacto['Contact']['name'];
$telephone = $contacto['Contact']['telephone'];
$id = $contacto['Contact']['id'];
- echo "<p><strong>$name</strong> <span>$telephone</span><button class='del-contact' id='del-$id'>-</button></p>";
+ echo "<p><strong>$name</strong> <span>$telephone</span><button class='del-contact' id='del-$id'>Eliminar</button> <button class='edit-contact' id='edit-$id'>Editar</button></p>";
}
?>
<script>
@@ -15,7 +15,7 @@ $(document).ready(function(){
cualid = cualid[1];
$.get("/Contacts/ajax_del", {id:cualid},
function(data){
- //$.fancybox.close();
+ $
});
});
});
Please sign in to comment.
Something went wrong with that request. Please try again.