<?php
session_start(); 
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
	if(!isset($_SESSION['linkarisecrm']))
	{
		header('Location: index.php');
		return;
	}
	
	
	
	
	$_SESSION['_token']=bin2hex(openssl_random_pseudo_bytes(16));
	
	
	include("connect.php");
	include("connectp.php");
	include("removespecial.php");
	date_default_timezone_set("Asia/Kolkata");
	$mdate= date('Y-m-d H:i:s');
	$mdate1= date('Y-m-d');

	$tmid=(int)mysqli_real_escape_string($conn,$_POST['tmid']);
	$umid=$_SESSION['linkariseumid'];
	
	$taskstage=$_POST['stagename'];
	$remarks=removespecialchar($_POST['remarks']);
	
	 $eve2 = "update res_task_master set taskstage='$taskstage',taskremark='$remarks',taskupdatedon='$mdate', taskupdatedby='$umid' where tmid=$tmid";
	if ($conn->query($eve2) === TRUE)
	{
		
		$_SESSION['msg'] = "Task Stage changed";
	}
	else
	{
		$_SESSION['msg1']="Error";
	}
	
	header("Location: taskstatus.php?tmid=$tmid");
?>	