1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
<?php require_once(__DIR__ . '/../checkuser.php');
$id = $_GET['id']; $active = $_GET['active'];
if (!empty($id)) { $sql = "SELECT * FROM sys_login WHERE id = ? AND deleted = ?"; $parameters = array($id, 0); $sth = Db\Util::execute($dbh, $sql, $parameters); $user = $sth->fetch(PDO::FETCH_ASSOC); $user['actived'] = $active == 0 ? 0 : 1; Db\Util::update($dbh, 'sys_login', $user); $data = array( 'message' => $user['username'] . ' status updated', ); redirectAndExit(Util::link(__DIR__ . '/index.php') . '?' . http_build_query($data)); }
|