Store in GIT
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
header('Content-Type: application/json');
|
||||
require("../../inc/connect.php");
|
||||
require("../session.php");
|
||||
|
||||
$session = $_GET['session'];
|
||||
$id = $_GET['id'];
|
||||
|
||||
if($session == "")
|
||||
{
|
||||
JError("session not set");
|
||||
}
|
||||
if($id == "")
|
||||
{
|
||||
JError("id not set");
|
||||
}
|
||||
|
||||
//check session
|
||||
verify_session($mysqli, $session);
|
||||
|
||||
$sql = "SELECT `id` FROM `alarm` WHERE `dev_id`=$deviceid AND `id`=$id";
|
||||
$query = ExecQuery($mysqli, $sql);
|
||||
|
||||
if($query->num_rows < 1)
|
||||
{
|
||||
JError("you cannot delete that alarm");
|
||||
}
|
||||
|
||||
//update
|
||||
$sql = "DELETE FROM `alarm` WHERE `id`=$id";
|
||||
ExecQuery($mysqli, $sql);
|
||||
|
||||
JSuccess("true");
|
||||
?>
|
||||
Reference in New Issue
Block a user