<?php
/*
*----------------------------phpMyBitTorrent V 2.0-----------------------------*
*--- The Ultimate BitTorrent Tracker and BMS (Bittorrent Management System) ---*
*--------------   Created By Antonio Anzivino (aka DJ Echelon)   --------------*
*-------------               http://www.p2pmania.it               -------------*
*------------ Based on the Bit Torrent Protocol made by Bram Cohen ------------*
*-------------              http://www.bittorrent.com             -------------*
*------------------------------------------------------------------------------*
*------------------------------------------------------------------------------*
*--   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.                           --*
*--                                                                          --*
*--   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., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA --*
*--                                                                          --*
*------------------------------------------------------------------------------*
*------              ©2005 phpMyBitTorrent Development Team              ------*
*-----------               http://phpmybittorrent.com               -----------*
*------------------------------------------------------------------------------*
*-----------------   Sunday, September 14, 2008 9:05 PM   ---------------------*
*/
if (!defined('IN_PMBT')) die ("You can't access this file directly");
OpenTable("Casino");
if (isset($_POST['casino']) && $_POST['casino'] == 'config'){
$sql = "SELECT * FROM ".$db_prefix."_casino_config";
$res = $db->sql_query($sql);
while ($arr = $db->sql_fetchrow($res)) {
$name = $arr['name'];
if ($name != 'class_allowed')
$new_data = $_POST[$name];
else
$new_data = $_POST['class_allowed'];
$db->sql_query("UPDATE ".$db_prefix."_casino_config SET value = '$new_data' WHERE name = '$name'");
}
		 OpenSuccTable(_adm_ca_uped);
		 echo _adm_ca_noerr;
		 CloseSuccTable();
		 die();
}
OpenTable(_adm_ca_set);
echo '<form action="admin.php?op=casino_config#casino_config" method=post>';
print("<table width=\"100%\">\n");
$sql = "SELECT * FROM ".$db_prefix."_casino_config";
$res = $db->sql_query($sql);
while ($arr = $db->sql_fetchrow($res))
$arr_config[$arr['name']] = $arr['value'];
if (!$arr_config["enable"])
if ($arr_config["enable"]){
echo _adm_ca_closed;
$class = explode("|", $arr_config['class_allowed']);
$classes_playing = '';
for ($x = 0; $x < count($class); $x++) {
$classes_playing = (!$classes_playing) ? get_user_class_name($class[$x]) : ', ' . get_user_class_name($class[$x]);
print($classes_playing);
}
die;
}
$enable_yes = ($arr_config['enable'] == 1) ? 'checked="checked"' : '';
$enable_no  = ($arr_config['enable'] == 0) ? 'checked="checked"' : '';
///////////////////////Enable/Desable Casino/////////////////////////
print("<tr><td width=50% class=\"tableb\" align=left>"._adm_ca_inabled."</td><td class=\"tableb\" align=left>"._btmodrulesyes." <input class=\"tableb\" type=radio name=enable value=\"1\" $enable_yes /> "._btmodrulesno." <input class=\"tableb\" type=radio name=enable value=\"0\" $enable_no /></td></tr>");
/////////////////////////////////////////////////////////////////////

/////////////////////////Mini Ratio//////////////////////////////////
print("<tr><td width=50% class=\"tableb\" align=left>"._adm_ca_minra."</td><td class=\"tableb\" align=left><input type=text name=ratio_mini value=\"$arr_config[ratio_mini]\" /></td></tr>");
//////////////////////Fin Mini Ratio////////////////////////////////

/////////////////////////Casino Max Trys//////////////////////////////////
print("<tr><td width=50% class=\"tableb\" align=left>"._adm_ca_maxtry_exp."</td><td class=\"tableb\" align=left><input type=text name=maxtrys value=\"$arr_config[maxtrys]\" /></td></tr>");
//////////////////////Fin Mini Ratio////////////////////////////////

/////////////////////////win_amount_on_number//////////////////////////////////
print("<tr><td width=50% class=\"tableb\" align=left>"._adm_ca_winamt_num_exp."</td><td class=\"tableb\" align=left><input type=text name=win_amount_on_number value=\"".$arr_config['win_amount_on_number']."\" /></td></tr>");
//////////////////////////////////////////////////////////////////////////

