-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathViewClosed.php
326 lines (278 loc) · 10.3 KB
/
ViewClosed.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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
<?php
//Include Common Files @1-5471E0F2
define("RelativePath", ".");
include(RelativePath . "/Common.php");
include(RelativePath . "/Template.php");
include(RelativePath . "/Sorter.php");
include(RelativePath . "/Navigator.php");
//End Include Common Files
$page="Viewing Their Closed Listings";
global $REMOTE_ADDR;
global $now;
$ip=$REMOTE_ADDR;
$timeout = $now["timeout"];
$db1 = new clsDBNetConnect;
$db2 = new clsDBNetConnect;
$db3 = new clsDBNetConnect;
$db4 = new clsDBNetConnect;
$db5 = new clsDBNetConnect;
$times = time();
$SQL1 = "DELETE FROM online WHERE datet < $times";
$SQL2 = "SELECT * FROM online WHERE ip='$ip'";
$SQL3 = "UPDATE online SET datet=$times + $timeout, page='$page', user='" . CCGetUserName() . "' WHERE ip='$ip'";
$SQL4 = "INSERT INTO online (ip, datet, user, page) VALUES ('$ip', $times+$timeout,'". CCGetUserName() . "', '$page')";
$SQL5 = "SELECT * FROM online";
$db1->query($SQL1);
$db2->query($SQL2);
if($db2->next_record()){
$db3->query($SQL3);
} else {
$db4->query($SQL4);
}
$db5->query($SQL5);
$usersonline = $db5->num_rows();
unset($db1);
unset($db2);
unset($db3);
unset($db4);
unset($db5);
unset($SQL);
unset($SQL);
unset($SQL);
unset($SQL);
unset($SQL);
//Include Page implementation @2-503267A8
include("./Headeru.php");
//End Include Page implementation
class clsGriditems { //items class @4-DDF99D24
//Variables @4-3C3379CA
// Public variables
var $ComponentName;
var $Visible; var $Errors;
var $ds; var $PageSize;
var $SorterName = "";
var $SorterDirection = "";
var $PageNumber;
var $CCSEvents = "";
var $CCSEventResult;
// Grid Controls
var $StaticControls; var $RowControls;
var $Sorter_ItemNum;
var $Sorter_title;
var $Sorter_end_reason;
var $Navigator;
//End Variables
//Class_Initialize Event @4-75D8BC40
function clsGriditems()
{
global $FileName;
$this->ComponentName = "items";
$this->Visible = True;
$this->Errors = new clsErrors();
$this->ds = new clsitemsDataSource();
$this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
$this->PageSize = 20;
else
$this->PageSize = intval($this->PageSize);
$this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
$this->SorterName = CCGetParam("itemsOrder", "");
$this->SorterDirection = CCGetParam("itemsDir", "");
$this->ItemNum = new clsControl(ccsLabel, "ItemNum", "ItemNum", ccsInteger, "", CCGetRequestParam("ItemNum", ccsGet));
$this->title = new clsControl(ccsLabel, "title", "title", ccsText, "", CCGetRequestParam("title", ccsGet));
$this->end_reason = new clsControl(ccsLabel, "end_reason", "end_reason", ccsText, "", CCGetRequestParam("end_reason", ccsGet));
$this->Sorter_ItemNum = new clsSorter($this->ComponentName, "Sorter_ItemNum", $FileName);
$this->Sorter_title = new clsSorter($this->ComponentName, "Sorter_title", $FileName);
$this->Sorter_end_reason = new clsSorter($this->ComponentName, "Sorter_end_reason", $FileName);
$this->Navigator = new clsNavigator($this->ComponentName, "Navigator", $FileName, 10, tpCentered);
}
//End Class_Initialize Event
//Initialize Method @4-383CA3E0
function Initialize()
{
if(!$this->Visible) return;
$this->ds->PageSize = $this->PageSize;
$this->ds->SetOrder($this->SorterName, $this->SorterDirection);
$this->ds->AbsolutePage = $this->PageNumber;
}
//End Initialize Method
//Show Method @4-DAC52E63
function Show()
{
global $Tpl;
if(!$this->Visible) return;
$ShownRecords = 0;
$this->ds->Parameters["sesUserID"] = CCGetSession("UserID");
$this->ds->Prepare();
$this->ds->Open();
$GridBlock = "Grid " . $this->ComponentName;
$Tpl->block_path = $GridBlock;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow");
$is_next_record = $this->ds->next_record();
if($is_next_record && $ShownRecords < $this->PageSize)
{
do {
$this->ds->SetValues();
$Tpl->block_path = $GridBlock . "/Row";
$this->ItemNum->SetValue($this->ds->ItemNum->GetValue());
$this->title->SetValue($this->ds->title->GetValue());
$this->end_reason->SetValue($this->ds->end_reason->GetValue());
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow");
include ("./Config/vars.php");
$conn=mysql_connect($dbs["DB_HOST"],$dbs["DB_USER"],$dbs["DB_PASS"]);
$query = "select category from items where ItemNum = " . $this->ds->ItemNum->GetValue();
$result = mysql_db_query($dbs["DB_NAME"],$query,$conn);
$result = mysql_fetch_array($result);
$cat = $result["category"];
$Tpl->SetVar("finalcat",$cat);
$this->ItemNum->Show();
$this->title->Show();
$this->end_reason->Show();
$Tpl->block_path = $GridBlock;
$Tpl->parse("Row", true);
$ShownRecords++;
$is_next_record = $this->ds->next_record();
} while ($is_next_record && $ShownRecords < $this->PageSize);
}
$this->Navigator->TotalPages = $this->ds->PageCount();
$this->Sorter_ItemNum->Show();
$this->Sorter_title->Show();
$this->Sorter_end_reason->Show();
$this->Navigator->Show();
$Tpl->parse("", false);
$Tpl->block_path = "";
}
//End Show Method
} //End items Class @4-FCB6E20C
class clsitemsDataSource extends clsDBNetConnect { //itemsDataSource Class @4-585CFEF7
//Variables @4-32A305AC
var $CCSEvents = "";
var $CCSEventResult;
var $CountSQL;
var $wp;
// Datasource fields
var $ItemNum;
var $title;
var $end_reason;
//End Variables
//Class_Initialize Event @4-1098E3DE
function clsitemsDataSource()
{
$this->Initialize();
$this->ItemNum = new clsField("ItemNum", ccsInteger, "");
$this->title = new clsField("title", ccsText, "");
$this->end_reason = new clsField("end_reason", ccsText, "");
}
//End Class_Initialize Event
//SetOrder Method @4-AFFB4D44
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "itemID";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
array("Sorter_ItemNum" => array("ItemNum", ""),
"Sorter_title" => array("title", ""),
"Sorter_end_reason" => array("end_reason", "")));
}
//End SetOrder Method
//Prepare Method @4-B7F9FA25
function Prepare()
{
$this->wp = new clsSQLParameters();
$this->wp->AddParameter("2", "sesUserID", ccsInteger, "", "", $this->Parameters["sesUserID"], "");
$this->wp->Criterion[1] = "status='2'";
$this->wp->Criterion[2] = $this->wp->Operation(opEqual, "user_id", $this->wp->GetDBValue("2"), $this->ToSQL($this->wp->GetDBValue("2"), ccsInteger));
$this->wp->AssembledWhere = $this->wp->opAND(false, $this->wp->Criterion[1], $this->wp->Criterion[2]);
$this->Where = $this->wp->AssembledWhere;
}
//End Prepare Method
//Open Method @4-368AA817
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect");
$this->CountSQL = "SELECT COUNT(*) " .
"FROM items";
$this->SQL = "SELECT * " .
"FROM items";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect");
$this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
$this->query(CCBuildSQL($this->SQL, $this->Where, $this->Order));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect");
$this->MoveToPage($this->AbsolutePage);
}
//End Open Method
//SetValues Method @4-40026232
function SetValues()
{
$this->ItemNum->SetDBValue($this->f("ItemNum"));
$this->title->SetDBValue($this->f("title"));
$this->end_reason->SetDBValue($this->f("end_reason"));
}
//End SetValues Method
} //End itemsDataSource Class @4-FCB6E20C
//Include Page implementation @3-353B2997
include("./Footer.php");
//End Include Page implementation
//Initialize Page @1-8E01AA2F
// Variables
$FileName = "";
$Redirect = "";
$Tpl = "";
$TemplateFileName = "";
$BlockToParse = "";
$ComponentName = "";
// Events;
$CCSEvents = "";
$CCSEventResult = "";
$FileName = "ViewClosed.php";
$Redirect = "";
$TemplateFileName = "templates/ViewClosed.html";
$BlockToParse = "main";
$PathToRoot = "./";
//End Initialize Page
//Authenticate User @1-7FED0150
CCSecurityRedirect("1;2", "login.php", $FileName, CCGetQueryString("QueryString", ""));
//End Authenticate User
//Initialize Objects @1-0A34E356
// Controls
$Header = new clsHeader();
$Header->BindEvents();
$Header->TemplatePath = "./";
$Header->Initialize();
$items = new clsGriditems();
$Footer = new clsFooter();
$Footer->BindEvents();
$Footer->TemplatePath = "./";
$Footer->Initialize();
$items->Initialize();
$CCSEventResult = CCGetEvent($CCSEvents, "AfterInitialize");
//End Initialize Objects
//Execute Components @1-351F985C
$Header->Operations();
$Footer->Operations();
//End Execute Components
//Go to destination page @1-BEB91355
if($Redirect)
{
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload");
header("Location: " . $Redirect);
exit;
}
//End Go to destination page
//Initialize HTML Template @1-A0111C9D
$CCSEventResult = CCGetEvent($CCSEvents, "OnInitializeView");
$Tpl = new clsTemplate();
include './Lang/lang_class.php';
$Tpl->LoadTemplate(TemplatePath . $TemplateFileName, "main");
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeShow");
//End Initialize HTML Template
//Show Page @1-F9F38336
$Header->Show("Header");
$items->Show();
$Footer->Show("Footer");
$Tpl->PParse("main", false);
//End Show Page
//Unload Page @1-AB7622EF
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload");
unset($Tpl);
//End Unload Page
?>