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


PHP Usuarios::insert方法代码示例

本文整理汇总了PHP中Usuarios::insert方法的典型用法代码示例。如果您正苦于以下问题:PHP Usuarios::insert方法的具体用法?PHP Usuarios::insert怎么用?PHP Usuarios::insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Usuarios的用法示例。


在下文中一共展示了Usuarios::insert方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: agregarAction

 public function agregarAction()
 {
     $this->view->subtitle = $this->info->sitio->usuarios->agregar->titulo;
     if ($this->_request->isPost()) {
         Zend_Loader::loadClass('Zend_Filter_StripTags');
         $filter = new Zend_Filter_StripTags();
         $usuario = trim($filter->filter($this->_request->getPost('usuario')));
         $password = trim($filter->filter($this->_request->getPost('password')));
         $nombre = trim($filter->filter($this->_request->getPost('nombre')));
         $apellido = trim($filter->filter($this->_request->getPost('apellido')));
         $mail = trim($filter->filter($this->_request->getPost('mail')));
         $estado = trim($filter->filter($this->_request->getPost('estado')));
         $creado = date("Y-m-d H:i:s");
         if ($usuario != '' && $password != '' && $nombre != '' && $apellido != '' && $mail != '') {
             $data = array('usuario' => strtolower($usuario), 'password' => md5($password), 'nombre' => $nombre, 'apellido' => $apellido, 'mail' => $mail, 'estado' => $estado, 'creado' => $creado, 'id_sitio' => $this->session->sitio->id);
             $usuario = new Usuarios();
             $usuario->insert($data);
             $this->_redirect('/admin/usuarios/');
             return;
         } else {
             $this->view->message = "Deben llenarse todos los campos";
         }
     }
     $this->view->usuario = new stdClass();
     $this->view->usuario->id = null;
     $this->view->usuario->usuario = '';
     $this->view->usuario->password = '';
     $this->view->usuario->nombre = '';
     $this->view->usuario->apellido = '';
     $this->view->usuario->mail = '';
     $this->view->usuario->estado = 0;
     $this->view->action = $this->info->sitio->usuarios->agregar->action;
     $this->view->buttonText = $this->info->sitio->usuarios->agregar->buttonText;
     $this->render();
 }
开发者ID:anavarretev,项目名称:surforce-cms,代码行数:35,代码来源:UsuariosController.php

示例2: Usuarios

      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
   <![endif]-->
</head>
<body>

	<div class="container">

		<?php 
$usuario = new Usuarios();
if (isset($_POST['cadastrar'])) {
    $nome = $_POST['nome'];
    $email = $_POST['email'];
    $usuario->setNome($nome);
    $usuario->setEmail($email);
    # Insert
    if ($usuario->insert()) {
        echo "Inserido com sucesso!";
    }
}
?>
		<header class="masthead">
			<h1 class="muted">PHP OO</h1>
			<nav class="navbar">
				<div class="navbar-inner">
					<div class="container">
						<ul class="nav">
							<li class="active"><a href="index.php">Página inicial</a></li>
						</ul>
					</div>
				</div>
			</nav>
开发者ID:rnixon,项目名称:php-oo-praticando,代码行数:31,代码来源:index.php

示例3: Usuarios

 $result = null;
 $users = new Usuarios("userFunctions");
 $am = new AuthManager("userFunctions");
 $operation = http_request("Operation", "s", null);
 $id = http_request("ID", "i", 0);
 $user = http_request("Username", "s", null);
 $pass = http_request("Password", "s", null);
 $sid = http_request("Session", "i", 0);
 $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":
开发者ID:nedy13,项目名称:AgilityContest,代码行数:31,代码来源:userFunctions.php

示例4: 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


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