<?php
ob_clean();
include("../../../include/startup.php"); 
if(isset($_REQUEST['action']) && $_REQUEST['action']=='active_status_val'){
	$new_status = ($_REQUEST['status_val'] == 1) ? 0 : 1; 
	$id = $_REQUEST['id'];  
	$returnArray = array();
	if($id){
		$update_page = "UPDATE module SET display ='".$new_status."' WHERE id='".$id."' ";
		if(mysqli_query($conn,$update_page)){
			$returnArray['status'] = "success";
			$returnArray['active_status'] = $new_status;
			$returnArray['message'] = "Status Updated Successfully.";
		}else{
			$returnArray['status'] = "failure";
			$returnArray['message'] = "Try again."; 
		}
	}
	
	echo json_encode($returnArray);	
	die;
}
die;
?>