po/src/subscription.del.php

73 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/common.php";
include_once "include/site.php";
$database = site_prolog(PO_USER_TYPE_CLIENT);
$client_id=pg_escape_string($database, $_REQUEST['client']);
/* Ensure the user owns it !*/
if ($po_user['type'] < PO_USER_TYPE_USER) {
$result = pg_fetch_row(pg_query($database, "select count(identifier) from client where identifier=$client_id and users=$po_user[id]"));
if ($result[0] == 0) {
site_referer_error('not_owner');
site_epilog($database);
exit();
}
}
$result = pg_fetch_row(pg_query($database, " select identifier, users, last_name, first_name, date_of_creation, value from view_client where identifier=$client_id"));
site_header($strings['users_del_subscription']);
site_navigator(8);
site_navigator_status(emit_a(generate_link('user', ''), $strings['generic_users'])." : ".emit_a("my.datebook.php", $strings['generic_my_datebook'])." : ".$strings['users_del_subscription'], "");
print "<form method=\"post\" action=\"client.del.2.php\" accept-charset=\"".$strings['formats_encoding']."\">";
print "<input type=\"hidden\" name=\"client\" value=\"$result[0]\"/>";
print "<table class=\"profile\">\n";
print "<tr class=\"folder_top\">\n";
print "<td colspan=\"3\">".$strings['users_del_subscription']."</td>\n";
print "</tr>\n";
print "<tr>\n";
print "<th width=\"50%\">".$strings['generic_user']."</th>\n";
print "<th width=\"20%\">".$strings['users_date_subscription']."</th>\n";
print "<th width=\"20%\">".$strings['generic_status']."</th>\n";
print "</tr>\n";
print "<tr>\n";
print emit_td(emit_a(generate_link('user', $result[1]), "$result[2], $result[3]"));
print emit_td(emit_date_html($result[4], 'date'));
print emit_td($strings['generic_'.$client_status[$result[5]]]);
print "</tr>\n";
print "</table>\n";
print "<center>";
print $thm_elem['button.confirm.delete'];
print $thm_elem['button.cancel'];
print "</center>";
print "</form>";
site_footer($database);
site_epilog($database);
?>