Файл: Kagao-v3.0/upload/inc/produkt.php
Строк: 82
<?php
class produkt extends db
{
    public function getData()
    {
        $this->pro = $this->query('SELECT * FROM produkte WHERE id = "'.$_GET['id'].'" LIMIT 1');
        while($this->po = $this->fetch_assoc($this->pro)){
            $data[] = $this->po;
        }
        
        return $data;
    }
}
function geoort($plz){
        global $db;
        $m = $db->query('SELECT geo_ort FROM geo WHERE geo_plz = "'.$plz.'" LIMIT 1');
        while($m1 = $db->fetch_assoc($m)){
        return $m1['geo_ort'];    
        }    
    }
function nl2($i){ return nl2br($i); }
function htmlspecial($i){ return htmlspecialchars_decode($i); }
function htmlspecial1($i){ return htmlspecialchars_decode(substr($i,0,50)) . '...'; }
function ifmarke($o)
{
    global $db;
    $t = $db->query('SELECT id FROM kategorie_under1 WHERE bigid = "'.$o.'"');
    $m = $db->fetch_row($t);
    
    if(empty($m[0])){ return false; }else{ return true; }
}
function ago($time)
{
        $time_difference = time() - $time ; 
        $seconds = $time_difference ; 
        $minutes = round($time_difference / 60 );
        $hours   = round($time_difference / 3600 ); 
        $days    = round($time_difference / 86400 ); 
        $weeks   = round($time_difference / 604800 ); 
        $months  = round($time_difference / 2419200 ); 
        $years   = round($time_difference / 29030400 ); 
             if($seconds <= 60){     return "vor ".$seconds." Sekunden"; }
        else if($minutes <= 60){
                 if($minutes==1){     return "vor 1 Minute";                 }
                   else{                 return "vor ".$minutes." Minuten";     } }
        else if($hours <= 24){
                 if($hours==1){         return "vor etwa einer Stunde";        }
                else{                 return "vor ".$hours." Stunden";     } }
        else if($days <= 7){
                if($days==1){         return "gestern";                     }
                else{                 return "vor ".$days." Tage";         } }
        else if($weeks <=4){
                if($weeks==1){        return "letzte Woche";                }
                else{                 return "vor ".$weeks." Wochen";     } }
        else if($months <=12){
                if($months==1){     return "letzten Monat";             }
                else{                 return "vor ".$months." Monate";     } }
        else{
                if($years==1){        return    "letztes Jahr";                }
                else{                 return    "vor ".$years." Jahre";        } }
}
function timeline($time)
{
    $time = date('d.m.Y', $time);
    return $time;
}
?>