<?php

/**

** author:  aslapai
**
** date created: 26/06/2015
**
** this page serves ajax call to update password sent from function.js
*/


//include the headers resources
require_once('includes/functions_.php');


//collect the user id
 $user_id = get_user_id();

 $security_id = get_security_id($user_id);

//collec the password
$option = $_POST['option'];

	//query
	$q = "UPDATE `controls` SET `active` = '$option', modified_by = '$security_id' WHERE `controls`.`id` = 5";
	$r = mysqli_query($dbc, $q);

	if($r)
	{
		echo  '<img src="images/info.png" />&nbsp;<label class="label label-success">Update successful.</label>';
	}
	else
	{
		echo  '<img src="images/blocked.png" />&nbsp;<label class="label label-danger">Not successful due to system error.</label>';
	}


?>
