<?php
//include("../../database.inc.php"); //database.inc.php is databse connection file which will be included
include("../../../include/startup.php"); 
if(isset($_REQUEST['action']) && $_REQUEST['action']=='change_status'){
  $page_id = $_REQUEST['page_id'];  
  $new_status = ($_REQUEST['status'] == 0) ? 1 : 0; 
  if($page_id){
    $update_page = "UPDATE pages SET live ='".$new_status."' WHERE id='".$page_id."' ";
    if(mysqli_query($conn,$update_page)){
      echo "Page status changed";
    }
  }else{
    echo "Page status not changed";
  }
}else if(isset($_REQUEST['action']) && $_REQUEST['action']=='site_shipping_policy_delivery_options'){
	ob_clean();		
	if($_REQUEST['perform_action'] == "update"){
		$_REQUEST['action'] = "update";		
	}	
	include("site_shipping_policy_delivery_options.inc.php");
}else if(isset($_REQUEST['action']) && $_REQUEST['action']=='delete_shipping_policy'){
	ob_clean();
	$id = $_REQUEST['site_shipping_policy_id'];
	mysqli_query($conn,"DELETE FROM site_shipping_policy_delivery_options WHERE id=$id");
	//echo "This shipping policy deleted successfully...";
	$returnArray['status'] = "success";
	$returnArray['message'] = "This shipping policy deleted successfully....";
	echo json_encode($returnArray);	
}	
die;
?>