Personal hello I hope you can help me, I have this problem a long time
I'm trying to get my data via Ajax for my class but in the URL I do not know how to reach it in a way that does not error
I tried the following way
$.ajax({
type:'post',
url:'Classes/Usuario.class.php',
ajax:'1',
data:{id:1},
success: function (data){
alert(data)
}
});
Well, remarks if you help me respond.
Another thing that can help, my classes are called automatically by the magic method __autoload (). I believe that there is a different way to write the URL.
Good people, please do not indicate another post, if you do not understand tell us in the comments that they are with you until we can solve this problem!
Thank you for helping me! Until ...
As requested I am just below comes the code of the file User.class.php
<?php
/**
* Created by PhpStorm.
* User: Pedro
* Date: 19/01/2016
* Time: 00:43
*/
class Usuario extends BancoPizza
{
public $Tabela = 'pizzaria';
public $Campos = array(
'nome_pizzaria',
'usuario_pizzaria',
'senha_pizzaria',
'rua_pizzaria',
'numero_pizzaria',
'bairro_pizzaria',
'cidade_pizzaria',
'uf_pizzaria',
'status_pizzaria'
);
/**
* @param $dados -> Campos da tabela
* @param $Campos -> A classe ja tem os campos da tabela
*/
public function verUm($where=null){
return parent::verUm($this->Tabela, $where);
}
public function verTodos($where=null, $ordem=null)
{
return parent::verTodos($this->Tabela, $where, $ordem);
}
public function excluir($where)
{
//Aqui eu queria pegar a Id do item clicado e através do ajax passar essa id, porem preciso saber como especificar o método que esse meu valor vai, correto ?
return $_POST['id'];
return parent::excluir($this->Tabela, $where);
}
public function editar($campoTabela, $valor, $id)
{
parent::editar($this->Tabela, $campoTabela, $valor, $id);
}
}