Code: Select all
<?php
/***************************************************************************
* admin_cash_indexpage.php
* -------------------
* begin : Tuesday, Sep 09, 2003
* copyright : (C) 2003 naderman
* email : [email protected]
*
* $Id: admin_cash_indexpage.php,v 1.0.0.0 2003/09/09 14:12:37 naderman $
*
*
***************************************************************************/
/***************************************************************************
*
* copyright (C) 2003 naderman
*
* 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 2
* 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.
*
* http://www.gnu.org/copyleft/gpl.html
*
***************************************************************************/
define('IN_PHPBB', 1);
if( !empty($setmodules) )
{
$file = basename(__FILE__);
$module['Cash Mod']['Cash_Index Page'] = $file;
return;
}
//
// Lets set the root dir for phpBB
//
$phpbb_root_path = '../';
require($phpbb_root_path . 'extension.inc');
require('pagestart.' . $phpEx);
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx);
//
//check for userlevel
//
if( !$userdata['session_logged_in'] )
{
header('Location: ' . append_sid("login.$phpEx?redirect=admin/admin_cash_indexpage.$phpEx", true));
}
if( $userdata['user_level'] != ADMIN )
{
message_die(GENERAL_MESSAGE, $lang['Not_Authorised']);
}
//end check
// CASH ON INDEX
if ($_POST['process'] != 'Submit') {
if ($board_config['cash_richdis'] == 'yes') {
$richdis = 'checked';
$richoff = '';
}
if ($board_config['cash_richdis'] == 'no') {
$richdis = '';
$richoff = 'checked';
}
if ($board_config['cash_userdis'] == 'yes') {
$userdis = 'checked';
$useroff = '';
}
if ($board_config['cash_userdis'] == 'no') {
$userdis = '';
$useroff = 'checked';
}
if ($board_config['cash_preorpost'] == 'prefix') {
$pre = 'checked';
$post = '';
}
if ($board_config['cash_preorpost'] == 'postfix') {
$pre = '';
$post = 'checked';
}
if ($board_config['cash_komma'] == 'komma') {
$kom = 'checked';
$br = '';
}
if ($board_config['cash_komma'] == 'br') {
$kom = '';
$br = 'checked';
}
if ($board_config['cash_pointsorcash'] == 'cash') {
$cash = 'checked';
$points = '';
}
if ($board_config['cash_pointsorcash'] == 'points') {
$cash = '';
$points = 'checked';
}
$overall = '<form method="POST" action="'.append_sid("admin_cash_indexpage.$phpEx").'">
<table width="100%" cellpadding="4" cellspacing="1" border="0">
<tr>
<th width="50%" class="thHead" colspan="2"><center>'.$lang['admin_cash_indexpage_config'].'</center></th>
</tr>
<tr>
<td width="75%" class="row1">'.$lang['admin_cash_indexpage_richdis'].'</td>
<td width="25%" class="row2">'.$lang['Yes'].'<input type="radio" name="R1" value="dis" '.$richdis.'>'.$lang['No'].'<input type="radio" name="R1" value="off" '.$richoff.'></td>
</tr>
<tr>
<td width="75%" class="row1">'.$lang['admin_cash_indexpage_num'].'</td>
<td width="25%" class="row2"><input type="text" name="num" size="20" value="'.$board_config['cash_richnum'].'"></td>
</tr>
<tr>
<td width="75%" class="row1">'.$lang['admin_cash_indexpage_userdis'].'</td>
<td width="25%" class="row2">'.$lang['Yes'].'<input type="radio" name="U1" value="dis" '.$userdis.'>'.$lang['No'].'<input type="radio" name="U1" value="off" '.$useroff.'></td>
</tr>
<tr>
<td width="75%" class="row1">'.$lang['admin_cash_indexpage_preorpost'].'</td>
<td width="25%" class="row2">'.$lang['Yes'].'<input type="radio" name="P1" value="pre" '.$pre.'>'.$lang['No'].'<input type="radio" name="P1" value="post" '.$post.'></td>
</tr>
<tr>
<td width="75%" class="row1">'.$lang['admin_cash_indexpage_komma'].'</td>
<td width="25%" class="row2">,<input type="radio" name="K1" value="kom" '.$kom.'>&br></input><input type="radio" name="K1" value="br" '.$br.'></td>
</tr>
<tr>
<td width="75%" class="row1">'.$lang['admin_cash_indexpage_pointsorcash'].'</td>
<td width="25%" class="row2">Cash Mod<input type="radio" name="C1" value="cash" '.$cash.'>Points System</input><input type="radio" name="C1" value="points" '.$points.'></td>
</tr>
<tr>
<td width="50%" height="18" class="catBottom" colspan="2"><center><input type="Submit" value="'.$lang['Submit'].'" name="process" size="20" class="button"></form></center></td>
</tr>
</table>
';
}
if ($_POST['process'] == 'Submit') {
if ($_POST['R1'] == 'dis') {
$sql = "update " . CONFIG_TABLE . " set config_value='yes' where config_name='cash_richdis'";
if ( !($db->sql_query($sql)) ) { message_die(GENERAL_MESSAGE, 'Fatal Error Updating Cash on Index config<br>'.mysql_error()); }
}
if ($_POST['R1'] == 'off') {
$sql = "update " . CONFIG_TABLE . " set config_value='no' where config_name='cash_richdis'";
if ( !($db->sql_query($sql)) ) { message_die(GENERAL_MESSAGE, 'Fatal Error Updating Cash on Index config<br>'.mysql_error()); }
}
if ($_POST['num'] != NULL) {
$sql = "update " . CONFIG_TABLE . " set config_value='{$_POST['num']}' where config_name='cash_richnum'";
if ( !($db->sql_query($sql)) ) { message_die(GENERAL_MESSAGE, 'Fatal Error Updating Cash on Index config<br>'.mysql_error()); }
}
if ($_POST['U1'] == 'dis') {
$sql = "update " . CONFIG_TABLE . " set config_value='yes' where config_name='cash_userdis'";
if ( !($db->sql_query($sql)) ) { message_die(GENERAL_MESSAGE, 'Fatal Error Updating Cash on Index config<br>'.mysql_error()); }
}
if ($_POST['U1'] == 'off') {
$sql = "update " . CONFIG_TABLE . " set config_value='no' where config_name='cash_userdis'";
if ( !($db->sql_query($sql)) ) { message_die(GENERAL_MESSAGE, 'Fatal Error Updating Cash on Index config<br>'.mysql_error()); }
}
if ($_POST['P1'] == 'pre') {
$sql = "update " . CONFIG_TABLE . " set config_value='prefix' where config_name='cash_preorpost'";
if ( !($db->sql_query($sql)) ) { message_die(GENERAL_MESSAGE, 'Fatal Error Updating Cash on Index config<br>'.mysql_error()); }
}
if ($_POST['P1'] == 'post') {
$sql = "update " . CONFIG_TABLE . " set config_value='postfix' where config_name='cash_preorpost'";
if ( !($db->sql_query($sql)) ) { message_die(GENERAL_MESSAGE, 'Fatal Error Updating Cash on Index config<br>'.mysql_error()); }
}
if ($_POST['K1'] == 'kom') {
$sql = "update " . CONFIG_TABLE . " set config_value='komma' where config_name='cash_komma'";
if ( !($db->sql_query($sql)) ) { message_die(GENERAL_MESSAGE, 'Fatal Error Updating Cash on Index config<br>'.mysql_error()); }
}
if ($_POST['K1'] == 'br') {
$sql = "update " . CONFIG_TABLE . " set config_value='br' where config_name='cash_komma'";
if ( !($db->sql_query($sql)) ) { message_die(GENERAL_MESSAGE, 'Fatal Error Updating Cash on Index config<br>'.mysql_error()); }
}
if ($_POST['C1'] == 'cash') {
$sql = "update " . CONFIG_TABLE . " set config_value='cash' where config_name='cash_pointsorcash'";
if ( !($db->sql_query($sql)) ) { message_die(GENERAL_MESSAGE, 'Fatal Error Updating Cash on Index config<br>'.mysql_error()); }
}
if ($_POST['C1'] == 'points') {
$sql = "update " . CONFIG_TABLE . " set config_value='points' where config_name='cash_pointsorcash'";
if ( !($db->sql_query($sql)) ) { message_die(GENERAL_MESSAGE, 'Fatal Error Updating Cash on Index config<br>'.mysql_error()); }
}
$overall = '
<table width="100%" cellpadding="4" cellspacing="1" border="0">
<tr>
<th width="50%" class="thHead" colspan="2"><center>'.$lang['admin_cash_indexpage_config'].'</center></th>
</tr>
<tr>
<td class="row1" width="100%">'.$lang['admin_updated'].'. | <b><a href="'.append_sid("admin_cash_indexpage.$phpEx").'">'.$lang['admin_return'].'</a></b></td>
</tr>
</table>';
}
// END CASH ON INDEX
$template->assign_vars(array(
'OVERALL' => "$overall",
'TTL' => $lang['cash_indexpage_title'],
'DESCRIPTION' => $lang['admin_cash_indexpage_description'],
));
$template->set_filenames(array(
'body' => 'admin/cash_indexpage_config.tpl')
);
//
// Generate the page
//
$template->pparse('body');
include('page_footer_admin.' . $phpEx);
?>