/var/www/hkosl.com/e-ims/file_manager/modify_company.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
33
34
35
36
<?php
include 'config.php';

// Check if the user is logged in

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

$index            $_POST["index"];
$companyid        $_POST["companyid"];
$title             htmlspecialchars($_POST["title"],ENT_QUOTES);
$type             htmlspecialchars($_POST["type"],ENT_QUOTES);
$nowdate         date("Y-m-d H:i:s");
//print_r($_POST); 

$sql "update file_company set title=:title, type=:type, lastupdate=:lastupdate, lastupby=:lastupby where companyid=:companyid";
$sth Db::getDbh()->prepare($sql);
$sql_param = array();
$sql_param[':title'] = $title;
$sql_param[':type'] = $type;
$sql_param[':lastupby'] = $_SESSION['loginid'];
$sql_param[':lastupdate'] = $nowdate;
$sql_param[':companyid'] = $companyid;
$sth->execute($sql_param);
if( 
$error $sth->getError($sql_param) ){
    
var_dump($error);
}

$dbh null;

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

?>