本文整理汇总了PHP中Perfil::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Perfil::delete方法的具体用法?PHP Perfil::delete怎么用?PHP Perfil::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Perfil
的用法示例。
在下文中一共展示了Perfil::delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
public function delete()
{
$obj = new Perfil();
$p = $obj->delete($_GET['id']);
if ($p[0]) {
header('Location: index.php?controller=Perfil');
} else {
$data = array();
$view = new View();
$data['msg'] = $p[1];
$data['url'] = 'index.php?controller=Perfil';
$view->setData($data);
$view->setTemplate('../view/_Error_App.php');
$view->setLayout('../template/Layout.php');
$view->render();
}
}
示例2: Perfil
require_once '../../lib/php/conn.php';
require_once '../../models/Perfil.php';
require_once '../../models/Menu.php';
require_once '../../models/Pessoa.php';
require_once '../../lib/php/Carrinho.php';
$data = new Perfil();
$menu = new Menu();
$pessoa = new Pessoa();
$carrinho = new Carrinho('carrinhoPerfilItem');
foreach ($_REQUEST as $key => $value) {
$_REQUEST[$key] = utf8_decode($value);
}
if ($_REQUEST['acao'] == 1 && $_REQUEST['operacao'] == 2) {
if ($data->add()) {
echo json_encode(array('success' => 1));
} else {
echo json_encode(array('success' => 0));
}
} elseif ($_REQUEST['acao'] == 2 && $_REQUEST['operacao'] == 2) {
if ($data->edit()) {
echo json_encode(array('success' => 1));
} else {
echo json_encode(array('success' => 0));
}
} elseif ($_REQUEST['acao'] == 3 && $_REQUEST['operacao'] == 2) {
if ($data->delete()) {
echo json_encode(array('success' => 1));
} else {
echo json_encode(array('success' => 0));
}
}