Commit 9281829f authored by S.Holzhauer's avatar S.Holzhauer

error fix

parent 0082ff22
......@@ -28,7 +28,7 @@ if ($ID == "REFRESH_IRPS001"){
SELECT `StartTime`, `EndTime`, `Activity`, `Movement`, 0, `Comment`, CURDATE(), `OuderID`
FROM `Leefpatroon`
WHERE `Day`=DAYOFWEEK(CURDATE())-1;";
$conn->query($sql);
$result = $conn->query($sql);
}
else if ($ID != NULL && $ID != "IRPS001"){
//get the elderid connected to the camera.
......@@ -47,7 +47,7 @@ else if ($ID != NULL && $ID != "IRPS001"){
AND StartTime <= '$time'
AND EndTime >= '$time'
AND DayDate = '$date';";
$conn->query($sql);
$result = $conn->query($sql);
}
//if the ID is from the server.
......@@ -82,7 +82,7 @@ else if ($ID == "IRPS001"){
$sql = "UPDATE `Activiteiten`
SET Handled = 1
WHERE ActivityID = '$ActivityID'";
$conn->query($sql);
$result = $conn->query($sql);
//select the details from accounts connected to and details from the elder.
$sql = "SELECT A.AccountID,A.Voorletters,A.Achternaam,A.Emailadres,C.Voorletters,C.Achternaam
......@@ -123,7 +123,7 @@ else if ($ID == "IRPS001"){
$berichtID = $conn->insert_id;
}
//loop trough every account so they all get an email
//loop trough every account so they all get an email
while ($result && ($row = $result->fetch_assoc())){
//send the mail
mail($Email,"Camera Alert","Beste $AcName $Msg",$headers);
......@@ -131,7 +131,7 @@ else if ($ID == "IRPS001"){
//couple the message to appropriate accounts
$sql = "INSERT INTO Account_has_Berichten (`Berichten_BerichtID`,`Account_AccountID`,`Status`)
VALUES ('$berichtID','$AccountID',0);";
$conn->query($sql);
$result = $conn->query($sql);
//couple notification to appropriate accounts
$sql = "INSERT INTO Account_has_Notificatie (`Notificatie_NotificatieID`,`Account_AccountID`)
......@@ -144,21 +144,21 @@ else if ($ID == "IRPS001"){
SET Status = 1
, Handled = 1
WHERE ActivityID = '$ActivityID'";
$conn->query($sql);
$result = $conn->query($sql);
}
else if (($Movement == 1) && ($Detected == 1)){
$sql = "UPDATE `Activiteiten`
SET Status = 1
, Handled = 1
WHERE ActivityID = '$ActivityID'";
$conn->query($sql);
$result = $conn->query($sql);
}
else if (($Movement == 1) && ($Detected == 0)){
//set handled to 1, status stays 0
$sql = "UPDATE `Activiteiten`
SET Handled = 1
WHERE ActivityID = '$ActivityID'";
$conn->query($sql);
$result = $conn->query($sql);
//select the details from accounts connected to and details from the elder.
$sql = "SELECT A.Voorletters,A.Achternaam,A.Emailadres,C.Voorletters,C.Achternaam
......@@ -206,7 +206,7 @@ else if ($ID == "IRPS001"){
//couple the message to appropriate accounts
$sql = "INSERT INTO Account_has_Berichten (`Berichten_BerichtID`,`Account_AccountID`,`Status`)
VALUES ('$berichtID','$AccountID',0);";
$conn->query($sql);
$result = $conn->query($sql);
//couple notification to appropriate accounts
$sql = "INSERT INTO Account_has_Notificatie (`Notificatie_NotificatieID`,`Account_AccountID`)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment