本文整理汇总了PHP中users::updateUser方法的典型用法代码示例。如果您正苦于以下问题:PHP users::updateUser方法的具体用法?PHP users::updateUser怎么用?PHP users::updateUser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类users
的用法示例。
在下文中一共展示了users::updateUser方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
public function get()
{
$newUser = new users();
$saveUser = new users();
$deleteUser = new users();
$userTables = new users();
if (isset($_GET["firstname"]) && $_GET["firstname"] != '' && isset($_GET["lastname"]) && $_GET["lastname"] != '' && isset($_GET["email"]) && $_GET["email"] != '') {
$newUser->addUser($_GET["firstname"], $_GET["lastname"], $_GET["email"]);
}
if ($_GET["save"] === "true") {
$saveUser->updateUser($_GET["email"], $_GET["firstname"], $_GET["lastname"]);
} elseif ($_GET["delete"] === "true") {
$deleteUser->deleteUser($_GET["email"]);
}
echo ' <head>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th, td {
padding: 15px;
}
</style>
</head>
<body>
<table style="width:100%">
<tr>
<td>Firstname</td>
<td>Lastname</td>
<td>Email</td>
</tr>';
$userTables->userTable();
echo ' </table>
</body>
';
}
示例2: updateUser
/**
* Функция обновления данных пользователя
*
* @param (array) $arrData - массив данных для обновления (key: name field => val: value field)
* @param (string) $strWhere - строка, условие для запроса
*
* @return bool
*/
public function updateUser($arrData, $strWhere = false)
{
return parent::updateUser($arrData, $strWhere);
}
示例3: users
include "src/common/header.php";
?>
</div>
<div id="main">
<div class="col">
<h2>Mon Compte</h2>
<?php
$users = new users();
if (isset($_POST['submit'])) {
$prenom = ucfirst(strtolower($_POST['prenom']));
$nom = strtoupper($_POST['nom']);
$mail = strtolower($_POST['mail']);
$login = strtolower($_POST['login']);
$password = $_POST['password'];
$users->updateUser($idSession, $nom, $prenom, $mail, $login, $password);
echo "Compte modifié<br>";
}
$user = $users->getUser($idSession);
?>
<form method="post">
<table>
<tr><td colspan="2">Nouveau utilisateur</td></tr>
<tr>
<td>Mail : </td>
<td><input type="text" name="mail" value="<?php
echo $user->getMail();
?>
"/></td>
</tr>
<tr>
示例4: unlink
$pic_name = $rowUser['pic_path'];
if (trim($name) != "" and trim($ext) != "" and trim($roomNo) != "0") {
if (isset($oldpassword)) {
if ($validate->checkNotNull($oldpassword) and $validate->checkNotNull($newpassword)) {
if ($validate->checkEqual(md5($oldpassword), $serverpass)) {
$password = md5($newpassword);
}
}
}
if (isset($_FILES["myfile"])) {
if ($validate->checkImage()) {
unlink("uploads/users/" . $rowUser['pic_path']);
$pic_name = time() . "_" . $_FILES["myfile"]["name"];
move_uploaded_file($_FILES["myfile"]["tmp_name"], "uploads/users/" . $pic_name);
}
$putValue = $users->updateUser($name, $ext, $roomNo, $pic_name, $password, $u_id);
if ($putValue) {
header("location:editUser.php?edit=" . $u_id . "&Done");
} else {
echo "Some Thing Wrong happen please Try Again Later";
}
}
} else {
?>
<p class="alert alert-danger w text-center">
<?php
echo "Please Complete Your Data First";
?>
</p>
<?php
}