Deposit $deposit From $account1 to $account2"; */ // On retire la somme de account1 $sql = "INSERT INTO `account` (`id`, `account1`, `account2`, `debit`, `credit`, `description`, timestamp, prestation_id) \r\n VALUES (NULL, '{$account1}', '{$account2}', '{$deposit}', NULL, 'Deposit to {$accountName2}', '{$timeStamp}', '{$prestationId}');"; $result = mysqli_query($mysqli, $sql); // On ajoute la somme à account2 $sql = "INSERT INTO `account` (`id`, `account1`, `account2`, `debit`, `credit`, `description`, timestamp, prestation_id) \r\n VALUES (NULL, '{$account2}', '{$account1}', NULL, '{$deposit}', 'Deposit from {$accountName1}', '{$timeStamp}', '{$prestationId}');"; $result = mysqli_query($mysqli, $sql); // On marque la transaction effectuée dans la place de marché if ($marketPlace == 'WOC') { $sql = "INSERT INTO `market` (`id`, `user_id`,`type`, `titre`, `description`, prestation_id, market_id, timestamp, price) \r\n VALUES (NULL, '{$account1}', 'Payed', '{$titre}', '{$description}', '{$prestationId}', '{$marketId}', '{$timeStamp}', '{$deposit}');"; } else { $sql = "UPDATE market SET type = 'Payed' WHERE id = '{$marketId}'"; } $result = mysqli_query($mysqli, $sql); header("Location: account.php"); die; } openPage("Online Payment"); echo "<h1>Payment</h1>\r\n <p>Le formulaire ci dessous permet de transférer directement une somme sur le compte d'une équipe. À utiliser avec précaution et parcimonie.</p>"; $result = mysqli_query($mysqli, "SELECT id, user_name FROM sk_users WHERE (id != '" . $loggedInUser->user_id . "') AND id NOT IN (SELECT user_id FROM sk_user_permission_matches WHERE permission_id != '1')"); echo "<p>\r\n <form name='deposit' action='" . $_SERVER['PHP_SELF'] . "' method='post'>\r\n <div class='form_settings'>\r\n <span>Destination account:</span><select name='accountTo'>"; while (list($id, $user_name) = mysqli_fetch_row($result)) { echo "<option value='{$id}'>{$user_name}</option>"; } echo "</select>"; echo selectPresta(); echo "<span>Amount:</span> <input type='text' name='deposit'>\r\n <p style='padding-top: 15px'>\r\n <input type='submit' name='ok' value='Deposit' class='submit'>\r\n </div>\r\n </form>"; //echo "<h1>Your account</h1>"; //accountBrowse($loggedInUser->user_id); closePage();
function displayInputForm($type) { echo "<form action='" . $_SERVER['PHP_SELF'] . "' method='post'>\n <div class='form_settings'>"; echo '<p><span>Titre : </span><input type="text" name="titre" value="" /></p> <p><span>Description : </span><textarea rows="8" cols="50" name="description"></textarea></p>' . selectPresta() . "</p><p><span>Prix proposé : </span><input type='text' name='price' value='' /></p>\n <p style='padding-top: 15px'>\n <input type='submit' name='cmd' value='{$type}' class='submit' />\n </div></form></div>"; }