<?php

/**
 * User: Ivan Pirus
 * Group: B14
 * Date: January 2016
 */
include 'models/select_articles.php';
include 'controller_main_language.php';
include 'con_cookie.php';
DeleteCookieWord('word');
// delete old cookie
UpdateCookieWord('language', 'language_search');
// Update result look language_search
$head_title = $_GET['id'];
UpdateCookieWord($head_title, 'language');
$array_article = GetListArticles($head_title);
ShowListArticles($array_article, $head_title);
echo "<script src='content/controllers/views/views_js/articles.js'></script>";
Example #2
0
    $words = $_GET['key'];
} else {
    die("Nothing is found");
}
if ($words === "") {
    ShowEmpty();
    return;
}
$select_search = SearchSelect($words, 0, 1000);
// get select with db
$array_result = SearchResult($select_search);
//controller get select with db
if ($array_result != false) {
    SaveCookieWord($words, 'word');
    // Save word search in cookie
    UpdateCookieWord('search', 'language_search');
    // Update result look
    //PrepareUpdate($array_result); // update reviews article
    $result = count($array_result);
    // get numbers result search
    DeleteCookieWord('searched');
    SaveCookieWord($result, 'searched');
    ShowNumbers($result);
    // show numbers searched result
    // ShowResult($array_result); // show searched content
    ShowPagination();
} else {
    ShowNumbers(0);
    ShowNoSearch($words);
}
echo "\n    <script type='text/javascript' src='template/js/jquery-1.12.0.js'></script>\n    <script type='text/javascript' src='content/controllers/views/views_js/pagination.js'></script>\n    ";