public static function getKategoriePN() { $kategorie = MassagesModel::getCategories(); $kat = array(); $i = 1; foreach ($kategorie as $ka) { $kat[$i] = MassagesModel::title2pagename($ka['nazev']); $i++; } return $kat; }
/** * vrati url k masazi */ public static function returnURL($id) { $pdo = Db_Data::getPDO(); $sqlMasaz = "SELECT * FROM masaze WHERE id_masaze = " . $id; $q = $pdo->prepare($sqlMasaz); $q->execute(); $masaz = $q->fetchAll(); $sqlKategorie = "SELECT * FROM kategorie_masazi WHERE id_kategorie = " . $masaz[0]['id_kategorie']; $r = $pdo->prepare($sqlKategorie); $r->execute(); $kategorie = $r->fetchAll(); return MassagesModel::title2pagename($kategorie[0]['nazev']) . '#idMasaze' . $masaz[0]['id_kategorie']; }
/** * Nastavi a vrati smarty promennou. * @return Smarty */ public static function smartyInit() { if (self::$smarty === NULL) { self::$smarty = new Smarty(); //echo "nova smarty"; self::$smarty->setTemplateDir('templates/'); self::$smarty->setCompileDir('models/smarty/c_templates/'); self::$smarty->setConfigDir('models/smarty/smarty_config/'); self::$smarty->setCacheDir('models/smarty/smarty_cache/'); self::$smarty->caching = 0; // self::$smarty->debugging = true; if ($_SERVER['SERVER_NAME'] == 'localhost') { self::$smarty->assign('ROOT', '/tajemstvi_maserny'); } else { self::$smarty->assign('ROOT', ''); } self::$smarty->assign('kategorieMenu', MassagesModel::getCategories()); } return self::$smarty; }
public static function cenik() { $smarty = Utils::smartyInit(); $smarty->assign('active_cenik', true); $smarty->assign('kategorie', MassagesModel::getCategoriesWithMassages()); $smarty->assign('style', 'cenik_style'); $smarty->display('cenik.html'); exit; }