コード例 #1
0
 public static function delete()
 {
     if (!empty($_GET['id']) && is_numeric($_GET['id']) && $_GET['id'] > 0) {
         $id = $_GET['id'];
         NovicaDB::deleteNovica($id);
         echo "OK";
     } else {
         echo "ERROR";
     }
     //echo ViewHelper::render("view/editor/main-editor.php");
 }
コード例 #2
0
<?php

require_once 'model/IgralecDB.php';
/**
 * Created by PhpStorm.
 * User: Urban
 * Date: 08-Feb-16
 * Time: 10:55 AM
 */
$novice = NovicaDB::getAll();
?>

<script type="text/javascript" src="<?php 
echo JS_URL . "scriptNovicaList.js";
?>
"></script>

<h1>Vse novice</h1>

        <ul id="novicaList">
            <?php 
foreach ($novice as $novica) {
    ?>
                <li>
                    <a href="#" name="detail" value="<?php 
    echo $novica["id"];
    ?>
" > <?php 
    echo $novica["naslov"];
    ?>
 </a>&nbsp;