public static function sideMenu() { include_once '../model/Mlogin.php'; $user = $_SESSION['mathmlusr']; $id = Mlogin::getId($user); $page = explode("V", $_SERVER['PHP_SELF'])[1]; $my = $collection = $search = ""; switch ($page) { case "my.php": $my = 'style="color:#32475e;border-right:5px solid #e74d3d"'; break; case "collection.php": $collection = 'style="color:#32475e;border-right:5px solid #e74d3d"'; break; case "search.php": $search = 'style="color:#32475e;border-right:5px solid #e74d3d"'; break; default: break; } echo '<div id="sidebar"> <ul> <a href="Vmy.php"><li ' . $my . '>Moji izrazi <img height="22" src="../images/home.png" class="user" /></li></a> <a href="Vcollection.php"><li ' . $collection . '>Kolekcija <img height="22" src="../images/flag.png" class="user" /></li></a>'; if (Wrapper::online()) { echo '<a href="Vsearch.php"><li ' . $search . '>Pretraga <img height="22" src="../images/search.png" class="user" /></li></a>'; } echo '</ul> </div>'; }
public static function form($fid) { include_once '../model/Mwrapper.php'; include_once '../model/Mlogin.php'; include_once '../model/Msearch.php'; $res = Mexpression::getExpression($fid); if ($res['verified'] == 1) { $verified = "<img src='../images/verified.png' style='height:36px;margin-bottom:-5px;' />"; } else { $verified = ""; } $acc = Mlogin::getAccForId($res['accid']); echo "<h5 style='color:#b3b3b3'>" . $acc['username'] . "</h5>"; echo "<h1 style='color:#32475e;'>{$verified}" . $res['name'] . " <span style='color:#b3b3b3;font-size:26px'>[" . $res['popularity'] . "]</span></h1>"; echo "<div class='formula'>`" . $res['formula'] . "`</div>"; echo "<p id='desc'>" . Msearch::filterText($res['description']) . "</p>"; if (Wrapper::online()) { $accid = Mlogin::getId($_SESSION['mathmlusr']); if (Mexpression::mine($accid, $fid) == 1) { echo '<img style="height:22px;margin-right:60px;" src="../images/edit.png" class="user" />'; echo "<a href='../view/Vnew.php?id=" . $res['id'] . "' style='color:#e74d3d;float:right;'>IZMENI</a>"; echo '<img height="22" src="../images/delete.png" class="user" />'; echo "<a href='../script/Sdelete.php?id=" . $res['id'] . "' style='color:#e74d3d;float:right;' onclick='" . 'return confirm("Da li ste sigurni da želite da obrišete ovaj izraz?");' . "'>OBRIŠI</a>"; } else { if (Mexpression::isAdded($accid, $fid) == 1) { $value = "BRIŠI IZ KOLEKCIJE"; } else { $value = "DODAJ U KOLEKCIJU"; } echo "<input type='submit' id='save' value='{$value}' data-fid='{$fid}' />"; } } echo "<span class='heading'>AsciiMath</span>\n <pre><code id='asciimath' disabled='true' class='exp-area'>" . $res['formula'] . "</code></pre>\n\t\t <span class='heading'>LaTeX</span>\n <pre><code id='latex' disabled='true' class='exp-area tex'></code></pre>\n\t\t\t<span class='heading'>Presentation MathML</span>\n <pre><code id='mathml' disabled='true' class='exp-area html'></code></pre>"; echo "<input type='button' id='export' value='Preuzmi izvorni kod' />"; if ($res['content'] != "") { echo "<span class='heading'>Content MathML</span>\n <pre><code disabled='true' class='exp-area html'>" . htmlspecialchars($res['content']) . "</code></pre>"; echo "<span class='heading' id='label' data-curr='mml'>Unesi vrednosti</span>"; echo "<div id='var' style='float:left;width:100%;'>"; Mexpression::getCi($res['content']); echo " <br /><input type='submit' id='compute' data-id='" . $res['id'] . "' value='IZRAČUNAJ' />"; echo "</div>"; echo "<span class='heading' id='result'></span>\n\t\t\t\t <div style='display:none;'>`" . $res['formula'] . "`</div>"; } }
<?php session_start(); include_once "../model/Mwrapper.php"; include_once "../model/Mlogin.php"; include_once "../model/Mhome.php"; include_once "../model/Mregister.php"; include_once "../model/Msearch.php"; //if (!Wrapper::online()) header("Location: ../index.php"); Wrapper::begin(["mathmlf();", "exportm();"]); Wrapper::contentBegin(); if (Wrapper::online()) { Wrapper::sideMenu(); } Wrapper::centerBegin(); Mhome::form(); Wrapper::centerEnd(); if (!Wrapper::online()) { Mregister::form(); Mlogin::form(); Msearch::notOnlineLink(); } Wrapper::contentEnd(); Wrapper::end();
if (Wrapper::online()) { echo "<div class='button-container-title'>Formirani izrazi</div>"; } ?> <div id="buttons-array"> <?php $res = Mbexpression::getForType("Operacije"); foreach ($res as $row) { echo "<abbr title='" . $row['name'] . "'><div class='expression' data-latex='" . $row['formula'] . "' data-pre='" . $row['pre'] . "' data-suf='" . $row['suf'] . "'>`" . $row['desc'] . "`</div></abbr>"; } ?> </div> </div> <span class='heading'>AsciiMath</span> <?php if (Wrapper::online()) { echo "<form action='../script/Sredirect.php' method='post'>"; } ?> <textarea id="tex" class="area-latex" name="tex"></textarea> <?php if (Wrapper::online()) { echo "<input type='submit' value='SAČUVAJ IZRAZ' style='float:left;margin-top:5px;' /></form>"; } ?> <!--span class='heading' id='label' data-curr='mml'>Presentation MathML</span> <pre><code id="area" disabled="true" class='xml'></code></pre> <input type="button" class="mode" id="block" value="MathML - LaTeX" /--> <div id="full-display"> </div> <input type='button' id='mode' value='Preuzmi izvorni kod' />