<?PHP require('checkcookie.php');
if(isset($_POST["wm"])) {
$wm = intval($_POST["wm"]);
$qw = intval($_POST["qw"]);
$ym = intval($_POST["ym"]);
$lp = intval($_POST["lp"]);
$pm = intval($_POST["pm"]);
$py = intval($_POST["py"]);
$x2 = intval($_POST["x2"]);
mysql_query("UPDATE `b_config` SET `price`='$wm' WHERE `name`='wm_out'") or die(mysql_error());
mysql_query("UPDATE `b_config` SET `price`='$qw' WHERE `name`='qw_out'") or die(mysql_error());
mysql_query("UPDATE `b_config` SET `price`='$ym' WHERE `name`='ym_out'") or die(mysql_error());
mysql_query("UPDATE `b_config` SET `price`='$lp' WHERE `name`='lp_out'") or die(mysql_error());
mysql_query("UPDATE `b_config` SET `price`='$pm' WHERE `name`='pm_out'") or die(mysql_error());
mysql_query("UPDATE `b_config` SET `price`='$py' WHERE `name`='py_out'") or die(mysql_error());
mysql_query("UPDATE `tb_site` SET `x2`='$x2' WHERE `id`='1'") or die(mysql_error());
$result_upd = "<b style='color:#6EAD2B;'>Сохранено </b>";
}

$wm_value = mysql_result(mysql_query("SELECT `price` FROM `b_config` WHERE `name`='wm_out'"),0,0);
$qw_value = mysql_result(mysql_query("SELECT `price` FROM `b_config` WHERE `name`='qw_out'"),0,0);
$ym_value = mysql_result(mysql_query("SELECT `price` FROM `b_config` WHERE `name`='ym_out'"),0,0);
$lp_value = mysql_result(mysql_query("SELECT `price` FROM `b_config` WHERE `name`='lp_out'"),0,0);
$pm_value = mysql_result(mysql_query("SELECT `price` FROM `b_config` WHERE `name`='pm_out'"),0,0);
$py_value = mysql_result(mysql_query("SELECT `price` FROM `b_config` WHERE `name`='py_out'"),0,0);
$x2 = mysql_result(mysql_query("SELECT `x2` FROM `tb_site` WHERE `id`='1'"),0,0);
?>
<h3>Включение и отключение платежных систем на вывод денег</h3>
<form method="post" action="adminmain.php?p=payment_out" id="MainForm">
<table class="adn">
<tr class="lineb">
<td align="left">Значение</td>
<td align="left"><table class="adn"><tr><td align="left" style="border: none; padding: 0">Описание</td><td align="right" style="border: none; padding: 0"><? if(isset($result_upd)) echo $result_upd;?><a href="#" onclick="document.getElementById('MainForm').submit(); return false" class="liv">Сохранить</a></td></tr></table></td>
</tr>
<tr class="liney">
 <td class="listsl" width="120px"><b>WebMoney</b></td>
 <td class="listsl"><input type="radio" name="wm" value="1" <? if($wm_value == 1) echo "checked";?>> Вкл<br><input type="radio" name="wm" value="0"<? if($wm_value == 0) echo "checked";?>>Откл</td>
</tr>
<tr class="liney">
 <td class="settab"><div align="left"><b>Автовыплаты WM</b></td>
 <td class="listsl"><input type=radio name='x2' value='1' <?if($x2==1) {?>checked<?}?>> Вкл<br><input type=radio name='x2' value='0' <?if($x2==0) {?>checked<?}?>> Откл</td>
</tr>
<tr class="liney ell">
 <td class="listsl"><b>QiWi</b></td>
 <td class="listsl"><input type="radio" name="qw" value="1" <? if($qw_value == 1) echo "checked";?>> Вкл<br><input type="radio" name="qw" value="0"<? if($qw_value == 0) echo "checked";?>>Откл</td>
</tr>
<tr class="liney">
 <td class="listsl"><b>YandexMoney</b></td>
 <td class="listsl"><input type="radio" name="ym" value="1" <? if($ym_value == 1) echo "checked";?>> Вкл<br><input type="radio" name="ym" value="0"<? if($ym_value == 0) echo "checked";?>>Откл</td>
</tr>
<tr class="liney ell">
 <td class="listsl"><b>LiqPay</b></td>
 <td class="listsl"><input type="radio" name="lp" value="1" <? if($lp_value == 1) echo "checked";?>> Вкл<br><input type="radio" name="lp" value="0"<? if($lp_value == 0) echo "checked";?>>Откл</td>
</tr>
<tr class="liney">
 <td class="listsl"><b>PerfectMoney</b></td>
 <td class="listsl"><input type="radio" name="pm" value="1" <? if($pm_value == 1) echo "checked";?>> Вкл<br><input type="radio" name="pm" value="0"<? if($pm_value == 0) echo "checked";?>>Откл</td>
</tr>
<tr class="liney ell">
 <td class="listsl"><b>Payeer</b></td>
 <td class="listsl"><input type="radio" name="py" value="1" <? if($py_value == 1) echo "checked";?>> Вкл<br><input type="radio" name="py" value="0"<? if($py_value == 0) echo "checked";?>>Откл</td>
</tr>
</table>
</form>