/////////////////////////win_amount//////////////////////////////////
print("<tr><td width=50% class=\"tableb\" align=left>"._adm_ca_winamt_color_exp."</td><td class=\"tableb\" align=left><input type=text name=win_amount value=\"$arr_config[win_amount]\" /></td></tr>");
//////////////////////////////////////////////////////////////////////////

/////////////////////////maxusrbet//////////////////////////////////
print("<tr><td width=50% class=\"tableb\" align=left>"._adm_ca_max_bets."</td><td class=\"tableb\" align=left><input type=text name=maxusrbet value=\"$arr_config[maxusrbet]\" /></td></tr>");
//////////////////////////////////////////////////////////////////////////

/////////////////////////maxtotbet//////////////////////////////////
print("<tr><td width=50% class=\"tableb\" align=left>"._adm_max_op_bets."</td><td class=\"tableb\" align=left><input type=text name=maxtotbet value=\"$arr_config[maxtotbet]\" /></td></tr>");
//////////////////////////////////////////////////////////////////////////

/////////////////////////Cheat Value//////////////////////////////////
print("<tr><td width=50% class=\"tableb\" align=left>"._adm_ca_cheat_val."</td><td class=\"tableb\" align=left><input type=text name=cheat_value value=\"$arr_config[cheat_value]\" /></td></tr>");
//////////////////////////////////////////////////////////////////////

/////////////////////////cheat_value_max//////////////////////////////////
print("<tr><td width=50% class=\"tableb\" align=left>"._adm_ca_cheat_val_max."</td><td class=\"tableb\" align=left><input type=text name=cheat_value_max value=\"$arr_config[cheat_value_max]\" /></td></tr>");
//////////////////////////////////////////////////////////////////////////

/////////////////////////cheat_breakpoint//////////////////////////////////
print("<tr><td width=50% class=\"tableb\" align=left>"._adm_ca_cheat_bdwn."</td><td class=\"tableb\" align=left><input type=text name=cheat_breakpoint value=\"$arr_config[cheat_breakpoint]\" /></td></tr>");
//////////////////////////////////////////////////////////////////////////

/////////////////////////cheat_ratio_user//////////////////////////////////
print("<tr><td width=50% class=\"tableb\" align=left>"._adm_ca_cheat_ratio."</td><td class=\"tableb\" align=left><input type=text name=cheat_ratio_user value=\"$arr_config[cheat_ratio_user]\" /></td></tr>");
//////////////////////////////////////////////////////////////////////////

/////////////////////////cheat_ratio_global//////////////////////////////////
print("<tr><td width=50% class=\"tableb\" align=left>"._adm_ca_cheat_ratio_glb."</td><td class=\"tableb\" align=left><input type=text name=cheat_ratio_global value=\"$arr_config[cheat_ratio_global]\" /></td></tr>");
//////////////////////////////////////////////////////////////////////////
        echo "<tr><td><p>"._btaccesslevel."</p></td><td><p>";
        echo "<select name=\"class_allowed\">";
        echo "<option "; if ($arr_config["class_allowed"] == "user") echo "selected "; echo "value=\"user\">"._btclassuser."</option>";
        echo "<option "; if ($arr_config["class_allowed"] == "premium") echo "selected "; echo "value=\"premium\">"._btclasspremium."</option>";
        echo "<option "; if ($arr_config["class_allowed"] == "moderator") echo "selected "; echo "value=\"moderator\">"._btclassmoderator."</option>";
        echo "<option "; if ($arr_config["class_allowed"] == "admin") echo "selected "; echo "value=\"admin\">"._btclassadmin."</option>";
        echo "</select>";
        echo "</p></td></tr>";
echo '<tr>
<td class="tableb" colspan="4" align="center">
<input type="hidden" name="casino" value="config"><input type="submit" name="submit" value="Apply Changes">
</td>
</tr>
</table>
</form>';
CloseTable();
include('footer.php');
?>