示例#1
0
 public function Withdraw($bdd, $user, $address, $total, $coin)
 {
     $address = mysql_real_escape_string($address);
     $total = mysql_real_escape_string($total);
     $user = mysql_real_escape_string($user);
     $isUser = false;
     try {
         $destinationUser = $this->Client->getaccount($address);
         if ($destinationUser != "") {
             $isUser = true;
         }
     } catch (Exception $e) {
         $isUser = false;
     }
     if ($total > 1000000) {
         if ($isUser) {
             $this->Client->move($user, $destinationUser, round($total));
             BaseDonnee::addDeposit($bdd, $destinationUser, round($total), 1, 'No txid', $this->acronymn, 4);
         } else {
             return $this->Client->sendfrom($user, $address, round($total), 4);
         }
     } else {
         if ($isUser) {
             $this->Client->move($user, $destinationUser, (double) sprintf("%.8f", $total));
             BaseDonnee::addDeposit($bdd, $destinationUser, number_format($total, 8, '.', ''), 1, 'No txid', $this->acronymn, 4);
         } else {
             return $this->Client->sendfrom($user, $address, (double) sprintf("%.8f", $total), 4);
         }
     }
 }
示例#2
0
          
        </div> 
        <div class="panel-body">
         <table class="table table-striped table-bordered table-condensed">
           <tr>
            <td > <label> Name</label></td>
            <td >  <label>Acronymn</label> </td>
            <td style="width: 120px;">  <label>Withdrawal Fee</label> </td>
            <td style="width: 200px;">  <label>Tx Fee</label> </td>
            <td style="width: 200px;">  <label>State</label> </td>
          </tr>
          <form action="./verif_admin.php" method = "POST">
            <input type="hidden" name='setWallets' />
            <?php 
