public static function form($word) { echo '<input id="search" value="' . $word . '" type="text" placeholder="Unesi kriterijum" />'; echo '<div id="search-result">'; $res = Msearch::getExpressions($word); foreach ($res as $row) { echo "<a href='../view/Vexpression.php?id=" . $row['id'] . "' class='side' style='width:90%;color:#32475e'>\n <div style='float:right;margin-bottom:-50px;margin-right:5px;font-size:36px;'>" . $row['popularity']; if ($row['verified'] == 1) { echo "<img src='../images/verified.png' height='24' />"; } echo "</div>"; if ($row['content'] != "") { echo "<img src='../images/compute.png' height='24' />"; } echo "<h4>" . $row['name'] . "</h4>" . "<div class='formula'>`" . $row['formula'] . "`</div>" . "<p>" . substr($row['description'], 0, 200) . " ...</p>" . "</a>"; } echo '</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();
<?php include_once '../model/Msearch.php'; $word = $_POST['word']; $res = Msearch::getExpressions($word); foreach ($res as $row) { echo "<a href='../view/Vexpression.php?id=" . $row['id'] . "' class='side' style='width:90%;color:#32475e'>\n <div style='float:right;margin-bottom:-50px;margin-right:5px;font-size:36px;'>" . $row['popularity']; if ($row['verified'] == 1) { echo "<img src='../images/verified.png' height='24' />"; } echo "</div>"; if ($row['content'] != "") { echo "<img src='../images/compute.png' height='24' />"; } echo "<h4>" . $row['name'] . "</h4>" . "<div class='formula'>`" . $row['formula'] . "`</div>" . "<p>" . substr($row['description'], 0, 200) . " ...</p>" . "</a>"; }