CasperSecurity
<?php
session_start();
include '../../../../web/connection/connection.php';
// edit user
$user_id = $_REQUEST['user_id'];
$organisation_unit_id = $_REQUEST['organisation_unit_id'];
$type = $_REQUEST['type'];
$user_name = $_REQUEST['user_name'];
$user_login_id = $_REQUEST['user_login_id'];
$password = $_REQUEST['password'];
$employee_id = $_REQUEST['employee_id'];
$modified_on = date("Y-m-d");
$modified_by = $_SESSION['USER_ID'];
$is_active = $_REQUEST['is_active'];
//edit user role
$user_role_id = $_REQUEST['user_role_id'];
$user_id = $_REQUEST['user_id'];
$role_id = $_REQUEST['role_id'];
$from_date = $_REQUEST['from_date'];
$to_date = $_REQUEST['to_date'];
$active_status = $_REQUEST['active_status'];
// update user
$db_handle = new DBController();
$newUpdate = $db_handle->runMyUpdate("UPDATE user SET user_id = '$user_id',organisation_unit_id ='$organisation_unit_id',type ='$type',
user_name ='$user_name',user_login_id='$user_login_id',password='$password',modified_on='$modified_on',modified_by='$modified_by',is_active='$is_active' WHERE user_id = '$host'");
if($newUpdate == TRUE){
echo 'Data updated Successfully in table 1';
}else{
echo 'Not updated 1' ;
}
// update user role
$db_handle = new DBController();
$newUpdate2 = $db_handle->runMyUpdate("UPDATE user_role SET user_role_id = '$user_role_id',user_id ='$user_id',role_id ='$role_id',
from_date ='$from_date',to_date='$to_date',active_status='$active_status' WHERE user_role_id = '$host'");
if($newUpdate2 == TRUE){
echo 'Data updated Successfully in table 2';
}else{
echo 'Not updated 2' ;
}
?>