-
Notifications
You must be signed in to change notification settings - Fork 0
/
ViewByCategory.php
163 lines (134 loc) · 5.11 KB
/
ViewByCategory.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<?php
/**
*
* unicode cursor up ↑
* cursor down ↓
*
*/
require_once('credentials.php');
require_once('classes/helper/Dbhelper.php');
require_once ('classes/other/geshi/geshi.php');
require_once('classes/Exploit.php');
require_once('classes/pExploit.php');
require ('classes/Platform.php');
require ('classes/pPlatform.php');
require_once 'classes/Category.php';
require_once 'classes/pCategory.php';
/**Passwörter*/
require_once 'classes/other/phpass-0.3/PasswordHash.php';
require_once 'classes/helper/Login.php';
require_once 'classes/helper/Session.php';
require_once 'classes/helper/Upload.php';
require_once 'classes/helper/Getvars.php';
require_once 'classes/helper/Formgen.php';
require_once 'classes/helper/Navigation.php';
require_once 'classes/helper/Table.php';
require_once 'classes/helper/AntiHitFaker.php';
$dbh=new PDO(DB_DSN, DB_USR, DB_PASS);
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); //@todo das steht nur zum üben hier
define('NUMBERS_PER_SIDE', 15);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>ue-cr3w exploits view by category</title>
<link rel="stylesheet" media="all" href="layout.css">
</head>
<body>
<div id="head">
<h1>
<a href="index.php">ue-cr3w exploits</a>
</h1>
<img src="img/logo.png" alt="logo" />
</div>
<div>
<?php
$sitename=pathinfo(__FILE__);
$sitename=$sitename['basename'];
$f=new Formgen();
$get=new Getvars();
$get->requireVar('view');
$get->assignVar('back');
$get->assignVar('forward');
$get->assignVar('site');
$get->assignVar('type');
/**sortieren ***/
$get->assignVar('order');
$get->assignVar('order_by');
/**sortieren ***/
if($get->validateVars()){
$e= new pExploit();
$e->dbh($dbh);
$n=$e->mysqlCountByCategory($get->view()); //anpassen
//-----lsExploits--------------------------------------------------------------------------------------------------------------------------------------------------------------
$e= new pExploit();
$e->dbh($dbh);
$c=new pCategory();
$c->dbh($dbh);
$c->mysqlSelect($get->view());
/*******order*******************/
$currentVars=array("view"=>$get->view());
$order="asc"; //asc||desc
$orderBy="date"; //order by column field
if ($get->order_by()!="" && $get->order()!=""){
$orderBy=$get->order_by();
$order=$get->order();
}
$get->order()=="asc"?$cursor="↑" : $cursor="↓";
$get->order()=="asc"?$order="desc" : $order="asc";
$values=array( 'hits'=>'hits'
,'platform'=>'platform'
,'autor'=>'author'
,'date' =>'date'
,'verified' =>'V'
);
if ($get->order_by()!=''){
$values[$get->order_by()]=$cursor.' ' . $values[$get->order_by()];
}
$hitlink=$f->getLink($values['hits'], "",array('order_by'=>'hits', 'order'=>$order) + $currentVars);
$platformlink=$f->getLink($values['platform'], "",array('order_by'=>'platform', 'order'=>$order) + $currentVars);
$authorlink=$f->getLink($values['autor'], "",array('order_by'=>'autor', 'order'=>$order) + $currentVars);
$datelink=$f->getLink($values['date'], "",array('order_by'=>'date', 'order'=>$order) + $currentVars);
$verified=$f->getLink($values['verified'], "",array('order_by'=>'verified', 'order'=>$order) + $currentVars);
/***************
* 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());
$verified="✓";
if ($e->verified())
$verified="✖";
echo "<tr class=\"$modulo\"><td>{$e->date()}</td><td>$download</td><td>$verified</td><td>$viewExploit</a></td><td>{$e->hits()}</td><td>$viewByPlatform</td><td>$viewByAuthor</td></tr>\n";
$ctr++;
}//each
echo "</table></div>\n";
//-----lsExploits--------------------------------------------------------------------------------------------------------------------------------------------------------------
?>
<div class="list-navigation">
<?php echo $nav;
}
?>
</div>
</div>
</body>
</html>