<?php
	session_start();

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

	
	include("connect.php");
	
	
	$eve = "select * from res_mainmodule_master where mmodulemid=".$_GET['id'];
	$re = mysqli_query($conn, $eve);

	if(mysqli_num_rows($re) > 0)
	{
		while($rt = mysqli_fetch_assoc($re))
		{
			if($rt['mmstatus']==1)
			{
				$eve1 = "update res_mainmodule_master set mmstatus=0 where mmodulemid=".$_GET['id'];
				$re1 = mysqli_query($conn, $eve1);
			}
			else
			{		
				$eve1 = "update res_mainmodule_master set mmstatus=1 where mmodulemid=".$_GET['id'];
				$re1 = mysqli_query($conn, $eve1);
			}
		}
	}
	$_SESSION['msg'] = "mainmodule Status Changed";
	
	
	header('Location: mainmodule.php');
	
?>