本文整理汇总了PHP中Usuarios::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Usuarios::delete方法的具体用法?PHP Usuarios::delete怎么用?PHP Usuarios::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Usuarios
的用法示例。
在下文中一共展示了Usuarios::delete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
if (isset($_POST['atualizar'])) {
$id = $_POST['id'];
$nome = $_POST['nome'];
$email = $_POST['email'];
$usuario->setNome($nome);
$usuario->setEmail($email);
if ($usuario->update($id)) {
echo "Atualizado com sucesso!";
}
}
?>
<?php
if (isset($_GET['acao']) && $_GET['acao'] == 'deletar') {
$id = (int) $_GET['id'];
if ($usuario->delete($id)) {
echo "Deletado com sucesso!";
}
}
?>
<?php
if (isset($_GET['acao']) && $_GET['acao'] == 'editar') {
$id = (int) $_GET['id'];
$resultado = $usuario->find($id);
?>
<form method="post" action="">
<div class="input-prepend">
<span class="add-on"><i class="icon-user"></i></span>
<input type="text" name="nome" value="<?php
示例2: Usuarios
<?php
require_once 'variaveis.php';
require_once 'core/Usuarios.php';
$user = new Usuarios();
if (isset($_GET['del'])) {
$user->setId_usuario($_GET['del']);
$user->delete();
}
if (isset($_GET['edit'])) {
$user->setUsuario($_GET['edit']);
$user->update();
}
if (isset($_POST['usuario']) and isset($_POST['nome']) and isset($_POST['senha']) and isset($_POST['tipo']) and !isset($_GET['editar'])) {
$user->setNome($_POST['nome']);
$user->setUsuario($_POST['usuario']);
$user->setSenha(md5($_POST['senha']));
$user->setId_tipo($_POST['tipo']);
$user->insert();
}
$smarty->assign("lista", $user->select());
$smarty->assign("nome", "Usuários");
$smarty->display("usuarios.tpl");
示例3: Exception
$sk = http_request("SessionKey", "s", "");
if ($operation === null) {
throw new Exception("Call to userFunctions without 'Operation' requested");
}
switch ($operation) {
case "insert":
$am->access(PERMS_ADMIN);
$result = $users->insert();
break;
case "update":
$am->access(PERMS_ADMIN);
$result = $users->update($id);
break;
case "delete":
$am->access(PERMS_ADMIN);
$result = $users->delete($id);
break;
case "password":
$result = $am->setPassword($id, $pass, $sk);
break;
// access checks are done inside method
// access checks are done inside method
case "selectbyid":
$result = $users->selectByID($id);
break;
case "select":
$result = $users->select();
break;
// list with order, index, count and where
// list with order, index, count and where
case "enumerate":
示例4: eliminarAction
public function eliminarAction()
{
$this->view->subtitle = $this->info->sitio->usuarios->eliminar->titulo;
$usuario = new Usuarios();
if ($this->_request->isPost()) {
Zend_Loader::loadClass('Zend_Filter_Alpha');
$filter = new Zend_Filter_Alpha();
$id = (int) $this->_request->getPost('id');
$del = $filter->filter($this->_request->getPost('del'));
if ($del == 'Si' && $id > 0) {
$where = 'id = ' . $id;
$rows_affected = $usuario->delete($where);
}
} else {
$id = (int) $this->_request->getParam('id');
if ($id > 0) {
$this->view->usuario = $usuario->fetchRow('id=' . $id);
if ($this->view->usuario->id > 0) {
$this->render();
return;
}
}
}
$this->_redirect('/admin/usuarios/');
}