コード例 #1
0
ファイル: index.php プロジェクト: bestlong/LASS
				"sensorID": "HR",                         
                "sensorList": [ 1, 2, 5, 6, 11] }
            ]}                                           
            ';
$SensorsList = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
$deviceSensorList = json_decode($jsonSensors, TRUE);
require "../conn/pdo.php";
require "../conn/conninfo.php";
require "functions.php";
$sensors = new conninfo($pdo);
require '../PHPMailer-master/PHPMailerAutoload.php';
$email_sendout = false;
//是否要寄出email?
$email_minutes_period = 15 * 60;
//每隔幾分鐘寄一次alarm email
$tmpList = $sensors->get_email_time();
$alarm_trigger = false;
//若有超過警戒值,則為true, 並執行mp3
foreach ($tmpList as $row) {
    ${"email_last_time_" . $row['idname']} = $row['email_time'];
}
$A_datetime = $row['datetime'];
$date = new DateTime();
$nowTime = $date->getTimestamp();
$output = shell_exec('./alarm.sh');
echo "<pre>{$output}</pre>";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="tw"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
<meta http-equiv="refresh" content="120" >