コード例 #1
0
ファイル: Mexpression.php プロジェクト: prasinar/mathml
 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>";
     }
 }
コード例 #2
0
ファイル: Vnew.php プロジェクト: prasinar/mathml
<?php

session_start();
include_once "../model/Mwrapper.php";
include_once "../model/Mlogin.php";
include_once "../model/Mnew.php";
include_once "../model/Mregister.php";
include_once "../model/Mexpression.php";
if (!Wrapper::online()) {
    header("Location: ../index.php");
}
if (isset($_GET['id'])) {
    if (Mexpression::mine(Mlogin::getId($_SESSION['mathmlusr']), $_GET['id']) != 1) {
        header("Location: ../index.php");
    }
}
Wrapper::begin(["mathmlf();"]);
Wrapper::contentBegin();
if (Wrapper::online()) {
    Wrapper::sideMenu();
}
Wrapper::centerBegin();
Mnew::form();
Wrapper::centerEnd();
if (!Wrapper::online()) {
    Mregister::form();
    Mlogin::form();
}
Wrapper::contentEnd();
Wrapper::end();