86 lines
3.4 KiB
PHP
86 lines
3.4 KiB
PHP
<?php
|
|
|
|
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
|
|
// Copyright (C) 2005-2013 Solomon Peachy (pizza@shaftnet.org)
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation; either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with this program; if not, write to the Free Software
|
|
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
include_once "include/config.php";
|
|
include_once "include/profile.php";
|
|
include_once "include/site.php";
|
|
include_once "include/common.php";
|
|
|
|
$database = site_prolog(PO_USER_TYPE_USER);
|
|
|
|
$location_id = pg_escape_string($database, $_REQUEST['item']);
|
|
|
|
if ($po_user['type'] != PO_USER_TYPE_ADMIN) {
|
|
$result = pg_fetch_row(pg_query($database, "select count(identifier) from location where identifier=$location_id and users=$po_user[id]"));
|
|
if ($result[0] == 0) {
|
|
site_referer_error('not_owner');
|
|
site_epilog($database);
|
|
exit();
|
|
}
|
|
}
|
|
|
|
site_header(sprintf($strings['profile_delete'], $strings['generic_location']));
|
|
site_navigator(8);
|
|
|
|
$location = pg_fetch_row(pg_query($database, "select place, city, state, country, latitude, longitude from view_location where identifier='$location_id'"));
|
|
$number_of_references = pg_fetch_row(pg_query($database, "select number_of_location_references($location_id)"));
|
|
|
|
site_navigator_status(emit_a(generate_link('user', ''), $strings['generic_users'])." : ".emit_a("my.profile.php", $strings['generic_my_profile'])." : ".sprintf($strings['profile_delete'], $strings['generic_location']), "");
|
|
|
|
theme_display_navigator_box_top($profile_data['location']['idx'], $profile_data, "100%");
|
|
|
|
print "<form method=\"post\" action=\"location.del.2.php\" accept-charset=\"".$strings['formats_encoding']."\">";
|
|
print "<input type=\"hidden\" name=\"location\" value=\"$location_id\" />";
|
|
print "<table class=\"profile\">\n";
|
|
print "<tr class=\"folder_top\">\n";
|
|
print "<td colspan=\"7\">".sprintf($strings['profile_delete'], $strings['generic_location'])."</td>\n";
|
|
print "<tr>";
|
|
print emit_th($strings['generic_location'], "width=\"30%\"");
|
|
print emit_th($strings['user_city'], "width=\"15%\"");
|
|
print emit_th($strings['user_state'], "width=\"10%\"");
|
|
print emit_th($strings['user_country'], "width=\"10%\"");
|
|
print emit_th($strings['photo_latitude'], "width=\"10%\"");
|
|
print emit_th($strings['photo_longitude'], "width=\"10%\"");
|
|
print emit_th($strings['generic_images_here'], "width=\"15%\"");
|
|
print "</tr>";
|
|
print "<tr>";
|
|
print "<td>$location[0]</td>";
|
|
print "<td>$location[1]</td>\n";
|
|
print "<td>$location[2]</td>\n";
|
|
print "<td>$location[3]</td>";
|
|
print "<td>$location[4]</td>\n";
|
|
print "<td>$location[5]</td>\n";
|
|
print "<td>$number_of_references[0]</td>\n";
|
|
print "</tr>";
|
|
print "</table>";
|
|
|
|
if ($number_of_references[0]==0) {
|
|
print $thm_elem['button.confirm.delete'];
|
|
print $thm_elem['button.cancel'];
|
|
} else {
|
|
print $thm_elem['button.back'];
|
|
}
|
|
print "</form>";
|
|
|
|
theme_display_navigator_box_bottom("100%");
|
|
|
|
site_footer($database);
|
|
site_epilog($database);
|
|
?>
|