<?php
$filename = 'c_leitura.php';

if (!file_exists($filename)) {
  header("Location: error.php"); exit;   
}				
include 'c_leitura.php';

require_once("db.php");

$id = $_POST['id'];

$query = "UPDATE ponto SET status = 0 WHERE id = '".$id."'";
$result = mysql_query($query);

//if ($result) {
//	$query3 = "UPDATE tablet SET id_ponto = 0 WHERE id_ponto = '".$id."'";
//	$result3 = mysql_query($query3);
//}


if ($result) {
	echo json_encode(array('success'=>1, 'msg'=>'Ponto deletado com sucesso!'));
} else {
	echo json_encode(array('success'=>0, 'msg'=>'Erro ao deletar ponto!'));
}

exit;
// header('Location: pontos.php?msg=2');

?>
