function delUser($id) { $where = "id={$id}"; $totalCap = getCityCapById(getcIdById($id)) - getCapById($id); $sql = "update biogas_city set totalCap=" . $totalCap . " where id=" . getcIdById($id); mysql_query($sql); //更新城市的总池容 $res = delete("biogas_user", $where); $userImgs = getAllImgByUserId($id); if ($userImgs && is_array($userImgs)) { foreach ($userImgs as $userImg) { if (file_exists("../uploads/" . $userImg['albumPath'])) { unlink("../uploads/" . $userImg['albumPath']); } } } $where1 = "uid={$id}"; if ($userImgs && is_array($userImgs)) { $res1 = delete("biogas_album", $where1); if ($res && $res1) { $mes = "删除成功!<br/><a href='listUser.php' target='mainFrame'>查看用户列表</a>"; } else { $mes = "删除失败!<br/><a href='listUser.php' target='mainFrame'>重新删除</a>"; } } else { if ($res) { $mes = "删除成功!<br/><a href='listUser.php' target='mainFrame'>查看用户列表</a>"; } else { $mes = "删除失败!<br/><a href='listUser.php' target='mainFrame'>重新删除</a>"; } } return $mes; }
echo $row['address']; ?> </td> </tr> <tr> <td width="20%" align="right">电话</td> <td><?php echo $row['phone']; ?> </td> </tr> <tr> <td width="20%" align="right">用户图片</td> <td> <?php $userImgs = getAllImgByUserId($row['id']); foreach ($userImgs as $img) { ?> <img width="100" height="100" src="../uploads/<?php echo $img['albumPath']; ?> " alt=""/> <?php } ?> </td> </tr> </table> <span style="display:block;width:80%; "> 备注<br/> <?php