<?php
 	session_start(); 
	$cmpmid = $_SESSION['linkarisecmpmid'];

	if(!isset($_SESSION['linkarisecrm']))
	{
		header('Location: index.php');
	}
	
	include("connect.php");

	$unitmid=$_POST['unitmid'];
	$uname=$_POST['uname'];

	
	$eve = "update res_unit_master set unitname='$uname' where unitmid=$unitmid  and cmpmid=$cmpmid";			
	if ($conn->query($eve) === TRUE)
	{
		$_SESSION['msg'] = "Record Updated";		
	} else 
	{
		$_SESSION['msg'] = "Error";
	}
	header('Location: unit.php');	
?>