Beispiel #1
0
            $response['error'] = true;
        }
    }
    $response['errorcode'] = 200;
    echoResponse(200, $response);
});
//
//	URL:	/api/v1/colorcode/:colorid
//	Method:	DELETE
//	Params:	colorid (passed in URL)
//	Returns:  true/false on update operation
//
$app->delete('/colorcode/:colorid', function ($colorid) {
    $cc = new ColorCoding();
    $cc->ColorID = $colorid;
    if (!$cc->DeleteCode()) {
        $response['error'] = true;
        $response['errorcode'] = 404;
        $response['message'] = __("Failed to delete color with ColorID") . " {$cc->ColorID}";
    } else {
        $response['error'] = false;
        $response['errorcode'] = 200;
    }
    echoResponse(200, $response);
});
//
//	URL:	/api/v1/device/:deviceid
//	Method:	DELETE
//	Params:	deviceid (passed in URL)
//	Returns:  true/false on update operation
//
Beispiel #2
0
        }
    } else {
        if ($col->CreateCode()) {
            echo $col->ColorID;
        } else {
            echo 'f';
        }
    }
    exit;
}
if (isset($_POST['ccused'])) {
    $count = ColorCoding::TimesUsed($_POST['ccused']);
    if ($count == 0) {
        $col = new ColorCoding();
        $col->ColorID = $_POST['ccused'];
        $col->DeleteCode();
    }
    echo $count;
    exit;
}
if (isset($_POST['mt'])) {
    // Media Types
    $mt = new MediaTypes();
    $mt->MediaType = trim($_POST['mt']);
    $mt->ColorID = $_POST['mtcc'];
    if (isset($_POST['mtid'])) {
        // If set we're updating an existing entry
        $mt->MediaID = $_POST['mtid'];
        if (isset($_POST['original'])) {
            $mt->GetType();
            header('Content-Type: application/json');