Repository navigation
Expand file tree
/
Copy pathlistings.php
More file actions
57 lines (45 loc) · 2.12 KB
/
Copy pathlistings.php
File metadata and controls
57 lines (45 loc) · 2.12 KB
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
<?php
include_once("includes/inc.global.php");
$p->site_section = LISTINGS;
if ($_REQUEST["type"]==Offer)
$p->page_title = _("Offered listings");
else
$p->page_title = _("Wanted listings");
include_once("classes/class.listing.php");
include_once("classes/class.geocode.php");
include_once("includes/inc.forms.php");
$form->addElement("hidden","type", $_REQUEST["type"]);
$form->addElement("static", null, _("Select the category and time frame to view and press Continue. Or to view all listings at once, just press Continue. If you would like to print or download the complete directory, click")." <A HREF=directory.php>"._("here")."</A>.", null);
$form->addElement("static", null, null, null);
$category_list = new cCategoryList();
$categories = $category_list->MakeCategoryArray(ACTIVE, substr($_REQUEST["type"],0,1));
$categories[0] = "("._("View All Categories").")";
$form->addElement("select", "category", _("Category")." ", $categories);
$text = _("New/updated in last")." ";
$form->addElement("select", "timeframe", _("Time Frame")." ", array("0"=>"("._("View All Listings").")", "3"=>$text ._("3 days"), "7"=>$text ._("week"), "14"=>$text ._("2 weeks"), "30"=>$text ._("month"), "90"=>$text ._("3 months")));
if (KEYWORD_SEARCH_DIR==true)
$form->addElement("text","keyword",_("Keyword")." ");
$form->addElement("static", null, null, null);
$form->addElement("submit", "btnSubmit", _("Continue"));
//$form->registerRule('verify_selection','function','verify_selection');
//$form->addRule('category', 'Choose a category', 'verify_selection');
if ($form->validate()) { // Form is validated so processes the data
$form->freeze();
$form->process("process_data", false);
} else { // Display the form
$output = $form->toHtml();
$output .= cGeoCode::GenerateMap();
$p->DisplayPage($output);
}
function process_data ($values) {
global $p;
header("location:http://".HTTP_BASE."/listings_found.php?type=".$_REQUEST["type"]."&keyword=".$_REQUEST["keyword"]."&category=".$values["category"]."&timeframe=".$_REQUEST["timeframe"]);
exit;
}
function verify_selection ($z, $selection) {
if($selection == "0")
return false;
else
return true;
}
?>