D7net Mini Sh3LL v1
Current File : C:/Domains/maymaytinson.com/httpdocs/lib/images/13/../10/../7/../16/../activity/../JUKI/../15/../zip_food/../18/../17/../2/../21/../20/../22/../5/../11/../7/../5/../22/../22/../20/../19/../10/../../../include/editMember.php |
<br><h3>Thông tin người dùng</h3>
<br>
<div id="editMember">
<?php
$stmt=$conn->prepare("SELECT * FROM member WHERE id='".$_GET['id']."'");
$stmt->execute();
$member=$stmt->fetch(PDO::FETCH_ASSOC);
?>
<form method="POST">
<table>
<tr>
<td>Họ tên</td>
<td><input disabled="" type="" name="" value="<?php echo $member['name'] ?>"></td>
<td>Điện thoại</td>
<td><input disabled="" type="" name="" value="<?php echo $member['phone'] ?>"></td>
</tr>
<tr>
<td>Email</td>
<td><input type="email" name="email" value="<?php echo $member['email'] ?>"></td>
<td>Cấp bậc</td>
<td><input type="text" name="id" value="<?php echo $member['id'] ?>" hidden>
<select name="level">
<option value="0" <?php if($member['type']==0 || $member['type']==7){ echo "selected"; } ?>>Khách hàng</option>
<option value="1" <?php if($member['type']==1){ echo "selected"; } ?>>Quản lý</option>
</select>
</td>
</tr>
<tr>
<td><button type="submit" name="save">Lưu lại</button></td>
</tr>
</table>
<?php
if(isset($_POST['save'])){
if(empty($_POST['email'])){
$errors[]="Vui lòng nhập email";
}
if(empty($errors)){
$stmt=$conn->prepare("UPDATE member SET email=:email,type=:type WHERE id='".$_GET['id']."'");
$stmt->bindParam(":email",$_POST['email'],PDO::PARAM_STR);
$stmt->bindParam(":type",$_POST['level'],PDO::PARAM_INT);
$stmt->execute();
header("location:editMember.php?id=".$_GET['id']);
}else{
notice($errors);
}
}
?>
</form>
</div>
AnonSec - 2021 | Recode By D7net