$bdd = BaseDonnee::connexion();
$lines = BaseDonnee::getWallets($bdd);
foreach ($lines as $line) {
    echo '<tr ';
    if ($line["disabled"] == "0") {
        echo 'class="success">';
    } else {
        echo 'class="danger">';
    }
    echo "<td> <h5> " . $line["Name"] . "</h5> </td>";
    echo "<td> <h5> " . $line["Acronymn"] . "</h5> </td>";
    echo "<td><input class = 'form-control' name = 'Fee-" . $line["Acronymn"] . "' type = 'text' value = '" . $line["Fee"] . "'/></td>";
    echo "<td><input class = 'form-control' name = 'txFee-" . $line["Acronymn"] . "' type = 'text' value = '" . $line["txFee"] . "'/></td>";
    echo "<td>";
    echo "<select class='form-control' name='disabled-" . $line["Acronymn"] . "'>";
    echo "<option ";
    if ($line["disabled"] == '1') {
示例#3
0
        </html>
        ';
        // Pour envoyer un mail HTML, l'en-tête Content-type doit être défini
        $headers = 'MIME-Version: 1.0' . "\r\n";
        $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
        // En-têtes additionnels
        $headers .= 'To: ' . $username . ' <' . $mail . '>' . "\r\n";
        $headers .= 'From: Crypto-maniac <*****@*****.**>' . "\r\n";
        // Envoi
        mail($mail, $subject, $message, $headers);
        // On créé une balance pour l'user dans chaque currency
        $sql = BaseDonnee::execQuery($bdd, "SELECT * FROM Wallets");
        foreach ($sql as $wallet) {
            $acronymn = $wallet["Acronymn"];
            $walletid = BaseDonnee::execQuery($bdd, "SELECT Id FROM Wallets WHERE Acronymn = '{$acronymn}'")[0]["Id"];
            BaseDonnee::addBalance($bdd, $pseudo, $acronymn, $walletid);
        }
        unset($_SESSION["champs_inscription"]);
        //on détruit les champs qui avaient été save dans $_SESSION
        unset($_SESSION['errors']);
        $_SESSION['just_registered'] = "ok";
        header("Location: ./login.php");
        // redirection vers la page de login
        exit;
    } else {
        $erreurBool = true;
        $erreurs["general"] .= "Database connection error<br/>";
    }
} else {
    //On stock les erreurs dans la variable POST pour les afficher sur la page register.php
    $_SESSION['errors'] = $erreurs;
示例#4
0
       </tr>
     </thead>
     <tbody>



      <?php 
foreach ($tradepairs as $tradepair) {
    $coin1 = strstr($tradepair["Pair"], "/", true);
    $coin2 = substr(strstr($tradepair["Pair"], "/"), 1);
    $apair = $tradepair["Pair"];
    $coinName = BaseDonnee::execQuery($bdd, "SELECT * FROM Wallets WHERE Acronymn='{$coin1}'")[0]["Name"];
    $last = BaseDonnee::execQuery($bdd, "SELECT Price FROM Trade_History WHERE Market='{$apair}' ORDER BY Timestamp DESC LIMIT 1")[0]["Price"];
    $aday = time() - 86400;
    $lastday = BaseDonnee::execQuery($bdd, "SELECT Price FROM Trade_History WHERE Market='{$apair}' AND Timestamp >= '{$aday}' ORDER BY PRICE DESC LIMIT 1");
    $alltrade = BaseDonnee::execQuery($bdd, "SELECT Price, Quantity FROM Trade_History WHERE Market='{$apair}'");
    if (empty($alltrade)) {
        $volume = 0;
    } else {
        $volume = 0;
        foreach ($alltrade as $trade) {
            $volume += floatval($trade["Quantity"]);
        }
    }
    /*
          echo "<tr><td><a href='/users/trades.php?market=".strtolower($coin1."-".$coin2).'\'>';
          echo $coin1."/".$coin2."</a></td><td>".$coinName."</td>";
          echo "<td>".$volume." ".$coin2."</td>";
          echo "<td>".$last."</td>";
          echo "<td>".$lastday[0]["Price"]."</td>";
          echo "<td>".end($lastday)["Price"]."</td></tr>";
        $subject = 'Crypto-maniac - Forgotpass request';
        // message
        $message = '
		<html>
		<head>
		<title>Crypto-maniac - Forgotpass request</title>
		</head>
		<body>
		<h3>Hello ' . $username . '</h3>
		<p> You asked for a new password for your crypto-maniac account </p>
		<p> Please click on this <a href="' . $link . '"> reset link </a> for generate a new password</p>
		</body>
		</html>
		';
        // Pour envoyer un mail HTML, l'en-tête Content-type doit être défini
        $headers = 'MIME-Version: 1.0' . "\r\n";
        $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
        // En-têtes additionnels
        $headers .= 'To: ' . $username . ' <' . $mail . '>' . "\r\n";
        $headers .= 'From: Crypto-maniac <*****@*****.**>' . "\r\n";
        // Envoi
        if (mail($mail, $subject, $message, $headers)) {
            BaseDonnee::editKeyPassword($bdd, $username, $generatedKey);
            $_SESSION["success_forgotpass"] = "******";
        } else {
            $_SESSION["erreur_forgotpass"] = "******";
        }
        header("Location: ./forgotpass.php");
        exit;
    }
}
示例#6
0
    $name = BaseDonnee::execQuery($bdd, "SELECT Name From Wallets WHERE Acronymn = '{$acr}'")[0]["Name"];
    echo '<div class="col-xs-3">
                  <span class="big">' . number_format(floatval($b["Amount"]), 3, '.', '') . '</span>
                  <hr class="separator">
                  <p class="name"><a href="/users/balances.php">' . $name . '</a></p>
                  </div>';
}
echo '</div>';
echo '<div class="row">';
for ($i = 4; $i < 8; $i++) {
    if (empty($topbalance[$i])) {
        continue;
    }
    $b = $topbalance[$i];
    $acr = $b["Coin"];
    $name = BaseDonnee::execQuery($bdd, "SELECT Name From Wallets WHERE Acronymn = '{$acr}'")[0]["Name"];
    echo '<div class="col-xs-3">
                  <span class="big">' . number_format(floatval($b["Amount"]), 3, '.', '') . '</span>
                  <hr class="separator">
                  <p class="name"><a href="/users/balances.php">' . $name . '</a></p>
                  </div>';
}
echo '</div>';
?>
                





              </div>  
示例#7
0
<?php

require_once "../classes/BaseDonnee.class.php";
$bdd = BaseDonnee::connexion();
$username = $_GET["usr"];
$since = time() - 1800;
// Depuis 30 minutes
$res = BaseDonnee::execQuery($bdd, "SELECT * FROM Chat ORDER BY Timestamp DESC LIMIT 20");
echo json_encode($res);
示例#8
0
          
        </div> 
    <div class="panel-body">   
      <p class="descr">Uncheck the trade pairs that you would not like like displayed on the website.</p>
      <form action="./verif_admin.php" method = "post">
        <input type="hidden" name='setPairs' />
         <div class="tablewrap" style="height:float;">
        <table >
          <tr>
            <td><h5><strong> &nbsp;&nbsp;Trade couple</strong></h5> </td>
            <td><h5><strong>&nbsp;&nbsp;Trade Fees (%) </strong></h5></td>
          </tr>
          <?php 
//On genere tous les couples possible de currencies actives
//Il faut aussi desactiver les pairs qui ne sont plus dans la liste "marketActifs".
$sql = BaseDonnee::execQuery($bdd, "SELECT * FROM Markets ORDER BY Pair ASC");
//Si le couple n'est pas dans la base de donnée, on l'ajoute et on le met inactif
$k = 0;
$back = "Lavender";
foreach ($sql as $market) {
    $pair = $market["Pair"];
    echo '<tr style = "background-color:' . $back . '" ';
    echo '><td><label class="checkbox-inline">
            <input type="checkbox" name="' . $pair . '"  value="1"';
    if ($market["disabled"] == '0') {
        echo " checked />";
    } else {
        echo "/>";
    }
    echo "<span>" . $pair . "</span></label></td>";
    echo "<td><input class='form-control' name = fee" . $pair . " type='text' value='" . $market["Fee"] . "'/></td></tr>";
示例#9
0
    <!-- Content start -->
    <div class="page" id="content" role="main">
      <div class="working-contents">
        <div class="page page-index" style="float:left;">
         <br />
         <div class="row">
          <div class="col-xs-6">
            <div class="panel panel-styled panel-default panel-blue">
              <div class="panel-heading"> <span class="glyphicon glyphicon-crypt"></span>Cryptocurrency Exchange</div>
              <div class="panel-body">
                <div class="img-holder"><img src="/img/panelbody1.jpg" alt="Trade Cryptocurrencies"></div>
                <hr class="separator">
                <p>&nbsp;&nbsp;&nbsp;   Trade over <b>
                  <?php 
//pour que le nombre de marcher dispo soit en temps reel
$tradepairs = BaseDonnee::execQuery($bdd, "SELECT * FROM Markets WHERE disabled = '0'");
echo sizeof($tradepairs);
?>
  
                  different types</b> of cryptocurrencies</p>

                </div>              
              </div>
            </div>
            <div class="col-xs-6">
              <div class="panel panel-styled panel-default panel-blue" style="color:408ec6;>
               <div ">
                <div class="panel-heading"> <span class="glyphicon glyphicon-coin"></span>Real-Time Trading</div>
                <div class="panel-body">
                  <div class="img-holder"><img src="/img/panel-2.jpg" alt="Coin Transfers"></div>
                  <hr class="separator">
示例#10
0
                 <hr class="separator">
                 <p class="submit-holder" style="text-align:center;">
                 <input  class="btn btn-default btn-success" type="submit" value="Request a new password"/>
                 </form>  
                 </p>  
                 </div>
                 </div>';
} else {
    //reset
    //verifications
    $usr = mysql_escape_string($_GET["usr"]);
    $key = mysql_escape_string($_GET["key"]);
    $sql = BaseDonnee::execQuery($bdd, "SELECT * FROM Users WHERE LostPasswordRequest = 1 AND Username = '******' AND KeyResetPassword = '******'");
    if (!empty($sql)) {
        $newmdp = generatePassword();
        BaseDonnee::editPassword($bdd, $usr, $newmdp);
        echo '
    <h2> Hi ' . $usr . '</h2>
    <p> Here is your new generated password, please connect and go in your account section for change it now</p>
    <p><strong>' . $newmdp . '</strong></p>';
    } else {
        header("Location: ../index.php");
        // redirection vers la page de login
        exit;
    }
}
?>


</div>
示例#11
0
<?php

//Page accessible seulement par l'administrateur
session_start();
session_regenerate_id();
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/BaseDonnee.class.php";
$bdd = BaseDonnee::connexion();
//Si l'utilisateur qui accède à la page n'a pas le pseudo de l'administrateur dans sa variable session, il voit une page 404.
if ($_SESSION["pseudo"] != "admin") {
    header('HTTP/1.0 404 Not Found');
    exit("<h1>404 Not Found</h1>\nThe page that you have requested could not be found.");
}
BaseDonnee::updateLastTimeSeen($bdd, "admin");
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>
    Crypto Maniac - Add Wallet
  </title>    

  <?php 
include_once $_SERVER['DOCUMENT_ROOT'] . "/includes/header.inc.php";
?>

  <!-- Fixed navbar -->
  <?php 
//Affiche une barre différente si l'user est connecté
if (!isset($_SESSION["pseudo"])) {
    include $_SERVER['DOCUMENT_ROOT'] . "/includes/guest_navbar.inc.php";
示例#12
0
                    if (empty($targetbalance)) {
                        echo "Wallet maintenance, please retry later";
                        die;
                    }
                    $newtargetbalance = $targetbalance + $amount - $fee;
                    BaseDonnee::setBalance($bdd, $target, $coin, $newtargetbalance);
                } else {
                    $feeForAdmin = (double) sprintf("%.8f", $fee - $txfee);
                }
                if ($feeForAdmin > 0) {
                    //Admin informations
                    $adminid = BaseDonnee::execQuery($bdd, "SELECT * FROM Users WHERE Username='******'")[0]["User_ID"];
                    $adminbalance = BaseDonnee::execQuery($bdd, "SELECT * FROM balances WHERE Account='admin' AND Coin = '{$coin}'")[0]["Amount"];
                    $newbalanceadmin = $adminbalance + $feeForAdmin;
                    $wallet->Client->move($username, "admin", $feeForAdmin);
                    BaseDonnee::setBalance($bdd, "admin", $coin, $newbalanceadmin);
                }
                header("Location: /users/winwithdrawal.php");
                exit;
            } catch (Exception $e) {
                $_SESSION["erreurs"]["general"] = $e->getMessage();
            }
        }
    }
}
?>

<head>
	<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css" rel="stylesheet">
	<link href="../css/style.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="../js/jquery-1.10.2.min.js"></script>
示例#13
0
<div class="panel-body">
         <table class="table table-striped table-bordered table-condensed">
           <tbody><tr>
            <td> <label> Name</label></td>
            <td>  <label>Acronymn</label> </td>
            <td style="width: 120px;"><label>Volume</label></td>
            <td style="width: 200px;">  <label>Earning Fee</label> </td>
            <td style="width: 200px;">&nbsp;</td>
          </tr>
          
            <input type="hidden" name="setWallets">
            <tr class="success">
			<td> <h5> Bitcoin</h5> </td><td> <h5> BTC/LTC</h5> </td><td>
			<?php 
//Pierre Test Balance Start
$adminfee = BaseDonnee::execQuery($bdd, "SELECT  Quantity,SUM(Quantity)/ 003 FROM Trade_History WHERE Market = 'BTC/LTC'")[0];
echo ' ' . $adminfee["Amount"] . ' ';
//Pierre Test Balance Start
?>
</td>
				 <td>
			<input type="text" value="0" name="txFee-BTC" class="form-control"></td><td>&nbsp;</td></tr>
			<tr class="success">
			<td> <h5> Litecoin</h5> </td><td> <h5> LTC</h5> </td><td>
			<input type="text" value="0.003" name="Fee-LTC" class="form-control"></td><td>
			<input type="text" value="0" name="txFee-LTC" class="form-control"></td><td>&nbsp;</td></tr>
			<tr class="success"><td> <h5> Dogecoin</h5> </td><td> <h5> DOGE</h5> </td><td><input type="text" value="0.003" name="Fee-DOGE" class="form-control"></td><td><input type="text" value="0" name="txFee-DOGE" class="form-control"></td><td>&nbsp;</td></tr>
			<tr class="success"><td> <h5> 42</h5> </td><td> <h5> 42</h5> </td><td><input type="text" value="0.003" name="Fee-42" class="form-control"></td><td><input type="text" value="0.00000001" name="txFee-42" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Alphacoin</h5> </td><td> <h5> ALF</h5> </td><td><input type="text" value="0.003" name="Fee-ALF" class="form-control"></td><td><input type="text" value="0" name="txFee-ALF" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Americancoin</h5> </td><td> <h5> AMC</h5> </td><td><input type="text" value="0.003" name="Fee-AMC" class="form-control"></td><td><input type="text" value="0" name="txFee-AMC" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Anoncoin</h5> </td><td> <h5> ANC</h5> </td><td><input type="text" value="0.003" name="Fee-ANC" class="form-control"></td><td><input type="text" value="0" name="txFee-ANC" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Argentum</h5> </td><td> <h5> ARG</h5> </td><td><input type="text" value="0.003" name="Fee-ARG" class="form-control"></td><td><input type="text" value="0" name="txFee-ARG" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Auroracoin</h5> </td><td> <h5> AUR</h5> </td><td><input type="text" value="0.003" name="Fee-AUR" class="form-control"></td><td><input type="text" value="0" name="txFee-AUR" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Battlecoin</h5> </td><td> <h5> BCX</h5> </td><td><input type="text" value="0.003" name="Fee-BCX" class="form-control"></td><td><input type="text" value="0.001" name="txFee-BCX" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Betacoin</h5> </td><td> <h5> BET</h5> </td><td><input type="text" value="0.003" name="Fee-BET" class="form-control"></td><td><input type="text" value="0" name="txFee-BET" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Bbqcoin</h5> </td><td> <h5> BQC</h5> </td><td><input type="text" value="0.003" name="Fee-BQC" class="form-control"></td><td><input type="text" value="0" name="txFee-BQC" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Bitbar</h5> </td><td> <h5> BTB</h5> </td><td><input type="text" value="0.003" name="Fee-BTB" class="form-control"></td><td><input type="text" value="0.0001" name="txFee-BTB" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Bytecoin</h5> </td><td> <h5> BTE</h5> </td><td><input type="text" value="0.003" name="Fee-BTE" class="form-control"></td><td><input type="text" value="0" name="txFee-BTE" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Bitgem</h5> </td><td> <h5> BTG</h5> </td><td><input type="text" value="0.003" name="Fee-BTG" class="form-control"></td><td><input type="text" value="0.001" name="txFee-BTG" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Cryptobuck</h5> </td><td> <h5> BUK</h5> </td><td><input type="text" value="0.003" name="Fee-BUK" class="form-control"></td><td><input type="text" value="0.01" name="txFee-BUK" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Cachecoin</h5> </td><td> <h5> CACH</h5> </td><td><input type="text" value="0.003" name="Fee-CACH" class="form-control"></td><td><input type="text" value="0.01" name="txFee-CACH" class="form-control"></td><td>&nbsp;</td></tr><tr class="danger"><td> <h5> Cashcoin</h5> </td><td> <h5> CASH</h5> </td><td><input type="text" value="0.003" name="Fee-CASH" class="form-control"></td><td><input type="text" value="0.001" name="txFee-CASH" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Bottlecaps</h5> </td><td> <h5> CAP</h5> </td><td><input type="text" value="0.003" name="Fee-CAP" class="form-control"></td><td><input type="text" value="0.001" name="txFee-CAP" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Catcoin</h5> </td><td> <h5> CAT</h5> </td><td><input type="text" value="0.003" name="Fee-CAT" class="form-control"></td><td><input type="text" value="0" name="txFee-CAT" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Cryptogenicbullion</h5> </td><td> <h5> CGB</h5> </td><td><input type="text" value="0.003" name="Fee-CGB" class="form-control"></td><td><input type="text" value="0.001" name="txFee-CGB" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Chncoin</h5> </td><td> <h5> CHN</h5> </td><td><input type="text" value="0.003" name="Fee-CHN" class="form-control"></td><td><input type="text" value="0" name="txFee-CHN" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Craftcoin</h5> </td><td> <h5> CRC</h5> </td><td><input type="text" value="0.003" name="Fee-CRC" class="form-control"></td><td><input type="text" value="0" name="txFee-CRC" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Casinocoin</h5> </td><td> <h5> CSC</h5> </td><td><input type="text" value="0.003" name="Fee-CSC" class="form-control"></td><td><input type="text" value="0" name="txFee-CSC" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Emark</h5> </td><td> <h5> DEM</h5> </td><td><input type="text" value="0.003" name="Fee-DEM" class="form-control"></td><td><input type="text" value="0.001" name="txFee-DEM" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Digibyte</h5> </td><td> <h5> DGB</h5> </td><td><input type="text" value="0.003" name="Fee-DGB" class="form-control"></td><td><input type="text" value="0" name="txFee-DGB" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Earthcoin</h5> </td><td> <h5> EAC</h5> </td><td><input type="text" value="0.003" name="Fee-EAC" class="form-control"></td><td><input type="text" value="0" name="txFee-EAC" class="form-control"></td><td>&nbsp;</td></tr><tr class="danger"><td> <h5> Darkcoin</h5> </td><td> <h5> DRK</h5> </td><td><input type="text" value="0.003" name="Fee-DRK" class="form-control"></td><td><input type="text" value="0" name="txFee-DRK" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Diamond</h5> </td><td> <h5> DMD</h5> </td><td><input type="text" value="0.003" name="Fee-DMD" class="form-control"></td><td><input type="text" value="0.001" name="txFee-DMD" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Elacoin</h5> </td><td> <h5> ELC</h5> </td><td><input type="text" value="0.003" name="Fee-ELC" class="form-control"></td><td><input type="text" value="0" name="txFee-ELC" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Emerald</h5> </td><td> <h5> EMD</h5> </td><td><input type="text" value="0.003" name="Fee-EMD" class="form-control"></td><td><input type="text" value="0" name="txFee-EMD" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Ezcoin</h5> </td><td> <h5> EZC</h5> </td><td><input type="text" value="0.003" name="Fee-EZC" class="form-control"></td><td><input type="text" value="0" name="txFee-EZC" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Fireflycoin</h5> </td><td> <h5> FFC</h5> </td><td><input type="text" value="0.003" name="Fee-FFC" class="form-control"></td><td><input type="text" value="0" name="txFee-FFC" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Freicoin</h5> </td><td> <h5> FRC</h5> </td><td><input type="text" value="0.003" name="Fee-FRC" class="form-control"></td><td><input type="text" value="0" name="txFee-FRC" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Franko</h5> </td><td> <h5> FRK</h5> </td><td><input type="text" value="0.003" name="Fee-FRK" class="form-control"></td><td><input type="text" value="0" name="txFee-FRK" class="form-control"></td><td>&nbsp;</td></tr><tr class="danger"><td> <h5> Fastcoin</h5> </td><td> <h5> FST</h5> </td><td><input type="text" value="0.003" name="Fee-FST" class="form-control"></td><td><input type="text" value="0" name="txFee-FST" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Feathercoin</h5> </td><td> <h5> FTC</h5> </td><td><input type="text" value="0.003" name="Fee-FTC" class="form-control"></td><td><input type="text" value="0" name="txFee-FTC" class="form-control"></td><td>&nbsp;</td></tr><tr class="success"><td> <h5> Grandcoin</h5> </td><td> <h5> GDC</h5> </td><td><input type="text" value="0.003" name="Fee-GDC" class="form-control"></td><td><input type="text" value="0" name="txFee-GDC" class="form-control"></td><td>&nbsp;</td></tr>      </tbody></table>
      
    
  </div>
示例#14
0
?>
)</small></th>
             <th><?php 
echo $coin1;
?>
 Traded</th>
             <th>Total <?php 
echo $coin2;
?>
</th>
           </tr>
         </thead>
         <tbody>
          <?php 
$username = $_SESSION["pseudo"];
$tradehistory = BaseDonnee::execQuery($bdd, "SELECT * FROM Trade_History WHERE (Market = '{$pair}' OR Market = '{$reversepair}') AND (Buyer = '{$username}' OR Seller = '{$username}') ORDER BY Timestamp DESC LIMIT 50");
foreach ($tradehistory as $atrade) {
    echo '<tr><td>' . date('Y-m-d H:i:s', $atrade["Timestamp"]) . '</td>';
    echo '<td>' . $atrade["Type"] . '</td>';
    echo '<td>' . number_format($atrade["Price"], 8, '.', '') . '</td>';
    echo '<td>' . number_format($atrade["Quantity"], 8, '.', '') . '</td>';
    $total = number_format(floatval($atrade["Price"] * $atrade["Quantity"]), 8, '.', '');
    echo '<td>' . $total . '</td></tr>';
}
?>
        </tbody>

      </table>

    </div>
示例#15
0
        <div class="panel panel-default panel-trade-list">

          <div class="panel-heading"> 
            <span class="glyphicon glyphicon-account-balances"></span> Your Open Orders 
            &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="skype:crypto-maniac?add"><img style="border:0;" src="/img/skype_icon_01.png" alt="Skype Support " width="51" height="30" align="right" >Skype Support</a>

          </div>

          <div class="tablewrap"  id="market-wrap" style="height:300px; overflow:auto;">
            <form action="./verif_trades.php" method="POST">
              <input type=hidden name="cancelorder"/>
              <input type=hidden name="orderpage"/>
              <?php 
$username = $_SESSION["pseudo"];
$openorders = BaseDonnee::execQuery($bdd, "SELECT * FROM Trades WHERE Username = '******' AND Finished = '0'");
echo '
                <table cellpadding="0" cellspacing="0" border="0" class="table table2 table-striped" id="userorderslist">
                <thead>
                <tr>
                <th>Order Date</th>
                <th>Market</th>
                <th>Type</th>
                <th>Price</th>
                <th>Amount</th>
                <th>Total</th>
                <th>Action</th>
                </tr></thead><tbody>
                ';
foreach ($openorders as $openorder) {
    echo '<tr>';
示例#16
0
        break;
    case "all":
        // depuis le debut
        $since = $currentTime - 1395703990;
        $delta = "43200";
        // 12 heures
        break;
    default:
        $error = true;
        break;
}
$start = $currentTime - $since;
//Selectionne tous les trades effectués depuis "since" dans l'ordre chronologique croissant
$history = BaseDonnee::execQuery($bdd, "SELECT Timestamp, Price, Quantity FROM Trade_History WHERE Market='{$pair}' AND Timestamp >= '{$start}' ORDER BY Timestamp ASC");
if (empty($history)) {
    $history = BaseDonnee::execQuery($bdd, "SELECT Timestamp, Price, Quantity FROM Trade_History WHERE Market='{$pair}' ORDER BY Timestamp DESC LIMIT 1");
    $history[0]["Quantity"] = '0';
}
$data = array();
// à l'aide de delta, création de paquets de trades
$paquetTotal = 0;
$paquetVide = 0;
for ($i = $start; $i <= $currentTime + $delta; $i += $delta) {
    $tmp = array();
    // Pour stocker le paquet de trades
    foreach ($history as $j => $trade) {
        if ($trade["Timestamp"] < $i) {
            $trade["Timestamp"] = $i;
            $tmp[] = $trade;
            unset($history[$j]);
        } else {
示例#17
0
    <div class="moduletable-header"><span class="glyphicon glyphicon-account-balances"></span>' . $market["Acronymn"] . ' Markets</div>
    <div class="account-balances-wrap" id="' . strtolower($market["Acronymn"]) . '-markets">
    <ul class="nav nav-list">
    ';
    foreach ($tradepairs as $key => $tradepair) {
        $coinA = strstr($tradepair["Pair"], "/", true);
        $coinB = substr(strstr($tradepair["Pair"], "/"), 1);
        if ($coinA == $market["Acronymn"] || $coinB == $market["Acronymn"]) {
            if ($coinB == $market["Acronymn"]) {
                echo "<li><a href = '/users/trades.php?market=" . strtolower($coinA) . "-" . strtolower($coinB) . "'>";
                echo $tradepair["Pair"];
            } else {
                echo "<li><a href = '/users/trades.php?market=" . strtolower($coinB) . "-" . strtolower($coinA) . "'>";
                echo $coinB . "/" . $coinA;
            }
            $ipair = $tradepair["Pair"];
            $lasttrade = BaseDonnee::execQuery($bdd, "SELECT Price FROM Trade_History WHERE Market='{$ipair}' ORDER BY Timestamp DESC LIMIT 1")[0]["Price"];
            echo "<span class = 'pull-right glyphicon glyphicon-arrownone'></span>";
            echo '<span class="status pull-right" id="market_price_1">' . number_format($lasttrade, 8, '.', '') . '</span></a></li>';
            unset($tradepairs[$key]);
        }
    }
    echo ' </ul> </div></div><hr class="separator">';
}
?>

 <div class="clearfix"></div>

 </div>

示例#18
0
echo $coin2;
?>
)</small></th>
                 <th><?php 
echo $coin1;
?>
 Traded</th>
                 <th>Total <?php 
echo $coin2;
?>
</th>
               </tr>
             </thead>
             <tbody>
              <?php 
$tradehistory = BaseDonnee::execQuery($bdd, "SELECT * FROM Trade_History WHERE Market = '{$pair}' ORDER BY Timestamp DESC LIMIT 200");
foreach ($tradehistory as $atrade) {
    echo '<tr><td>' . date('Y-m-d H:i:s', $atrade["Timestamp"]) . '</td>';
    echo '<td>' . $atrade["Type"] . '</td>';
    echo '<td>' . number_format(floatval($atrade["Price"]), 8, '.', '') . '</td>';
    echo '<td>' . number_format(floatval($atrade["Quantity"]), 8, '.', '') . '</td>';
    $total = number_format(floatval($atrade["Price"] * $atrade["Quantity"]), 8, '.', '');
    echo '<td>' . $total . '</td></tr>';
}
?>
            </tbody>

          </table>
        </div>

      </div><!--/panel charts-->
示例#19
0
<?php

$coin = strtoupper(end(explode('/', dirname(__FILE__))));
session_start();
session_regenerate_id();
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/BaseDonnee.class.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/Wallet.class.php";
$bdd = BaseDonnee::connexion();
//Test si l'user est bien connecté
include_once $_SERVER['DOCUMENT_ROOT'] . "/includes/verifications.php";
$sql = BaseDonnee::execQuery($bdd, "SELECT * FROM Wallets WHERE Acronymn='{$coin}' AND disabled='0'")[0];
$walletID = $sql["Id"];
$wallet = new Wallet($walletID);
$username = $_SESSION["pseudo"];
$balance = BaseDonnee::execQuery($bdd, "SELECT Amount FROM balances WHERE Account='{$username}' AND `Wallet_ID` = '{$walletID}'")[0]["Amount"];
try {
    if (isset($_POST["depositaddress"])) {
        $address = $wallet->Client->getnewaddress($username);
    } else {
        $address = $wallet->Client->getaccountaddress($username);
    }
} catch (Exception $e) {
    $_SESSION["erreurs"]["general"] = "Wallet maintenance, please retry later";
}
?>

<head>
	<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css" rel="stylesheet">
	<link href="../css/style.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="../js/jquery-1.10.2.min.js"></script>
</head>
示例#20
0
            </div>
            <p class="submit-holder" style="text-align:center">
            <input  class="btn btn-default btn-success" type="submit" value="Register New Account"/><div style="display:none;"><input type="hidden" name="data[_Token][fields]" value="1655c6f30c5b281a90bd288f74949cdd1e59aa8f%3A" id="TokenFields29805640"/><input type="hidden" name="data[_Token][unlocked]" value="recaptcha_challenge_field%7Crecaptcha_response_field" id="TokenUnlocked719997573"/></div> 
            </form>  
          </p>      		';
} else {
    $usr = mysql_escape_string($_GET["usr"]);
    $key = mysql_escape_string($_GET["key"]);
    $sql = BaseDonnee::execQuery($bdd, "SELECT * FROM Users WHERE Username = '******' AND KeyActiveAccount = '{$key}'");
    if (empty($sql)) {
        header("Location: ../index.php");
        // redirection vers la page de login
        exit;
    } else {
        //un utilisateur s'active
        BaseDonnee::activeAccount($bdd, $usr);
        echo '<h2 class="text-success"> ' . $usr . ', Thank you for your registration !</h2>
            <p> Now you can <a href="./login.php">login</a> and enjoy trade crypto currencies !</p>';
    }
}
?>
		
        </div><!-- end of div.box-container -->
      </div><!-- end of div.box -->

    </div>
    <div class="clearfix"></div>

  </div><!--/end working-contents--> 
</div><!--/content-->
示例#21
0
        if (!empty($_POST[$market["Pair"]])) {
            $coin1 = strstr($market["Pair"], "/", true);
            $coin2 = substr(strstr($market["Pair"], "/"), 1);
            $isdisabled = BaseDonnee::execQuery($bdd, "SELECT * FROM Wallets WHERE Market = '1' AND (Acronymn = '{$coin1}' OR Acronymn = '{$coin2}')");
            $actif1 = BaseDonnee::execQuery($bdd, "SELECT * FROM Wallets WHERE Acronymn = '{$coin1}'")[0]["disabled"];
            $actif2 = BaseDonnee::execQuery($bdd, "SELECT * FROM Wallets WHERE Acronymn = '{$coin2}'")[0]["disabled"];
            if (!empty($isdisabled) && $actif1 != '1' && $actif2 != '1') {
                $fee = (double) sprintf("%.8f", $_POST["fee" . $market["Pair"]]);
                BaseDonnee::setMarketFee($bdd, $market["Pair"], $fee);
                BaseDonnee::setMarketState($bdd, $market["Pair"], 0);
            } else {
                BaseDonnee::setMarketState($bdd, $market["Pair"], 1);
            }
        } else {
            //Desactiver une pair trade
            BaseDonnee::setMarketState($bdd, $market["Pair"], 1);
        }
    }
    header("Location: ./activepair.php");
    exit;
}
//Cette boucle va mettre à jour toute la BDD en fonction des choix de l'administrateur (activer ou desactiver une certaine currency)
// foreach ($lines as $line){
// 	try{
// 		$actif = ($_POST["actif".$line["name"]] == "Actif") ? '1' : '0';
// 		$fee = $_POST["fee".$line["name"]];
// 		BaseDonnee::setState($bdd, $line["name"], $actif);
// 		BaseDonnee::setFees($bdd, $line["name"], $fee);
// 	}catch(Exception $e){
// 		$_SESSION["addErreur"] = $e->getMessage();
// 	}
示例#22
0
            //ici, on verifie que $amount soit bien egal à 0. si non, plus de trade possible : on effectue un order pour le reste.
            if ($amount != 0) {
                echo "<p>Plus d'autres targets, on effectue un " . $type . " order d'amount " . $amount . "</p>";
                $total = floatval(number_format($amount * $value, 8));
                BaseDonnee::addTrade($bdd, $type, $username, number_format($amount, 8, '.', ''), number_format($value, 8, '.', ''), $pair, $fee, $total);
                //On ajoute aussi le helding pour cet order
                $helding1 = 0.0;
                $helding2 = 0.0;
                if ($type == "BUY") {
                    $helding2 += (double) ($total + $total * $fee / 100);
                } else {
                    $helding2 += (double) ($total * $fee / 100);
                    $helding1 += (double) $amount;
                }
                $newhelding1 = floatval($sqlbalance1["Helding"]) + floatval(number_format($helding1, 8));
                $newhelding2 = floatval($sqlbalance2["Helding"]) + floatval(number_format($helding2, 8));
                BaseDonnee::setHelding($bdd, $username, $coin1, $newhelding1);
                BaseDonnee::setHelding($bdd, $username, $coin2, $newhelding2);
            }
            header("Location: /users/trades.php?market=" . strtolower($coin1 . '-' . $coin2));
            exit;
        }
    } else {
        $_SESSION["erreurs"] = $erreurs;
        header("Location: /users/trades.php?market=" . strtolower($coin1 . '-' . $coin2));
        exit;
    }
} else {
    header('HTTP/1.0 404 Not Found');
    exit("<h1>404 Not Found</h1>\nThe page that you have requested could not be found.");
}
示例#23
0
          <table cellpadding="0" cellspacing="0" border="0" class="table table-striped" id="tradehistory">

            <thead>
              <tr>
               <th>Date</th>
               <th>Market</th>
               <th>Type</th>
               <th>Price Each</th>
               <th>Amount</th>
               <th>Total</th>
             </tr>
           </thead>
           <tbody>
            <?php 
$username = $_SESSION["pseudo"];
$tradehistory = BaseDonnee::execQuery($bdd, "SELECT * FROM Trade_History WHERE (Buyer = '{$username}' OR Seller = '{$username}') ORDER BY Timestamp DESC");
foreach ($tradehistory as $atrade) {
    echo '<tr><td>' . date('Y-m-d H:i:s', $atrade["Timestamp"]) . '</td>';
    echo '<td>' . $atrade["Market"] . '</td>';
    echo '<td>' . $atrade["Type"] . '</td>';
    echo '<td>' . number_format($atrade["Price"], 8, '.', '') . '</td>';
    echo '<td>' . number_format($atrade["Quantity"], 8, '.', '') . '</td>';
    $total = number_format(floatval($atrade["Price"] * $atrade["Quantity"]), 8, '.', '');
    echo '<td>' . $total . '</td></tr>';
}
?>
          </tbody>

        </table>

      </div>
示例#24
0
                    if ($voteAdd >= 1) {
                        BaseDonnee::editVoteTotal($bdd, "BTC", $voteNumber + $voteAdd);
                    }
                    continue;
                }
            }
            /*Reception de coins par un wallet tiers (deposit)
             * Mise à jour de la balance de l'user */
            if (intval($transaction["confirmations"]) >= 4) {
                $balance = BaseDonnee::execQuery($bdd, "SELECT * FROM balances WHERE Coin = '{$coin}' AND Account='{$account}'")[0]["Amount"];
                $newbalance = floatval($balance) + $amount;
                BaseDonnee::setBalance($bdd, $account, $coin, $newbalance);
                //Ajout d'un deposit en BDD afin d'en retracer l'historique
                BaseDonnee::addDeposit($bdd, $account, $amount, 1, $txid, $row["Acronymn"], intval($transaction["confirmations"]));
            } else {
                //Une transaction a été detectée mais elle a moins de 4 confirmations
                BaseDonnee::addDeposit($bdd, $account, $amount, 0, $txid, $row["Acronymn"], intval($transaction["confirmations"]));
                echo "add deposit de " . $amount . $row["Acronymn"];
            }
            //On sauvegarde en BDD notre avancement en inserant le hash de la derniere transaction
            BaseDonnee::setHash($bdd, $walletid, $newhash);
        }
    }
}
function sortBySubkey(&$array, $subkey, $sortType = SORT_ASC)
{
    foreach ($array as $subarray) {
        $keys[] = $subarray[$subkey];
    }
    array_multisort($keys, $sortType, $array);
}
示例#25
0
<?php

