Beispiel #1
0
    require_once '../../libs/db_set_common.php';
    require_once '../../libs/utilfunc.php';
    require_once '../../libs/utilfunc_sd_card.php';
    require_once '../../libs/debug.php';
}
$action = "";
if (isset($_GET['action']) && !empty($_GET['action'])) {
    $action = $_GET['action'];
}
if (isset($_POST['action']) && !empty($_POST['action'])) {
    $action = $_POST['action'];
}
$ret_array = array();
switch ($action) {
    case "getSensors":
        bulcky\check_db();
        $ret_array = configuration\getConfElem("NB_PLUGS");
        break;
    case "getPlugs":
        echo "i égal 1";
        break;
    case "deleteElement":
        $id = "";
        if (isset($_POST['id']) && !empty($_POST['id'])) {
            $id = $_POST['id'];
        }
        bulcky\deleteElementInSynoptic($id);
        break;
    case "addElementOther":
        $image = "";
        if (isset($_POST['image']) && !empty($_POST['image'])) {
Beispiel #2
0
function check_database()
{
    // Check program_index database consitency
    programs\check_db();
    // Check calendar database consitency
    calendar\check_db();
    // Check configuration DB
    configuration\check_db();
    //Check sensors table:
    sensors\check_db();
    //Check plugs table:
    plugs\check_db();
    //Check logs table:
    logs\check_db();
    //Check power table:
    power\check_db();
    //Check bulcky table:
    bulcky\check_db();
}