<?php









//user_action.php









include('db_con.php');




if (isset($_SESSION['user_id'])) {




		$user_type = $_SESSION['user_type'];




		$user_id = $_SESSION['user_id'];




		$user_name = $_SESSION['user_name'];




		$branch_id = $_SESSION['branch_id'];




		$branch_name = $_SESSION['branch_name'];




		$store_id = $_SESSION['store_id'];




    $store_name = $_SESSION['store_name'];




}else{




	header('Location: login');




	die();




}









if(isset($_POST['btn_action']))









{









	




	




	




	if($_POST['btn_action'] == 'delete')




	{




		$doc_status = 'Inactive';




		if($_POST['doc_status'] == 'Active')




		{




			$doc_status = 'Inactive';




		}




		$query = "




		UPDATE do




		SET doc_status = :doc_status 




		WHERE do_id = :do_id




		";




		$statement = $connect->prepare($query);




		$statement->execute(




			array(




				':doc_status'	=>	$doc_status,




				':do_id'		=>	$_POST["do_id"]




			)




		);	




		$result = $statement->fetchAll();	




		if(isset($result))




		{




			echo 'Do Status change to ' . $doc_status;




		}




	}




}









?>