-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedituser.php
More file actions
41 lines (40 loc) · 1.59 KB
/
Copy pathedituser.php
File metadata and controls
41 lines (40 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
require_once("database.php");
session_start();
if (!$_SESSION["valid_user"])
{
Header("Location: loginform.php");
}
else if($_SESSION["role"] >= 6)
{
$user = $_GET['id'];
$sql = "SELECT * FROM users WHERE id = '" . $user . "'";
$ref = mysql_query($sql);
$row = mysql_fetch_assoc($ref);
$content = "ID : " . $row['id'] . "<br>Name : " . $row['name'] . "<br>Alias : " . $row["fname"] . "<br>College : " . $row['college'] . "<br>Mob NO : " . $row['mob'] . "<br>Email : " . $row['email'] . "<br><form action=\"updateuser.php\"><input type = \"hidden\" name = \"id\" value = \"" . $row['id'] . "\"> Level : <input type = \"text\" name = \"level\" value = \"" . $row['level'] . "\"><br>";
if($_SESSION["role"] == 10)
$content = $content . "<input type = \"text\" name = \"role\" value = \"" . $row['role'] . "\">";
$content = $content . "<input type = \"submit\" value=\"update\"></form>";
$name = $row['name'];
$sql = "SELECT * FROM logs WHERE user = '" . $name . "'ORDER BY time DESC";
$ref = mysql_query($sql);
$content = $content . "<br><br>";
while($row = mysql_fetch_assoc($ref))
{
$content = $content . "<br>" . $row["user"] . " : " . $row["val"];
}
if($_SESSION["role"] == 10)
{
$sql = "SELECT * FROM accesslogs WHERE user = '" . $name . "' ORDER BY time DESC";
$ref = mysql_query($sql);
$content = $content . "<br><br>";
while($row = mysql_fetch_assoc($ref))
{
$content = $content . "<br>" . $row['val'] . " From" . $row['ip'];
}
}
}
else
$content = "Restricted Area";
require_once("theme/clueless/theme.php");
?>