Esempio n. 1
0
    exit;
}
//
// Actually creating process
//
$result = pg_query_params($connection, 'INSERT INTO pies (name, author, description, visible) VALUES ($1, $2, $3, $4) RETURNING id', array($_POST['name'], $user_id, htmlspecialchars($_POST['description']), isset($_POST['hide']) ? '0' : '1'));
$pie_id = pg_fetch_result($result, 0, 0);
// Adding access for owner
if (!pg_query_params($connection, "INSERT INTO access VALUES (\$1, \$2, '', 'o')", array($user_id, $pie_id))) {
    echo 'Failed to add access for owner. <br /><a href="javascript:history.back();">Back</a>';
    exit;
}
try {
    $current = new PieGeometry();
    $current->load_from_db($pie_id);
    $current->apply_steps($steps, $user_id);
} catch (Exception $e) {
    ?>
    <div class="error"><?php 
    echo $e->getMessage();
    ?>
</div>
    <p class="small">
        If you are sure there is no error from your side, fill bug at
        <a href="https://github.com/Foxhind/MapCraft/issues?state=open" target="_blank">github.com/Foxhind/MapCraft/issues</a>
        and attach your osm file.
    </p>
    <p>
        Failed to create a file. <br /><a href="javascript:history.back();">Back</a>
    </p>
<?php 
Esempio n. 2
0
                        <input type="file" id="file" name="file" required="required" />
                        <input class="btn" type="submit" value="Upload" />
                    </fieldset>
                </form>
            </td>
        </tr>
    </table>
<?php 
    include '../lib/_footer.php';
    exit;
}
//
// THIRD STEP: Apply changes
//
try {
    $current->apply_steps($steps, 0);
    update_kml($current->id);
    system('curl -s -d "" "' . $hub_full_url . '/api/pie/' . $current->id . '/send_refresh_pie_data" >/dev/null');
    echo "Done. Close this window, or return <a href=\"/update/" . $current->id . "\">back</a> to first step.";
} catch (Exception $e) {
    ?>
    <div id="pageheader" style="background-color: #92836c;">Can't to parse a new cake</div>
    <div class="error"><?php 
    echo $e->getMessage();
    ?>
</div>
    <p class="small">
        Updating failed. Please make sure, that you have modified freshest exported version of the file.
        If you are sure there is no error from your side, fill bug at
        <a href="https://github.com/Foxhind/MapCraft/issues?state=open" target="_blank">github.com/Foxhind/MapCraft/issues</a>
        and attach your modified cake</a>