Пример #1
0
<?php

include_once 'php/config.php';
include_once 'php/basic.php';
include_once 'php/sql.php';
include_once 'php/recipe.php';
include_once 'php/user.php';
$recipes = new Recipe();
$r_data = $recipes->getList(15);
$r_html = render(__DIR__ . "/views/mr_slide.php", ["recipes" => $r_data]);
$fb_url = Config::getFbUrl();
$vk_url = Config::getVkUrl();
$header = render(__DIR__ . "/views/header.php", ["fb_url" => $fb_url, "vk_url" => $vk_url, "user" => User::getInst()->isAuthorized() ? User::getInst()->getUserInfo()["name"] : false]);
$sidebar = render(__DIR__ . "/views/sidebar.php", ["fb_url" => $fb_url, "vk_url" => $vk_url, "user" => User::getInst()->isAuthorized() ? User::getInst()->getUserInfo()["name"] . " " . User::getInst()->getUserInfo()["soname"] : false]);
$footer = render(__DIR__ . "/views/footer.php", []);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

<head>
    <title>FitEat</title>
    <link rel="StyleSheet" type="text/css" href="stylesheets/main.css"/>
    <link rel="StyleSheet" type="text/css" href="stylesheets/datepicker.css"/>
    <script type="text/JavaScript" src="javascript/jquery-2.1.0.js"></script>
    <script type="text/JavaScript" src="javascript/jquery-ui.min.js"></script>
    <script type="text/javascript" src="javascript/datepicker.js"></script>
    <script type="text/javascript" src="javascript/jquery.mask.js"></script>
    <script type="text/JavaScript" src="javascript/jscript.js"></script>
</head>
Пример #2
0
<?php

require_once 'config/config.conf.php';
$type = !empty($_GET['type']) ? intval($_GET['type']) : 0;
$vars = array();
if (!empty($type)) {
    $vars = array('type' => array('=', $type));
}
$recipes = Recipe::getList('*', '', $vars, 'title ASC');
//$recipes = Recipe::select('SELECT * FROM recipe WHERE type = :type ORDER BY title ASC', array('type' => $type));
$count_recipes = count($recipes);
$vars = array('type' => $type, 'recipes' => $recipes, 'count_recipes' => $count_recipes);
Model::displayTemplate('recipes.tpl', $vars);