<?php
require '../../../wp-blog-header.php';

$id = $_POST['id'];

global $wpdb;
$wpdb->show_errors();

$table_name = $wpdb->prefix . "smpages";
$query = "SELECT supressed FROM $table_name WHERE id = $id";
$querydata = $wpdb->get_row($query);

if ($querydata->supressed == "YES") {
	$newstatus = 'NO';
} else {
	$newstatus = 'YES';
}

$wpdb->update(
	$table_name,
	array(
		'supressed' => $newstatus,
	),
	array('id' => $id)
);
?>
