Файл: public_html/cat1.php
Строк: 138
<?php
/*
* Recreated 26-04-2016
* Kogao Software
*/
error_reporting(E_ALL);
include "inc/rain.tpl.class.php";
require('classes/config.php');
include "inc/db.php";
include "inc/kategorie.php";
include "inc/produkte.php";
include "inc/extra.php";
include "inc/produkt.php";
$db = new db();
/*update->sql*/
if(isset($_GET['suche'])){
$a = htmlspecialchars($_GET['suche']);
if(is_numeric($a)){
$go_ = $e->query('SELECT id FROM produkte WHERE id = "'.intval($a).'"');
$go_1 = $e->fetch_assoc($go_);
if( empty($go_1['id']) ){
}else{
$e->location('itm'. intval($go_1['id']));
die;
}
}
}
//pagenation
function pages($gesamt, $pages, $link)
{
$anhang = '';
$seite = '';
$x = $gesamt - 1;
$y = $pages - 4;
$z = $pages + 4;
for ($i = 1; $i <= $gesamt; $i++)
{
if ($i <= 1 || $i > $x || $i >= $y && $i <= $z)
{
if(empty($_GET['page'])){
if($i == 1){
$seite .= $anhang . '<a href="'.$link.$i.'"><div style="float:left; width:35px;"><div style="float:left; background:#f2f2f2 url(tpl/img/bgr.png); color:#fff; padding:4px 7px; border-radius:3px;" align="center"><b>' . $i . '</b></div></div></a>';
}else{
$seite .= $anhang . '<a href="'.$link.$i.'"><div style="float:left; width:35px;"><div style="float:left; background:#f2f2f2; color:#666; padding:4px 7px; border-radius:3px;" align="center"><b>' . $i . '</b></div></div></a>';
}
}
elseif($i == $_GET['page']){
$seite .= $anhang . '<a href="'.$link.$i.'"><div style="float:left; width:35px;"><div style="float:left; background:#f2f2f2 url(tpl/img/bgr.png); color:#fff; padding:4px 7px; border-radius:3px;" align="center"><b>' . $i . '</b></div></div></a>';
}else{
$seite .= $anhang . '<a href="'.$link.$i.'"><div style="float:left; width:35px;"><div style="float:left; background:#f2f2f2; color:#666; padding:4px 7px; border-radius:3px;" align="center"><b>' . $i . '</b></div></div></a>';
}
$anhang = '';
}
else
{
$anhang = '<div style="float:left; width:35px; padding-top:10px;" align="center">...</div>';
}
}
return $seite;
}
/* u1 */
function getZahlPage($art, $kate){
global $db;
$getRow = $db->query('SELECT id FROM produkte WHERE "'.$kate.'" = "'.mysql_real_escape_string($art).'" AND statuscode = "1"');
$getNow = mysql_num_rows($getRow);
$getEnd = $getNow/20;
return ceil($getEnd);
}
function pagenat(){
$buildLink = array(
"id" => intval($_GET['id']),
"id2" => isset($_GET['id2']) ? intval($_GET['id2']) : '',
"suche" => htmlspecialchars($_GET['suche']),
"sucheWo" => htmlspecialchars($_GET['sucheWo']),
"umkreis" => intval($_GET['umkreis']),
"page" => ""
);
$buildLink = http_build_query($buildLink);
$buildLink = 'cat1.php?' . $buildLink;
if($_GET['id2']){
$pages_num = getZahlPage($_GET['id2'], 'unterkategorie');
}
else{
$pages_num = getZahlPage($_GET['id'], 'kategorie');
}
$page = (isset($_GET['page'])) ? max($_GET['page'], 1) : 1;
$pages = ($pages_num > 1) ? pages($pages_num, $page, $buildLink) : '';
echo $pages;
}
//
function htmlspecial2($i){ $a = strip_tags(substr($i, 0, 100)); $a = str_replace('<', '', $a); $a = str_replace('b>', '', $a); return $a; }
if( $_SESSION['mobile'] == 'on' and module_mobile == 1 ){
raintpl::configure("base_url", null );
raintpl::configure("tpl_dir", "tpl/m/" );
raintpl::configure("cache_dir", "tmp/m/" );
}else{
raintpl::configure("base_url", null );
raintpl::configure("tpl_dir", "tpl/" );
raintpl::configure("cache_dir", "tmp/" );
}
$tpl = new RainTPL;
include "load.php";
$info = array( 'title' => $title,
'copyright' => $copyright,
'page' => 'kate1',
'ifmarke' => ifmarke($_GET['id2']),
'isLogin' => $_SESSION['login'] ? true : false
);
$tpl->assign( $info );
#->Kategorien
$cat = new controller_cate();
$tpl->assign("cats", $cat->getCategory());
#->Produkte
$abo = new produkte();
$tpl->assign("homelastprodukte", $abo->home());
#->zuletzt->Kleinanzeigen
$klein = new extras();
$tpl->assign("letzte", $klein->anzeigen());
$tpl->assign("cat1", $abo->cat1());
$html = $tpl->draw( 'page', $return_string = true );
echo $html;
class str{
function cut($t){
return substr($t, 1, 2 );
}
}
?>