public function mysqlSelect($id=""){ if(!$this->dbh()) return false; if (empty($id)){ $sql="SELECT * FROM cms_cat"; $stmt=$this->dbh->prepare($sql); $stmt->execute(); $categories=array(); foreach($stmt->fetchAll() as $value){ $p = new pCategory(); $p->id($value['id']); $p->name($value['cat']); $p->dbh=$this->dbh(); $categories[$p->id]=$p; } return $categories; } else { $sql="SELECT * FROM cms_cat WHERE id=?"; $stmt=$this->dbh->prepare($sql); $stmt->bindParam(1, $id, PDO::PARAM_INT); $stmt->execute(); $result=$stmt->fetch(PDO::FETCH_ASSOC); $this->id($result['id']); $this->name($result['cat']); } }
/*************** * navigation * **************/ $nav=new Navigation($f); $nav->currentSite($get->site()); $nav->nElements($n); $nav->itemsPerSite(NUMBERS_PER_SIDE); $nav->targetUrl($sitename); $nav->additionalUrlParams(array('view'=>$get->view(), 'order_by' =>$get->order_by(), 'order'=>$get->order())); $exploits=$e->mySqlSelectByCategory($get->view(),$nav->mysqlStart(), $nav->itemsPerSite(),$orderBy,$order); //anpassen /*******order*******************/ $viewByCategory=$f->getLink($c->name(), $sitename, array("view"=> $c->id())); echo "<div class=\"exploit-category\">\n"; echo "<h4 class=\"category-title\">$viewByCategory</h4><table class=\"exploit-table\">\n"; echo "<tr><th>$datelink</th><th>DL</th><th>$verified</th><th>Description</th><th>$hitlink</th><th>$platformlink</th><th>$authorlink</th></tr>"; $ctr=0; foreach ($exploits as $e){ $ctr%2==0 ? $modulo="table-gerade" : $modulo="table-ungerade"; $viewExploit=$f->getLink($e->title(), "ViewExploit.php", array("view"=> $e->id())); $viewByAuthor=$f->getLink($e->autor(), "ViewByAuthor.php", array("view"=>1)); $viewByPlatform=$f->getLink($e->loadPlatform(), "ViewByPlatform.php", array("view"=>$e->platform())); $download=""; if ($e->file()!='') $download=$f->getLink('⎘', $e->file());
public function loadCategory(){ if ($this->dbh){ $c=new pCategory(); $c->dbh($this->dbh()); $c->mysqlSelect($this->category()); return $c->name(); } }
<!-- aus jeder kategorie 7-8 ausgeben. div drum, werte in table --> <?php $c=new pCategory(); $c->dbh($dbh); $categories=$c->mysqlSelect(); foreach ($categories as $c){ //-----lsExploits-------------------------------------------------------------------------------------------------------------------------------------------------------------- $f=new Formgen(); $e= new pExploit(); $e->dbh($dbh); $exploits=$e->mySqlSelectByCategory($c->id(),0, 8); $viewByCategory=$f->getLink($c->name(), "ViewByCategory.php", array("view"=> $c->id())); echo "<div class=\"exploit-category\">\n"; echo "<h4 class=\"category-title\">$viewByCategory</h4><table>\n"; echo "<tr><th>Date</th><th>DL</th><th>V</th><th>Description</th><th>DL's</th><th>Platform</th><th>Author</th></tr>"; $ctr=0; foreach ($exploits as $e){ $ctr%2==0 ? $modulo="table-gerade" : $modulo="table-ungerade"; $viewExploit=$f->getLink($e->title(), "ViewExploit.php", array("view"=> $e->id())); $viewByAuthor=$f->getLink($e->autor(), "ViewByAuthor.php", array("view"=>1)); $viewByPlatform=$f->getLink($e->loadPlatform(), "ViewByPlatform.php", array("view"=>$e->platform())); $download=""; if ($e->file()!='')