session_start();
session_regenerate_id();
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/BaseDonnee.class.php";
$bdd = BaseDonnee::connexion();
include_once $_SERVER['DOCUMENT_ROOT'] . "/includes/verifications.php";
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>
   Crypto Maniac - Account Balances</title>    

   <?php 
include_once $_SERVER['DOCUMENT_ROOT'] . "/includes/header.inc.php";
?>

 </head>

 <body>

  <!-- Fixed navbar -->
  <?php 
//Affiche une barre différente si l'user est connecté
if (!isset($_SESSION["pseudo"])) {
    header("Location: /index.php");
    exit;
} else {
    include $_SERVER['DOCUMENT_ROOT'] . "/includes/member_navbar.inc.php";
示例#26
0
} else {
    echo "Your " . $coin . " Withdrawals";
}
?>
 
          </div>

          <div class="tablewrap"  id="market-wrap" style="max-height:500px; overflow:auto;">
            <form action="./verif_trades.php" method="POST">
              <input type=hidden name="cancelorder"/>
              <?php 
$username = $_SESSION["pseudo"];
if ($coin == "ALL") {
    $withdrawals = BaseDonnee::execQuery($bdd, "SELECT * FROM Withdraw_History WHERE User = '******' ORDER BY Timestamp DESC");
} else {
    $withdrawals = BaseDonnee::execQuery($bdd, "SELECT * FROM Withdraw_History WHERE User = '******' AND Coin = '{$coin}'");
}
echo '
                <table cellpadding="0" cellspacing="0" border="0" class="table table2 table-striped" id="userorderslist">
                <thead>
                <tr>
                <th>Withdrawal Date</th>';
