Пример #1
0
        </div>
        <!-- /.navbar-collapse -->
    </nav>

    <div id="page-wrapper">

        <div class="container-fluid">
            <div class = "row">

                <?php 
if (isset($_GET["id"])) {
    include_once '../php/dedugan.php';
    $pd = connectDB();
    $id = $_GET["id"];
    $table = new DataBase("blog");
    $array = $table->getById($pd, $id);
    foreach ($array as $item) {
        echo "<div class = \"col-md-12 text-center\" ><img src = \"" . $item["imagePath"] . "\" class = \"img-circle\" width=400 height=400><p><h4>{$item["topic"]}</h4></p>\n                        <p class=\"text-justify\">{$item["mes"]}</p></div>";
    }
}
?>

            </div>

            <div id = "comments">

                <div id = "addComment" class = "col-md-12 form-inline">
                    <div class="form-group"> <input type="text" id = "username" placeholder="Ваше имячкофамилия" value=""></div>
                    <div class="form-group"> <input type="text" id = "text" placeholder="Ваш комментарий" value=""></div>
                    <div class="form-group"><button class="btn btn-default" id="comment">Комментировать</button></div>
                </div>
Пример #2
0
<?php

/**
 * Created by PhpStorm.
 * User: StarWind
 * Date: 07.09.2015
 * Time: 14:03
 */
include "dedugan.php";
$pd = connectDB();
$bd = new DataBase("blog");
$bd->updateBlogRecord($_POST["id"], $_POST["title"], $_POST["mes"], $pd);
$output = $bd->getById($pd, $_POST["id"]);
foreach ($output as $item) {
    echo "<a href='details.php?id={$item["id"]}'><img src = \"" . $item["imagePath"] . "\" class = \"img-circle\" width=200 height=200></a><p><h4>{$item["topic"]}</h4></p>\n                        <p class=\"text-justify\">{$item["mes"]}</p>\n                        <button class = \"btn btn-default edit\"  value = \"{$item["id"]}\" >Редактировать</button> <br><br>";
}
Пример #3
0
<?php

/**
 * Created by PhpStorm.
 * User: StarWind
 * Date: 07.09.2015
 * Time: 14:03
 */
include "dedugan.php";
$pd = connectDB();
$id = $_POST["id"];
$bd = new DataBase("blog");
$array = $bd->getById($pd, $id);
echo json_encode($array);