Файл: test.otwap.aux.su/pages/awithdrow.php
Строк: 30
<?
if ($_POST['pay']) {
$id = $_POST['id'];
if (($n = count($id)) > 0) {
$id = array_values($id);
for ($i = 0; $i < $n; $i++) {
$query = "SELECT u.id, u.wmz, w.cash FROM user u, withdrow w WHERE w.id = $id[$i] AND w.id_user = u.id";
$set = select($query);
$row = mysql_fetch_row($set);
$query = "INSERT INTO `history_account` VALUES('','$row[0]','$row[1]','$row[2]','0',NOW())";
insert($query);
$query = "DELETE FROM `withdrow` WHERE `id` = '$id[$i]'";
insert($query);
}
}
}
?>
<form action="" method='post'>
<table border=1>
<tr>
<td>Логин</td>
<td>WMR</td>
<td>Сумма</td>
<td>кипер</td>
<td>Выплачено</td>
</tr>
<?
$query = "SELECT u.login, u.wmz, t.cash, t.id FROM withdrow t, user u WHERE u.id = t.id_user";
$set = select ($query);
$n = 0;
while ($row = mysql_fetch_row ($set)) {
echo "<tr>";
echo " <td>$row[0]</td>";
echo " <td>$row[1]</td>";
echo " <td>$row[2]</td>";
echo " <td><a href='wmk:payto?Purse=$row[1]&Amount=$row[2]&Desc=Выплата от wmsuper.com. Ваш логин $row[0].&BringToFront=Y'>ОПЛАТИТЬ</a></td>";
echo " <td><input type='Checkbox' name = 'id[$n]' value = '$row[3]'></td>";
echo "</tr>";
$n++;
}
?>
<tr>
<td colspan=4 align="center"><br>
<input type="Hidden" value="true" name="pay">
<input type="Submit" value="Подтвердить" class="window">
</td>
</tr>
</table>
</form>