Esempio n. 1
0
<?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];
Esempio n. 2
0
<?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();
Esempio n. 3
0
<?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);
Esempio n. 4
0
<?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>";
    ?>
Esempio n. 5
0
<?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>";
    }
}
Esempio n. 6
0
<?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();
Esempio n. 7
0
<?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();
Esempio n. 8
0
 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>";
     }
 }