Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <a href="<?php echo base_url();?>mantenimiento/categorias/delete_funcion/<?php echo $categoria->id;?>" class="btn btn-danger btn-remove"><span class="fa fa-remove"></span></a>
- var base_url= "<?php echo base_url();?>";
- $(".btn-remove").on("click", function(e){
- e.preventDefault();
- var ruta = $(this).attr("href");
- //alert(ruta);
- $.ajax({
- url: ruta,
- type:"POST",
- success:function(resp){
- //http://localhost/ventas_ci/mantenimiento/productos
- window.location.href = base_url + resp;
- }
- });
- public function delete_funcion($id)
- {
- $data = array
- (
- 'estado' => "0",
- );
- $this->Categorias_models->update_model($id,$data);
- echo "mantenimiento/categorias";//retorna el controlador categorias para q pueda actualizarce la pagina
- }
- public function update_model($id,$data)
- {
- $this->db->where("id", $id);
- return $this->db->update("categorias", $data);
- }
Add Comment
Please, Sign In to add comment