if ($coin == "ALL") {
    echo '<th>Coin</th>';
}
echo '
                <th>Amount</th>
                <th>Address</th>
                </tr></thead><tbody>
                ';
foreach ($withdrawals as $withdrawal) {
示例#27
0


        <div class="page page-settings" style="float:left;">

          <br>



          <div class="panel panel-default panel-change-contact-info">
            <div class="panel-heading"> <span class="glyphicon glyphicon-edit"></span> Change Contact Information</div> 
            <div class="panel-body">
              <?php 
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/BaseDonnee.class.php";
$bdd = BaseDonnee::connexion();
$res = BaseDonnee::getByUsername($bdd, $_SESSION["pseudo"]);
echo '
                <form action="./verif_settings.php" id="UserSettingsForm" method="post" accept-charset="utf-8"><div style="display:none;"><input type="hidden" name="_method" value="POST"/><input type="hidden" name="data[_Token][key]" value="750e0010456c6a132ff43c6a06f1539c7516f0cf" id="Token32834591"/></div><input type="hidden" name="data[User][updatetype]" value="allcontact" id="UserUpdatetype"/>                    <div class="row">
                
                
                <div class="row">
                <div class="col-xs-6">
                <div class="form-group">
                <label for=""><span class="glyphicon glyphicon-email"></span> Email</label>
                <input name="changemail" value="' . $res["mail"] . '" class="form-control" maxlength="80" type="email" id="UserEmail" required="required"/>                          
                </div>
                <i class="text-danger">' . $_SESSION["errors"]["mail"] . '</i>
                <i class="text-success">' . $_SESSION["updated"]["mail"] . '</i>
                </div>   
                <div class="col-xs-6">
                <div class="form-group">
示例#28
0
             // durée d'une session
             $lastseen = strtotime($sql[0]["LastTimeSeen"]);
             // derniere fois que l'user a chargé une page
             $now = time();
             // temps actuel
             //Si la derniere fois qu'il a chargé une page était il y a plus de temps qu'une session expire, par securité on ne traite pas son msg
             if ($now - $lastseen > $maxlifetime) {
                 echo $lastseen;
                 break 2;
             }
         }
         //prepare data to be sent to client
         $response_text = mask(json_encode(array('type' => 'usermsg', 'name' => $user_name, 'message' => $user_message, 'color' => $user_color)));
         send_message($response_text);
         //send data
         BaseDonnee::addToChat($bdd, time(), $user_name, $user_message);
         break 2;
         //exist this loop
     }
     $buf = @socket_read($changed_socket, 1024, PHP_NORMAL_READ);
     if ($buf === false) {
         // check disconnected client
         // remove client for $clients array
         $found_socket = array_search($changed_socket, $clients);
         socket_getpeername($changed_socket, $ip);
         unset($clients[$found_socket]);
         //notify all users about disconnected connection
         //$response = mask(json_encode(array('type'=>'system', 'message'=>$ip.' disconnected')));
         //send_message($response);
     }
 }
