<?php
////////////////////////////////////////////////////////////////////////
// Breeze Website Builder
// Copyright Silver Dolphin Solutions, LLC, Edward Lemmers, P.E.
// For licensing, see license.txt.
// Created: 6/3/2014
//
	
	include ("check_session.php");
	
	$filter_city = $_REQUEST['filter_city'];
	$show_pending = $_REQUEST['show_pending'];
	
	if ($show_pending == 1)
		$pending_where = " AND location_status = 0";
	else
		$pending_where = "";
		
	
	// City AND Event AND Location
	if ((isset($filter_city)) && ($filter_city != "") && ($filter_city != "-not selected-"))
		$query = "SELECT * FROM " . BWB_TABLE_PREFIX . "locations WHERE city = '$filter_city'$pending_where ORDER BY location_name";
	// Pending any city
	elseif ($show_pending == 1)
		$query = "SELECT * FROM " . BWB_TABLE_PREFIX . "locations WHERE location_status = 0 ORDER BY location_name";
	// No filtering
	else
		$query = "SELECT * FROM " . BWB_TABLE_PREFIX . "locations ORDER BY location_name";
	
	$row_delim = "";
	$col_delim = ":::";
	$result = $bwb_dbh->query($query);
	while($row = $result->fetch(PDO::FETCH_ASSOC))
	{		
		echo $row_delim . $row['location_id'] . $col_delim . addslashes($row["location_name"]) . $col_delim . $row["city"];
		$row_delim = "::::";
	}
?>