/var/www/hkosl.com/e-ims/file_manager/status_user.php


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
<?php
include 'config.php';

// Check if the user is logged in

if ((!isSet($_SESSION['loginname'])) || ($loggin <> '1'))
{
header("Location: login.php");
exit;
}
require(
"configure.php"); 

$index        $_GET["index"];
$nowdate     date("Y-m-d H:i:s");
$loginid     $_GET["loginid"];
$companyid     $_GET["companyid"];

$sql "update file_company_user set status=case when status = 1 then 0 else 1 end, lastupdate=:lastupdate, lastupby=:lastupby where userid=:userid";
$sth Db::getDbh()->prepare($sql);
$sql_param = array();
$sql_param[':lastupby'] = $_SESSION['loginid'];
$sql_param[':lastupdate'] = $nowdate;
$sql_param[':userid'] = $loginid;
$sth->execute($sql_param);
if( 
$error $sth->getError($sql_param) ){
    
var_dump($error);
}

$dbh null;

header("Location: index.php?index=$index&companyid=$companyid");
?>