コード例 #1
0
ファイル: Scompute.php プロジェクト: prasinar/mathml
<?php

//error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING);
error_reporting(0);
include_once '../model/Mexpression.php';
$id = $_POST['id'];
$jNiz = json_decode($_POST['niz']);
$jNiz = json_decode(json_encode($jNiz), true);
//echo $jNiz["x"];
//print_r($jNiz);
$xml = simplexml_load_string(Mexpression::getContent($id));
$json = json_encode($xml);
$array = json_decode($json, TRUE);
if (key($array) == "apply") {
    $array = $array["apply"];
}
//print_r($array);
function pravi($niz, $op, $jNiz)
{
    //print_r($niz);
    //echo $op;
    switch ($op) {
        case "apply":
            //print_r($niz); echo key($niz);
            $res = pravi($niz, key($niz), $jNiz);
            //echo $res." ";
            return $res;
            break;
        case "ci":
            //echo $jNiz[$niz]." ";
            return $jNiz[$niz];
コード例 #2
0
ファイル: Vcollection.php プロジェクト: prasinar/mathml
<?php

session_start();
include_once "../model/Mwrapper.php";
include_once "../model/Mlogin.php";
include_once "../model/Mexpression.php";
include_once "../model/Mregister.php";
if (!Wrapper::online()) {
    header("Location: ../index.php");
}
Wrapper::begin(["mathmlf();", "add();"]);
Wrapper::contentBegin();
if (Wrapper::online()) {
    Wrapper::sideMenu();
}
Wrapper::centerBegin();
Mexpression::getAll();
Wrapper::centerEnd();
if (!Wrapper::online()) {
    Mregister::form();
    Mlogin::form();
}
Wrapper::contentEnd();
Wrapper::end();
コード例 #3
0
ファイル: Spin.php プロジェクト: prasinar/mathml
<?php

session_start();
include_once "../model/Mexpression.php";
include_once "../model/Mlogin.php";
$accid = Mlogin::getId($_SESSION['mathmlusr']);
$fid = $_POST['id'];
$type = $_POST['type'];
Mexpression::save($accid, $fid, $type);
コード例 #4
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>";
    ?>
コード例 #5
0
ファイル: Sbuttons.php プロジェクト: prasinar/mathml
<?php

session_start();
include_once '../model/Mexpression.php';
include_once '../model/Mbexpression.php';
$type = $_POST['type'];
if ($type == "Formirani izrazi") {
    $res = Mexpression::getAllSaved();
    if ($res != null) {
        foreach ($res as $row) {
            echo "<abbr title='" . $row['name'] . "'><div style='width:auto;height:80px;line-height:80px;' class='expression' data-latex='" . $row['formula'] . "' >`" . $row['formula'] . "`</div></abbr>";
        }
    }
} else {
    $res = Mbexpression::getForType($type);
    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>";
    }
}
コード例 #6
0
ファイル: Vexpression.php プロジェクト: prasinar/mathml
<?php

session_start();
include_once "../model/Mwrapper.php";
include_once "../model/Mlogin.php";
include_once "../model/Mexpression.php";
include_once "../model/Mregister.php";
include_once "../model/Msearch.php";
//if (!Wrapper::online()) header("Location: ../index.php");
$fid = $_GET['id'];
Wrapper::begin(["mathmlf();", "pin();", "compute();", "exportm();"]);
Wrapper::contentBegin();
if (Wrapper::online()) {
    Wrapper::sideMenu();
}
Wrapper::centerBegin();
Mexpression::form($fid);
Wrapper::centerEnd();
if (!Wrapper::online()) {
    Mregister::form();
    Mlogin::form();
    Msearch::notOnlineLink();
}
Wrapper::contentEnd();
Wrapper::end();
コード例 #7
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();
コード例 #8
0
ファイル: Mexpression.php プロジェクト: prasinar/mathml
 public static function getAll()
 {
     include_once '../model/Mmy.php';
     include_once '../model/Mlogin.php';
     $accid = Mlogin::getId($_SESSION['mathmlusr']);
     $res = Mexpression::getAllPinned();
     foreach ($res as $row) {
         if (Mmy::isAdded($accid, $row['id']) == 1) {
             $value = "BRIŠI IZ FORMIRANIH IZRAZA";
         } else {
             $value = "DODAJ U FORMIRANE IZRAZE";
         }
         echo "<div class='side' style='width:auto;height:150px;'>";
         echo "<a href='../view/Vexpression.php?id=" . $row['id'] . "'>" . $row['name'] . "<div class='formula'>`" . $row['formula'] . "`</div></a>";
         echo "<input type='submit' id='" . $row['id'] . "' value='{$value}' class='user' />\n                      </div>";
     }
 }