示例#29
0
<?php 
include_once $_SERVER['DOCUMENT_ROOT'] . "/includes/header.inc.php";
?>
</head>
<body>
 <!-- Fixed navbar -->
    <?php 
//Affiche une barre différente si l'user est connecté
if (!isset($_SESSION["pseudo"])) {
    include $_SERVER['DOCUMENT_ROOT'] . "/includes/guest_navbar.inc.php";
} else {
    include $_SERVER['DOCUMENT_ROOT'] . "/includes/member_navbar.inc.php";
    $username = $_SESSION["pseudo"];
    //We update user's lasttimeseen
    BaseDonnee::updateLastTimeSeen($bdd, $username);
}
?>
   <div id="wrap" class="container ">
    <div class="row maincontents">
      <!-- Sidebar start -->
      <?php 
include $_SERVER['DOCUMENT_ROOT'] . "/includes/sidebar.inc.php";
?>
      <!-- Sidebar end -->
      <!-- Content start -->
      <div class="page" id="content" role="main">
        <div class="working-contents">
          <div class="page page-index" style="float:left;">

<h1>Crypto Maniac Privacy Policy</h1>
示例#30
0
    $sql = BaseDonnee::execQuery($bdd, "SELECT * FROM Users WHERE Username = '******'");
    if (!empty($sql)) {
        if ($sql[0]["Actif"] != "1") {
            $success = false;
        }
    }
} catch (PDOEXception $e) {
    echo $e->getMessage();
    // display bdd error
    exit;
}
if ($success) {
    //Si la connexion à réussie
    if (isset($_SESSION["erreur_login"])) {
        unset($_SESSION["erreur_login"]);
    }
    $_SESSION["pseudo"] = $pseudo;
    // On connecte l'user
    $_SESSION["token"] = time();
    $ip_client = getenv('HTTP_CLIENT_IP') ?: getenv('HTTP_X_FORWARDED_FOR') ?: getenv('HTTP_X_FORWARDED') ?: getenv('HTTP_FORWARDED_FOR') ?: getenv('HTTP_FORWARDED') ?: getenv('REMOTE_ADDR');
    BaseDonnee::updateLastSignIn($bdd, $pseudo, $ip_client);
    header("Location: ../index.php");
    //Redirection vers l'accueil
    exit;
} else {
    //Echec de la connexion
    $_SESSION["erreur_login"] = "******";
    header("Location: ./login.php");
    //Redirection vers la page de login
    exit;
}