本文整理汇总了PHP中Trigger::update_state_on_event方法的典型用法代码示例。如果您正苦于以下问题:PHP Trigger::update_state_on_event方法的具体用法?PHP Trigger::update_state_on_event怎么用?PHP Trigger::update_state_on_event使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Trigger
的用法示例。
在下文中一共展示了Trigger::update_state_on_event方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
$datablob = isset($_GET['datablob']) ? $sqliconn->escapestring(htmlspecialchars($_GET['datablob'])) : '';
}
// POST
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$post = json_decode(file_get_contents('php://input'), true);
$type = isset($post['type']) ? $sqliconn->escapestring(htmlspecialchars($post['type'])) : '';
$location = isset($post['location']) ? $sqliconn->escapestring(htmlspecialchars($post['location'])) : die;
$source = isset($post['source']) ? $sqliconn->escapestring(htmlspecialchars($post['source'])) : '';
$method = isset($post['method']) ? $sqliconn->escapestring(htmlspecialchars($post['method'])) : 'unknown-web-POST';
$info = isset($post['info']) ? $sqliconn->escapestring(htmlspecialchars($post['info'])) : '';
$imgblob = isset($post['imgblob']) ? $sqliconn->escapestring(htmlspecialchars($post['imgblob'])) : '';
//base64_decode(rawurldecode(
$datablob = isset($post['datablob']) ? $sqliconn->escapestring(htmlspecialchars($post['datablob'])) : '';
}
// update database
$sql = "INSERT INTO events (uuid, type, location, source, time, method, info, imgblob, datablob) VALUES ('{$uuid}', '{$type}', '{$location}', '{$source}', '{$currenttime}', '{$method}', '{$info}', '{$imgblob}', '{$datablob}')";
//var_dump( $sql );
if ($sqliconn->query($sql) === TRUE) {
// fire state updater
$trigger = new Trigger();
$trigger->update_state_on_event($sqliconn, $uuid, $type, $location, $source, $method, $currenttime);
if ($type == "motion") {
$trigger->intruder_check($sqliconn, $uuid, $type, $location, $source, $method, $currenttime);
}
//http_response_code(200);
//echo "all grand";
} else {
//http_response_code(418);
echo "Error updating record: test";
// . $sqliconn->error;
}