__init__($conn, $server["table"]); // Obtain the transferred detection results and weather data from the WizFi360-EVB-Pico. if(isset($_GET["temperature"]) && isset($_GET["humidity"]) && isset($_GET["egg_count"]) && isset($_GET["feeder_status"])){ // Insert the received information into the given database table. $date = date("Y/m/d_h:i:s"); if($feeder->insert_new_data($date, $_GET["temperature"], $_GET["humidity"], $_GET["egg_count"], $_GET["feeder_status"])){ echo("Data received and saved successfully!"); }else{ echo("Database error!"); } // Send the received information via WhatsApp to the registered phone so as to notify the user. $feeder->send_message( "⏰ $date\n\n" ."📌 Object Detection\n🥚 Egg Count: " .$_GET["egg_count"] ."\n🐦 Feeder Status: " .$_GET["feeder_status"] ."\n\n📌 Weather\n🌡️ Temperature: " .$_GET["temperature"] ."°C\n💧 Humidity: " .$_GET["humidity"]."%" ); }else{ echo("Waiting Data..."); } // If requested, create a new database table. if(isset($_GET["create_table"]) && $_GET["create_table"] == "OK") $feeder->database_create_table(); ?>