<?php 

// Include the tesla_coil class.
include_once "class.php";
// Define a new tesla_coil object.
$tesla_coil = new tesla_coil();

// Define the database and the table in which you want to save data.
// Enter the server name, the user name, the user password, the database name (teslacoilcontroller), and the table name (values).
// On the localhost, these are the default settings. Change the database name (teslacoilcontroller) and the table name (values) if you created a different database and table.
$tesla_coil->database_define("localhost", "root", "", "teslacoilcontroller", "values");

// Depending on the feature variable, save new commands to the table or print the current command variables.
if(isset($_GET["feature"]) && $_GET["feature"] == "save" && isset($_GET["coil"]) && isset($_GET["fan"])){
	$tesla_coil->save_data($_GET["coil"], $_GET['fan']);
}

if(isset($_GET["feature"]) && $_GET["feature"] == "print"){
	$tesla_coil->print_data();
}


?>