Ejemplo n.º 1
0
<?php

if ($_SERVER["REQUEST_METHOD"] == "GET") {
    header("content-type: text/xml");
    include "callWebService.php";
    $url = "localhost/wsax/shopping/UKShopping/shopsXML.php?name=" . $_GET['name'];
    $xmlReturned = callWebService($url, "GET");
    echo $xmlReturned['content'];
}
Ejemplo n.º 2
0
$currentPath = "http://" . $_SERVER['SERVER_NAME'] . dirname($_SERVER['PHP_SELF']);
echo "<a href='" . $currentPath . "/'>Home</a><br />";
function foundOpeningTag($parser, $tag, $attributes)
{
    global $currentTag;
    $currentTag = $tag;
}
function foundClosingTag($parser, $tag)
{
    global $currentTag;
    $currentTag = null;
}
function foundText($parser, $characters)
{
    global $currentTag, $ids, $names, $types, $locations;
    if ($currentTag == "ID") {
        $ids[] = $characters;
    } elseif ($currentTag == "NAME") {
        $names[] = $characters;
    } elseif ($currentTag == "TYPE") {
        $types[] = $characters;
    } elseif ($currentTag == "LOCATION") {
        $locations[] = $characters;
    }
}
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
    include "callWebService.php";
    $url = "localhost/wsax/shopping/UKShopping/shopsXML.php?id=" . $_GET['id'];
    $xmlReturned = callWebService($url, "DELETE");
    header("Location: localhost/wsax/shopping/IOWShopping/");
}
Ejemplo n.º 3
0
echo "<a href='" . $currentPath . "/'>Home</a><br />";
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
    echo '<form action="' . htmlspecialchars($_SERVER["PHP_SELF"]) . '" method="post">';
    echo '<input type="hidden" name="id">';
    echo 'Name: <input type="text" name="name"><br />';
    echo 'Type: <input type="text" name="type"><br />';
    echo 'Location: <input type="text" name="location"><br />';
    echo '<input type="submit">';
    echo '</form>';
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    if (isset($_POST['id']) && isset($_POST['name']) && isset($_POST['type']) && isset($_POST['location'])) {
        $postData = "<shop>" . "<name>" . $_POST['name'] . "</name>" . "\n\t\t\t<type>" . $_POST['type'] . "</type>" . "\n\t\t\t<location>" . $_POST['location'] . "</location>" . "\n\t\t</shop>";
        echo $postData;
        $shopID = $_POST['id'];
        $xmlReturned = callWebService("localhost/wsax/shopping/UKShopping/shopsXML.php?id={$shopID}", "POST", $postData);
        echo $xmlReturned['content'];
        // TODO REMOVE PARSER BELOW
        $currentTag = null;
        $ids = array();
        $names = array();
        $types = array();
        $locations = array();
        $parser = xml_parser_create();
        xml_set_element_handler($parser, "foundOpeningTag", "foundClosingTag");
        xml_set_character_data_handler($parser, "foundText");
        xml_parse($parser, $xmlReturned["content"]);
        xml_parser_free($parser);
        //if ($xmlReturned['code']==200)
        //	header("Location: index.php");
    }
Ejemplo n.º 4
0
        $token = $app->jwt->id;
    } else {
        /* No scope so respond with 401 Unauthorized */
        $this->app->response->status(401);
    }
    echo json_encode(array("AuthHeader" => $authHeader, "Hash_Token" => $jwt, "token" => $token));
    //print_r($app->jwt);
});
$app->post('/testManager/transformToLatLng/', function () use($app, $proj4) {
    transformToLatLng($app, $proj4);
});
$app->get('/testManager/simpleGeoJSON/', function () use($app) {
    simpleGeoJSON($app);
});
$app->get('/testManager/callWebService/', function () use($app, $client) {
    callWebService($app, $client);
});
/* Login manager */
$app->post('/loginManager/checkUserPassword/', function () use($app, $pdo, $db, $conn_db2, $key) {
    checkUserPassword($app, $pdo, $db, $conn_db2, $key);
});
$app->post('/loginManager/logout/', function () use($app, $pdo, $db) {
    logout($app, $pdo, $db);
});
$app->get('/loginManager/getJWT/', function () use($app) {
    getJWT($app);
});
$app->post('/loginManager/checkJWT/', function () use($app, $key) {
    checkJWT($app, $key);
});
$app->post('/loginManager/checkPermission/', function () use($app, $pdo, $db, $key) {