/
myhist.php
130 lines (118 loc) · 3.75 KB
/
myhist.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
<?php
include "glob_func.php";
if ((isset($_GET['mypass']))&&($_GET['mypass']=='february'))
{
$str = getDateSections();
if (isset($_GET['date']))
{
$str .= getListOfBuyClicks($_GET['date']);
}
echo pageHeader().$str.getOtherAdmins().pageFooter();
}
else
{
echo "404 Page not found";
}
function getDateSections()
{
global $mycatid;
$lnk = dbConnect('localhost','root','lyntik');
$query = "SELECT DISTINCT date as sdate FROM buylog WHERE mycat_id=$mycatid";
$res = exec_query($query);
$str="<div class=\"date_sections\">";
$i=0; $j=0;
$str .="<div class=\"date_sections_row\">";
while($rows = fetch_array($res))
{
$j++;
$str.="<a href=\"myhist.php?mypass=february&date=".$rows['sdate']."\">".$rows['sdate']."</a>";
$i++;
if ($i>10) {$str .=closeFloat()."</div><div class=\"date_sections_row\">"; $i=0;}
}
$str .=closeFloat()."</div>";
if ($j==0)
{
$str .="Íà êíîïêó êóïèòü íèêòî íå íàæèìàë";
}
$str .= "</div>";
mysql_free_result($res);
dbDisconnect($lnk);
return $str;
}
function getListOfBuyClicks($dt)
{
global $mycatid;
$str="";
$lnk = dbConnect('localhost','root','lyntik');
$query = "SELECT b.fdate as fdate,b.ip as cip,b.goodid as gid,b.name as sname,b.source as src,b.price as price FROM buylog b WHERE b.date='$dt' AND b.mycat_id=$mycatid ORDER BY b.ip,b.fdate";
$res = exec_query($query);
$ip = "0.0.0.0"; $i=0;
$str .="<div class=\"all_clicks\">";
$str .="<div class=\"click_row_title\">
<div class=\"left click_date title\">Äàòà</div>
<div class=\"left click_id title\">ID òîâàðà</div>
<div class=\"left click_name title\">Íàèìåíîâàíèå</div>
<div class=\"left click_id title\">Öåíà</div>
<div class=\"left click_name title\">Èñòî÷íèê</div>
".closeFloat()."
</div>";
if (mysql_num_rows($res)==0)
{
$str .="<div>Çà âûáðàííóþ äàòó íàæàòèé íå áûëî</div>";
}
else
{
while ($rows = fetch_array($res))
{
if ($ip!=$rows['cip'])
{
$ip = $rows['cip'];
if ($i!=0)
{
$str .="</div>";
}
$str .="<div class=\"ipclicks\">";
$str .="<div class=\"client_ip\">Êëèêè ñ àäðåñà:<b>".$rows['cip']."</b></div>";
}
$str .="<div class=\"click_row\">
<div class=\"left click_date\">".$rows['fdate']."</div>
<div class=\"left click_id\">".$rows['gid']."</div>
<div class=\"left click_name\">".$rows['sname']."</div>
<div class=\"left click_id\">".$rows['price']."</div>
<div class=\"left click_name\">".$rows['src']."</div>
".closeFloat()."
</div>";
}
$str .="</div>";
}
$str .="</div></div>";
mysql_free_result($res);
dbDisconnect($lnk);
return $str;
}
function getOtherAdmins()
{
$str = "<div class=\"other_admins\">
<div><a href=\"http://smesharicki.ru/myhist.php?mypass=february\">Ñìåøàðèêè</a></div>
<div><a href=\"http://lyntik.ru/myhist.php?mypass=february\">Ëóíòèê</a></div>
</div>";
return $str;
}
function pageHeader()
{
//<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">
$str = "
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
<html>\n\n<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1251\">\n
<link rel=\"shortcut icon\" href=\"favicon.ico\">
<link href=\"myhist.css\" rel=\"stylesheet\" type=\"text/css\">
<title>Àäìèíêà</title>\n</head>\n<body>\n";
return $str;
}
function pageFooter()
{
$str = "<div align=\"center\">Èíòåðíåò-ìàãàçèí ó÷åáíèêîâ è íàó÷íîé ëèòåðàòóðû</div>
</body></html>";
return $str;
}
?>