header("Content-Type: text/html"); if (isset($_GET)) { $errMsgs = array(); $email = ""; if (isset($_GET['email']) && trim($_GET['email'], " ") != "") { if (filter_var($_GET['email'], FILTER_VALIDATE_EMAIL) !== false) { $email = $_GET['email']; } else { array_push($errMsgs, "Invalid Email Address"); } } else { array_push($errMsgs, "Email Address Empty"); } if (count($errMsgs) <= 0) { $result = getUserInfo($email, $errMsgs); if ($result['success']) { showHtml($result); } else { generateErrorHtml($errMsgs); showResultHtml("Error", generateErrorHtml($errMsgs), true); } } else { showResultHtml("Error", generateErrorHtml($errMsgs), true); } } function showHtml($userInfo) { $test = getTreeArray(generateTreeJson($userInfo)); $html = "<head><title>View - Big Yaad Tree</title><meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1'><link rel=\"stylesheet\" href=\"css/reset.css\"><link rel=\"shortcut icon\" href=\"img/favicon.ico\" type=\"image/x-icon\">\n <link rel=\"icon\" href=\"img/favicon.ico\" type=\"image/x-icon\"><script src=\"js/go.js\"></script><script id='code' src='js/tree.js'></script>\n <link rel='stylesheet prefetch' href='css/font-awesome.min.css'><link rel=\"stylesheet\" href=\"css/style.css\"><link rel=\"stylesheet\" href=\"css/animate.css\"></head><header>\n <div class=\"animated fadeIn\">\n <div class=\"nav\">\n <ul>\n <li class=\"logo\"><img class=\"animated lightSpeedIn\" src=\"img/logo.png\" style='height: 40px'></li>\n <li class=\"home\"><a href=\"index.php\">HOME</a></li>\n <li class=\"searchMenu\"><a class=\"active\" href=\"search.php\">SEARCH</a></li>\n </ul>\n </div></div>" . "<body onload=init('" . $test . "');>" . userDetailsHtml($userInfo) . "<div id=\"myDiagram\"></div>" . "</body>"; echo $html; }
<?php session_start(); /** * Created by PhpStorm. * User: TipsyCoder * Date: 11/1/15 * Time: 11:19 AM */ require_once 'super_data.php'; if (!isset($_SESSION['user'])) { header("Location:../../index.php"); } showHtml(); function showHtml() { $errMsgs = []; $html = "\n <head><title>Big Yaad Tree</title><meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1'><script src=\"../../js/go.js\"></script><script id='code' src='../../js/tree.js'></script>" . "<link rel=\"stylesheet\" href=\"../../css/reset.css\"><link rel=\"shortcut icon\" href=\"../../img/favicon.ico\" type=\"image/x-icon\">" . "<link rel=\"icon\" href=\"../../img/favicon.ico\" type=\"image/x-icon\"><script src='../../js/sweetalert.min.js'></script><script src='../../js/jquery-2.1.4.min.js'></script><script src='../../js/index.js'></script>" . "<link rel='stylesheet prefetch' href='../../css/font-awesome.min.css'><link rel='stylesheet' href='../../css/sweetalert.css'><link rel=\"stylesheet\" href=\"../../css/style.css\"><link rel=\"stylesheet\" href=\"../../css/animate.css\"></head>\n <div class=\"animated slideInDown\">\n <div class=\"nav\">\n <ul>\n <li class=\"logo\"><img class='animated infinite pulse' src=\"../../img/logo.png\"></li>\n <li class=\"home\"><a href=\"super.php\">REMOVE USER</a></li>\n <li class=\"searchMenu\"><a href=\"removeRelation.php\">REMOVE RELATIONSHIP</a></li>\n <li class=\"childMenu\"><a class=\"active\" href=\"changePassword.php\">CHANGE PASSWORD</a></li>\n <li class=\"logout\"><a href=\"../../index.php\">LOGOUT</a></li>\n </ul>\n </div></div>" . "<body><div class=\"panel\" style='max-width: 580px;'>"; if (!isset($_GET) || strtoupper($_GET['by']) !== "FNAME" && strtoupper($_GET['by']) !== 'LNAME') { $_GET['by'] = 'FNAME'; $nextSortBy = 'FNAME'; } else { if (strtoupper($_GET['by']) === "LNAME") { $nextSortBy = "LNAME"; } else { $nextSortBy = "FNAME"; } } if (!isset($_GET) || strtoupper($_GET['sort']) !== "ASC" && strtoupper($_GET['sort']) !== 'DESC') { $_GET['sort'] = 'DESC'; $nextSort = "ASC";
$stuff .= $path . ' => ' . $testdoc->xmd_value($path) . "\n"; } showDoc('Values of: @identifier, metadata/schema, ... (see below)', $stuff); function showHtml($path) { global $testdoc; echo '<h4>Html-value of ', htmlspecialchars($path), '</h4><pre>', $testdoc->xmd_html_value($path), '</pre>'; } showHtml('/*/organizations/organization/item[1]/title'); showHtml('organizations/organization/item/title'); showHtml('organizations/organization/item/title *'); showHtml('Titles: -% organizations/organization/item/titl , %- .'); // if no elements are found, prefix and postfix are not generated showHtml('Titles: -% organizations/organization/item/title , %- .'); showHtml('<ul><li> -% resources/resource/file/../@identifier </li><li> %- </li></ul>'); showHtml('metadata/lom/general/description/langstring'); echo '<h5>The same, but in a HTML construct:</h5>', $testdoc->xmd_html_value('metadata/lom/general/description/langstring'); function getmicrotime() { list($usec, $sec) = explode(" ", microtime()); return (double) $usec + (double) $sec; } $xmlFile = 'imsmanifest_reload.xml'; $presXmlFileContents = @file_get_contents_n($xmlFile) or die('XML file ' . htmlspecialchars($xmlFile) . ' is missing...'); $presXmlFileContents = explode("\n", $presXmlFileContents); $seconds = getmicrotime(); $testdoc2 = new xmddoc($presXmlFileContents); $seconds = getmicrotime() - $seconds; showDoc('Time to parse', $seconds); $seconds = getmicrotime(); $testdoc2->xmd_cache();