コード例 #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
ファイル: Fnew.php プロジェクト: prasinar/mathml
<?php

if (isset($_GET['id'])) {
    include_once '../model/Mexpression.php';
    $res = Mexpression::getExpression($_GET['id']);
    echo "<div class='formula' style='margin-top:20px;margin-bottom:20px;'>`" . $res['formula'] . "`</div>";
    ?>
            <form action="../script/Supdate.php" method="post">
                <input type="hidden" style="display: none" value="<?php 
    echo $res['id'];
    ?>
" name='id' />
                Naziv <input type="text" value="<?php 
    echo $res['name'];
    ?>
" name="name" style="width:92%;"/>
                <br /><br />Opis <br /><br /><textarea name="desc" ><?php 
    echo $res['description'];
    ?>
</textarea>
                <br /><br />Content MathML <br /><br /><div id="editor" ></div>
                <textarea name="content" id="contentm" style="display:none;"><?php 
    echo $res['content'];
    ?>
</textarea>
                <br /><br /><input type="submit" value="SAČUVAJ IZRAZ" />
            </form>
        <?php 
} else {
    echo "<div class='formula'>`" . $_SESSION['mathmltex'] . "`</div>";
    ?>