po/src/manufacturer.edit.php

68 lines
2.8 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);
$manufacturer_id=pg_escape_string($database, $_REQUEST['item']);
$manufacturer = pg_fetch_row(pg_query($database, "select name, url, last_modifying_users from manufacturer where identifier=$manufacturer_id"));
/* Ensure the user owns it !*/
if (($po_user['id'] != $manufacturer[2]) &&
($po_user['type'] != PO_USER_TYPE_ADMIN)) {
site_epilog($database);
site_push_error($strings['errors_not_owner']);
header("Location: my.profile.php?selector=".$profile_data['manufacturer']['idx']);
exit();
}
site_header(sprintf($strings['profile_edit'], $strings['generic_manufacturer']));
site_navigator(6);
site_navigator_status(emit_a(generate_link('user', ''), $strings['generic_users'])." : ".emit_a("my.profile.php", $strings['generic_my_profile'])." : ".sprintf($strings['profile_edit'], $strings['generic_manufacturer']), "");
theme_display_navigator_box_top($profile_data['manufacturer']['idx'], $profile_data, "100%");
print "<form method=\"post\" action=\"manufacturer.edit.2.php\" accept-charset=\"".$strings['formats_encoding']."\">";
print "<input type=\"hidden\" name=\"manufacturer\" value=\"$manufacturer_id\"/>";
print "<table class=\"profile\">\n";
print "<tr>";
print "<th width=\"35%\">".$strings['generic_name']."</th>\n";
print "<th width=\"65%\">".$strings['user_web']."</th>\n";
print "</tr>";
print "<tr>";
print "<td><input type=\"text\" name=\"manufacturer_name\" value=\"$manufacturer[0]\"/></td>";
print "<td><input type=\"text\" name=\"manufacturer_url\" value=\"$manufacturer[1]\"/></td>";
print "</tr>";
print "</table>";
print $thm_elem['button.save.changes'];
print $thm_elem['button.clear'];
print $thm_elem['button.cancel'];
print "</form>";
theme_display_navigator_box_bottom("100%");
site_footer($database);
site_epilog($database);
?>