<?php
session_start(); 

	if(!isset($_SESSION['linkarisecrm']))
	{
		header('Location: index.php');
		return;
	}
	
		date_default_timezone_set("Asia/Singapore");
				$mdate1= date('Y-m-d H:i:s');
				$mdate= date('d-m-Y');
	
	$cmpmid=$_SESSION['linkarisecmpmid'];
	$umid1=$_SESSION['linkariseumid'];
	
	$_SESSION['_token']=bin2hex(openssl_random_pseudo_bytes(16));
	
	
	include("connect.php");
include("mylibrary.php");


	$umid=$_POST['usermid'];
		$username=$_POST['username'];
		
		$usersecurepasword=md5($_POST['userpassword']);
		$userloginid=$_POST['userloginid'];
		$usermobile=$_POST['usermobile'];
	
	

	 $eve = "update res_user_master set username='$username',usersecurepasword='$usersecurepasword',userloginid='$userloginid',usermobile='$usermobile',updatedby=$umid1,updatedon='$mdate1' where usermid=$umid and companymid='$cmpmid'";	
	if ($conn->query($eve) === TRUE)
	{			
		$_SESSION['msg'] = "Record has been updated successfully";			
	}
	
	header('Location: user.php');
?>