<?php

$amountWeekRow = $sql->query(query_last_week())->fetch();
$amountWeek = $amountWeekRow["value"];
$amountWeekRefRow = $sql->query(query_last_week_referals())->fetch();
$amountWeekRef = $amountWeekRefRow["value"];
$amountBeginningRow = $sql->query(query_since_beginning())->fetch();
$amountBeginning = $amountBeginningRow["value"];
$amountBeginningRefRow = $sql->query(query_since_beginning_referals())->fetch();
$amountBeginningRef = $amountBeginningRefRow["value"];
?>
<style>
.stat {
  margin-top:10px;
  font-size: larger;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid #e6e6e6;
  background: white;
}
</style>
<div class="row">
  <h3 id="lbl-your-stats" class="text-center">Your stats:</h3>
  <div class="col-sm-12">
    <div class="row">
      <div class="col-sm-6"><div class="col-sm-11 stat"><p id="lbl-satoshis-7-days">Satoshis given in the last 7 days:</p><div class="col-sm-12"><?php 
echo $amountWeek;
?>
</div></div></div>
      <div class="col-sm-6"><div class="col-sm-11 col-sm-offset-1 stat"><p id="lbl-satoshis-7-days-as-referals">Satoshis given in the last 7 days as referals:</p><div class="col-sm-12"> <?php 
echo $amountWeekRef;
function xapo_statistics_callback()
{
    global $wpdb;
    $amountWeekRow = $wpdb->get_results(query_last_week());
    if (isset($amountWeekRow[0]->value)) {
        $amountWeek = $amountWeekRow[0]->value;
    } else {
        $amountWeek = 0;
    }
    $amountWeekRefRow = $wpdb->get_results(query_last_week_referals());
    if (isset($amountWeekRefRow[0]->value)) {
        $amountWeekRef = $amountWeekRefRow[0]->value;
    } else {
        $amountWeekRef = 0;
    }
    $amountBeginningRow = $wpdb->get_results(query_since_beginning());
    if (isset($amountBeginningRow[0]->value)) {
        $amountBeginning = $amountBeginningRow[0]->value;
    } else {
        $amountBeginning = 0;
    }
    $amountBeginningRefRow = $wpdb->get_results(query_since_beginning_referals());
    if (isset($amountBeginningRefRow[0]->value)) {
        $amountBeginningRef = $amountBeginningRefRow[0]->value;
    } else {
        $amountBeginningRef = 0;
    }
    ?>
<style>
.stat {
  margin-top:10px;
  font-size: larger;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid #e6e6e6;
  background: white;
}

div#wedevs_advanced p.submit  input#submit
{
	display :none ;
}
</style>
<div class="row">
  <h3 id="lbl-your-stats" class="text-center">Your stats:</h3>
  <div class="col-sm-12">
    <div class="row">
      <div class="col-sm-6"><div class="col-sm-11 stat"><p id="lbl-satoshis-7-days">Satoshis given in the last 7 days:</p><div class="col-sm-12"><?php 
    echo $amountWeek;
    ?>
</div></div></div>
      <div class="col-sm-6"><div class="col-sm-11 col-sm-offset-1 stat"><p id="lbl-satoshis-7-days-as-referals">Satoshis given in the last 7 days as referals:</p><div class="col-sm-12"> <?php 
    echo $amountWeekRef;
    ?>
</div></div></div>
    </div>
    <div class="row">
      <div class="col-sm-6"><div class="col-sm-11 stat"><p id="lbl-satoshis-beggining">Satoshis given since the beggining of times:</p><div class="col-sm-12"><?php 
    echo $amountBeginning;
    ?>
</div></div></div>
      <div class="col-sm-6"><div class="col-sm-11 col-sm-offset-1 stat"><p id="lbl-satoshis-beggining-referrals">Satoshis given since the beggining of times (as referals):</p><div class="col-sm-12"><?php 
    echo $amountBeginningRef;
    ?>
</div></div></div>
    </div>
  </div>
</div>
    <?php 
}
Exemple #3
0
<?php

/*try {
  $sql = new PDO($dbdsn, $mysqlUsername, $mysqlPassword, array(PDO::ATTR_PERSISTENT => true,
  PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
} catch(PDOException $e) {
  die($e->getMessage());
}*/
echo "antes";
$amountWeek = $sql->query(query_last_week())->fetch()["value"];
echo "paso week";
$amountWeekRef = $sql->query(query_last_week_referals())->fetch()["value"];
echo "paso week ref";
$amountBeginning = $sql->query(query_since_beginning())->fetch()["value"];
echo "paso amount beg";
$amountBeginningRef = $sql->query(query_since_beginning_referals())->fetch()["value"];
echo "paso amounr ref";
?>
<style>
.stat {
  margin-top:10px;
  font-size: larger;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid #e6e6e6;
  background: white;
}
</style>
<div class="row">
  <h3 class="text-center">Your stats:</h3>
  <div class="col-sm-12">