Example #1
0
 *  'pend_delete' -> Waiting page while the user confirms the profile deletion
 *  'pend_delete' -> Waiting page while the user confirms the profile deletion
 */
$domain = 'https://cge.cbs.dtu.dk';
$serviceRoot = "/srv/www/htdocs/services/";
# STANDARD CBS PAGE TEMPLATES, always include this file
include_once '/srv/www/php-lib/cge_std_tools.php';
// Including CGE_std clases and functions
// Load the CGE class (title, meta_tags, banner_path, css_paths, js_paths) '' is default
$CGE = new CGE('Sample Overview', '<base href="' . $domain . '" target="_blank">', '', '/tools_new/client/platform/styles/isolate_manager.css', '/tools_new/client/platform/scripts/isolate_manager.js');
# CGE MENU
# Format is: ServerName, "(Link/Path.html, 'NameOfLink'),(Link/Path.html, 'NameOfLink')"
$CGE->std_header("Sample Overview", "(/tools_new/client/platform/sample/,'Home'),(/services/,'Services'),(/services/cge/index.php,'Batch Upload'),(/services/CGEpipeline-1.0/map.php,'MapViewer')", FALSE);
// Print the Menu
// REQUIRE THE USER TO LOGIN
if ($CGE->user_is_logged_in()) {
    $ACTION = _INPUT("action");
    if ($ACTION == "edit") {
        // SHOW EDITING FORM
        $iid = _INPUT("iid");
        ?>
<!-- START OF CONTENT -->
      <div id='edit'>
         <button onclick="delete_isolate(<?php 
        echo $iid;
        ?>
);location.href=window.location.pathname;">Delete sample</button>
         <h3>Sample files: <span id='files' style='color:grey;'>No files were found!</span></h3>
         <form name='profile'>
            <p>
               <input type='hidden' name='iid'>
Example #2
0
function respond($status, $DATA, $EXIT = false, $template = false, $human = false)
{
    /* Tools Paths */
    //global $CGE;
    $domain = '';
    $toolspath = '/tools_new/client/platform';
    if ($template == true) {
        // Load the CGE Class :: ARGUMENTS=($title, $meta, $banner,$css,$js)
        $CGE = new CGE('CGE Server', '<base href="' . $domain . '">', '/images/cge_buttons/banner.gif', '', '');
        // CGE MENU
        $CGE->std_header("CGE Server", "({$toolspath}/user_settings.php,'User Home'),(/services/,'Services'),({$toolspath}/isolate_manager.php,'Sample Overview'),({$toolspath}/map.php,'Map')");
        // Print the Menu
    }
    if ($human == true) {
        /* PRINTING THE HUMAN RESPONSE */
        // REQUIRE THE USER TO LOGIN
        if (isset($CGE)) {
            if ($CGE->user_is_logged_in()) {
                // Write Message
                echo "<br><table style='margin:auto;'><tr><th>Server&nbsp;Response</th><th>Message</th></tr><tr><td style='text-align:center;'>{$status}</td><td>" . str_replace("\n", "<br>", $DATA['MESSAGE']) . "</td></tr></table>";
            }
        } else {
            echo "<br><table style='margin:auto;'><tr><th>Server&nbsp;Response</th><th>Message</th></tr><tr><td style='text-align:center;'>{$status}</td><td>" . str_replace("\n", "<br>", $DATA['MESSAGE']) . "</td></tr></table>";
        }
    } else {
        /* PRINTING THE XML RESPONSE */
        $xml = new SimpleXMLElement('<XML/>');
        $xml->addChild('STATUS', $status);
        arr2xml($DATA, $xml);
        print $xml->asXML();
    }
    if ($template == true) {
        // TRACK USER TRAFIC
        $CGE->Piwik(14);
        # STANDARD FOOTER
        $CGE->standard_foot("Support", "('Technical problems','CGE Support','cgehelp')");
    }
    if ($EXIT == true) {
        exit;
    }
}