当前位置: 首页>>代码示例>>PHP>>正文


PHP Usuarios::delete方法代码示例

本文整理汇总了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 
开发者ID:rnixon,项目名称:php-oo-praticando,代码行数:31,代码来源:index.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");
开发者ID:AmandaNatallie,项目名称:RequisitosPA,代码行数:23,代码来源:usuarios.php

示例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":
开发者ID:nedy13,项目名称:AgilityContest,代码行数:31,代码来源:userFunctions.php

示例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/');
 }
开发者ID:anavarretev,项目名称:surforce-cms,代码行数:25,代码来源:UsuariosController.php


注:本文中的Usuarios::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。