예제 #1
0
// 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 Affero General Public License for more details.
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
// 		http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".
include '../config.php';
include mnminclude . 'html1.php';
$league = new League(1);
$league->read();
if (!empty($globals['nivea_host']) && $_SERVER["HTTP_HOST"] !== $globals['nivea_host']) {
    header('HTTP/1.1 301 Moved Permanently');
    header("Location: http://{$globals['nivea_host']}{$_SERVER['REQUEST_URI']}");
    exit;
}
$globals['league_url'] = $globals['base_url'] . 'nivea/';
/* terms {{{ */
$accepted_terms = NULL;
if ($current_user->user_id > 0) {
    if (!empty($_POST['terms'])) {
        if ($_POST['terms'] == _('Acepto')) {
            $db->query("INSERT INTO league_terms VALUES({$current_user->user_id}, 'nivea')");
        } else {
            header("location: /");
            exit;
예제 #2
0
            $league->store();
        } else {
            if (!$valid) {
                die(_("El token del formulario no es correcto"));
            }
        }
    }
    $_GET['action'] = 'list';
}
do_header(_('Administración de Ligas'));
do_league_tabs();
switch ($_GET['action']) {
    case 'create':
        create_form('league', _('Agregar un equipo'));
        break;
    case 'update':
        $league = new League($_GET['id']);
        if (!$league->read()) {
            die(_("No se puede encontrar la liga"));
        }
        create_form('league', _('Editar una liga'), $league);
        break;
    case 'list':
    default:
        $data['cols'] = array('name' => _('Nombre'));
        $data['rows'] = $db->get_results("SELECT * FROM " . League::TABLE);
        $data['page'] = $globals['league_base_url'] . 'index.php';
        Haanga::Load("league/abm-list.tpl", $data);
}
do_footer();
/* vim:set noet ci pi sts=0 sw=4 ts=4: */