コード例 #1
0
ファイル: stats-languages.php プロジェクト: hackingman/TradeX
          <td class="ta-center">Language</td>
          <td class="ta-center" style="width: 100px;">% of Total</td>
          <td class="ta-center" style="width: 70px;"><?php 
echo $_REQUEST['log'];
?>
</td>
        </tr>
      </thead>
      <tbody>
        <?php 
list($total, $languages) = get_overall_languages(strtolower($_REQUEST['log']));
$counter = 1;
$color = '#ececec';
foreach ($languages as $lang => $amount) {
    $color = $color == '#ffffff' ? '#ececec' : '#ffffff';
    $percent = $total > 0 ? format_float_to_percent($amount / $total, 1) : 0;
    ?>
        <tr bgcolor="<?php 
    echo $color;
    ?>
">
          <td class="ta-right" style="padding-right: 4px;">
            <?php 
    echo $counter++;
    ?>
          </td>
          <td><?php 
    echo $lang;
    ?>
</td>
          <td style="padding: 0px;" class="va-middle">
コード例 #2
0
    ?>
" YValue="<?php 
    echo $stats[0] > 0 ? format_float_to_percent($stats[6] / $stats[0]) : 0;
    ?>
"/>
                <?php 
}
?>
            </vc:DataSeries.DataPoints>
        </vc:DataSeries>

        <vc:DataSeries LegendText="Return" RenderAs="Line" LightingEnabled="False" ToolTipText="#YValue%" Color="#0097FF" MarkerScale="1.5" LineThickness="3" LabelEnabled="False">
            <vc:DataSeries.DataPoints>
                <?php 
foreach ($history->stats as $date => $stats) {
    ?>
                <vc:DataPoint AxisXLabel="<?php 
    echo $date;
    ?>
" YValue="<?php 
    echo $stats[0] > 0 ? format_float_to_percent($stats[14] / $stats[0]) : 0;
    ?>
"/>
                <?php 
}
?>
            </vc:DataSeries.DataPoints>
        </vc:DataSeries>
    </vc:Chart.Series>

</vc:Chart>
コード例 #3
0
ファイル: outlists.php プロジェクト: hackingman/TradeX
function _outlist_table_row($trade, $total)
{
    global $g_color, $g_counter;
    $g_color = $g_color == '#ffffff' ? '#ececec' : '#ffffff';
    $percent = $total > 0 ? format_float_to_percent($trade[1] / $total, 1) : 0;
    ?>
        <tr bgcolor="<?php 
    echo $g_color;
    ?>
">
          <td class="ta-right" style="padding-right: 4px;">
            <?php 
    echo $g_counter++;
    ?>
          </td>
          <td class="ta-right"><?php 
    echo $trade[0];
    ?>
</td>
          <?php 
    if ($trade[5]) {
        ?>
          <td style="padding: 0px;" class="ta-center">
            FORCE
          </td>
          <?php 
    } else {
        ?>
          <td style="padding: 0px;" class="va-middle">
            <div class="percent-bar ta-right" style="width: <?php 
        echo $percent;
        ?>
%;">
              <?php 
        if ($percent >= 60) {
            echo "<span>{$percent}%</span>";
        }
        ?>
            </div>
            <span class="va-middle"><?php 
        if ($percent < 60) {
            echo "{$percent}%";
        }
        ?>
</span>
          </td>
          <?php 
    }
    ?>
          <td class="ta-right">
            <!--[<?php 
    echo $trade[7];
    ?>
]-->
            <?php 
    echo format_float_to_string($trade[1], 2);
    ?>
          </td>
        </tr>
<?php 
}
コード例 #4
0
ファイル: stats.php プロジェクト: hackingman/TradeX
 function AddStats($s)
 {
     if ($s->i_raw_60 === STATS_UNKNOWN) {
         return;
     }
     // In last 60 minutes
     $this->i_raw_60 += $s->i_raw_60;
     $this->i_uniq_60 += $s->i_uniq_60;
     $this->i_uniq_pct_60 = $this->i_raw_60 > 0 ? format_float_to_percent($this->i_uniq_60 / $this->i_raw_60) : 0;
     $this->i_proxy_60 += $s->i_proxy_60;
     $this->i_ctry_g_60 += $s->i_ctry_g_60;
     $this->i_ctry_n_60 += $s->i_ctry_n_60;
     $this->i_ctry_b_60 += $s->i_ctry_b_60;
     $this->i_ctry_tot_60 = $this->i_ctry_g_60 + $this->i_ctry_n_60 + $this->i_ctry_b_60;
     $this->i_ctry_g_pct_60 = $this->i_ctry_tot_60 > 0 ? format_float_to_percent($this->i_ctry_g_60 / $this->i_ctry_tot_60) : 0;
     $this->i_ctry_n_pct_60 = $this->i_ctry_tot_60 > 0 ? format_float_to_percent($this->i_ctry_n_60 / $this->i_ctry_tot_60) : 0;
     $this->i_ctry_b_pct_60 = $this->i_ctry_tot_60 > 0 ? format_float_to_percent($this->i_ctry_b_60 / $this->i_ctry_tot_60) : 0;
     // Clicks last 60 minutes
     $this->c_raw_60 += $s->c_raw_60;
     $this->c_uniq_60 += $s->c_uniq_60;
     $this->c_proxy_60 += $s->c_proxy_60;
     $this->c_trades_60 += $s->c_trades_60;
     $this->c_again_60 += $s->c_again_60;
     $this->c_ctry_g_60 += $s->c_ctry_g_60;
     $this->c_ctry_n_60 += $s->c_ctry_n_60;
     $this->c_ctry_b_60 += $s->c_ctry_b_60;
     $this->c_ctry_tot_60 = $this->c_ctry_g_60 + $this->c_ctry_n_60 + $this->c_ctry_b_60;
     $this->c_ctry_g_pct_60 = $this->c_ctry_tot_60 > 0 ? format_float_to_percent($this->c_ctry_g_60 / $this->c_ctry_tot_60) : 0;
     $this->c_ctry_n_pct_60 = $this->c_ctry_tot_60 > 0 ? format_float_to_percent($this->c_ctry_n_60 / $this->c_ctry_tot_60) : 0;
     $this->c_ctry_b_pct_60 = $this->c_ctry_tot_60 > 0 ? format_float_to_percent($this->c_ctry_b_60 / $this->c_ctry_tot_60) : 0;
     // Out last 60 minutes
     $this->o_raw_60 += $s->o_raw_60;
     $this->o_uniq_60 += $s->o_uniq_60;
     $this->o_proxy_60 += $s->o_proxy_60;
     $this->o_ctry_g_60 += $s->o_ctry_g_60;
     $this->o_ctry_n_60 += $s->o_ctry_n_60;
     $this->o_ctry_b_60 += $s->o_ctry_b_60;
     $this->o_ctry_tot_60 = $this->o_ctry_g_60 + $this->o_ctry_n_60 + $this->o_ctry_b_60;
     $this->o_ctry_g_pct_60 = $this->o_ctry_tot_60 > 0 ? format_float_to_percent($this->o_ctry_g_60 / $this->o_ctry_tot_60) : 0;
     $this->o_ctry_n_pct_60 = $this->o_ctry_tot_60 > 0 ? format_float_to_percent($this->o_ctry_n_60 / $this->o_ctry_tot_60) : 0;
     $this->o_ctry_b_pct_60 = $this->o_ctry_tot_60 > 0 ? format_float_to_percent($this->o_ctry_b_60 / $this->o_ctry_tot_60) : 0;
     // Forces last 60 minutes
     $this->f_instant_60 += $s->f_instant_60;
     $this->f_hourly_60 += $s->f_hourly_60;
     // Productivity (CLICKS/RAW INCOMING)
     $this->prod_60 = $this->i_raw_60 > 0 ? format_float_to_percent($this->c_raw_60 / $this->i_raw_60) : 0;
     // Trade productivity (CLICKS TO TRADES/RAW INCOMING)
     $this->t_prod_60 = $this->i_raw_60 > 0 ? format_float_to_percent($this->c_trades_60 / $this->i_raw_60) : 0;
     // Skim (CLICKS - CLICKS TO TRADES/RAW INCOMING)
     $this->skim_60 = $this->c_raw_60 > 0 ? format_float_to_percent(1 - $this->c_trades_60 / $this->c_raw_60) : 0;
     // Return (OUT/RAW INCOMING)
     $this->return_60 = $this->i_raw_60 > 0 ? format_float_to_percent($this->o_raw_60 / $this->i_raw_60) : 0;
     // In last 24 hours
     $this->i_raw_24 += $s->i_raw_24;
     $this->i_uniq_24 += $s->i_uniq_24;
     $this->i_uniq_pct_24 = $this->i_raw_24 > 0 ? format_float_to_percent($this->i_uniq_24 / $this->i_raw_24) : 0;
     $this->i_proxy_24 += $s->i_proxy_24;
     $this->i_ctry_g_24 += $s->i_ctry_g_24;
     $this->i_ctry_n_24 += $s->i_ctry_n_24;
     $this->i_ctry_b_24 += $s->i_ctry_b_24;
     $this->i_ctry_tot_24 = $this->i_ctry_g_24 + $this->i_ctry_n_24 + $this->i_ctry_b_24;
     $this->i_ctry_g_pct_24 = $this->i_ctry_tot_24 > 0 ? format_float_to_percent($this->i_ctry_g_24 / $this->i_ctry_tot_24) : 0;
     $this->i_ctry_n_pct_24 = $this->i_ctry_tot_24 > 0 ? format_float_to_percent($this->i_ctry_n_24 / $this->i_ctry_tot_24) : 0;
     $this->i_ctry_b_pct_24 = $this->i_ctry_tot_24 > 0 ? format_float_to_percent($this->i_ctry_b_24 / $this->i_ctry_tot_24) : 0;
     // Clicks last 24 hours
     $this->c_raw_24 += $s->c_raw_24;
     $this->c_uniq_24 += $s->c_uniq_24;
     $this->c_proxy_24 += $s->c_proxy_24;
     $this->c_trades_24 += $s->c_trades_24;
     $this->c_again_24 += $s->c_again_24;
     $this->c_ctry_g_24 += $s->c_ctry_g_24;
     $this->c_ctry_n_24 += $s->c_ctry_n_24;
     $this->c_ctry_b_24 += $s->c_ctry_b_24;
     $this->c_ctry_tot_24 = $this->c_ctry_g_24 + $this->c_ctry_n_24 + $this->c_ctry_b_24;
     $this->c_ctry_g_pct_24 = $this->c_ctry_tot_24 > 0 ? format_float_to_percent($this->c_ctry_g_24 / $this->c_ctry_tot_24) : 0;
     $this->c_ctry_n_pct_24 = $this->c_ctry_tot_24 > 0 ? format_float_to_percent($this->c_ctry_n_24 / $this->c_ctry_tot_24) : 0;
     $this->c_ctry_b_pct_24 = $this->c_ctry_tot_24 > 0 ? format_float_to_percent($this->c_ctry_b_24 / $this->c_ctry_tot_24) : 0;
     // Out last 24 hours
     $this->o_raw_24 += $s->o_raw_24;
     $this->o_uniq_24 += $s->o_uniq_24;
     $this->o_proxy_24 += $s->o_proxy_24;
     $this->o_ctry_g_24 += $s->o_ctry_g_24;
     $this->o_ctry_n_24 += $s->o_ctry_n_24;
     $this->o_ctry_b_24 += $s->o_ctry_b_24;
     $this->o_ctry_tot_24 = $this->o_ctry_g_24 + $this->o_ctry_n_24 + $this->o_ctry_b_24;
     $this->o_ctry_g_pct_24 = $this->o_ctry_tot_24 > 0 ? format_float_to_percent($this->o_ctry_g_24 / $this->o_ctry_tot_24) : 0;
     $this->o_ctry_n_pct_24 = $this->o_ctry_tot_24 > 0 ? format_float_to_percent($this->o_ctry_n_24 / $this->o_ctry_tot_24) : 0;
     $this->o_ctry_b_pct_24 = $this->o_ctry_tot_24 > 0 ? format_float_to_percent($this->o_ctry_b_24 / $this->o_ctry_tot_24) : 0;
     // Forces last 24 hours
     $this->f_instant_24 += $s->f_instant_24;
     $this->f_hourly_24 += $s->f_hourly_24;
     // Productivity (CLICKS/RAW INCOMING)
     $this->prod_24 = $this->i_raw_24 > 0 ? format_float_to_percent($this->c_raw_24 / $this->i_raw_24) : 0;
     // Trade productivity (CLICKS TO TRADES/RAW INCOMING)
     $this->t_prod_24 = $this->i_raw_24 > 0 ? format_float_to_percent($this->c_trades_24 / $this->i_raw_24) : 0;
     // Skim (CLICKS - CLICKS TO TRADES/RAW INCOMING)
     $this->skim_24 = $this->c_raw_24 > 0 ? format_float_to_percent(1 - $this->c_trades_24 / $this->c_raw_24) : 0;
     // Return (OUT/RAW INCOMING)
     $this->return_24 = $this->i_raw_24 > 0 ? format_float_to_percent($this->o_raw_24 / $this->i_raw_24) : 0;
 }
コード例 #5
0
ファイル: trades-detailed.php プロジェクト: hackingman/TradeX
                    </td>
                  </tr>
                  <tr>
                    <td style="width: 30px;"></td>
                    <td class="ta-center">Proxy</td>
                    <td class="ta-center" width="100">% of Total</td>
                    <td class="ta-center" width="70">Clicks</td>
                  </tr>
                </thead>
                <tbody>
                  <?php 
$counter = 1;
$color = '#ececec';
foreach ($dstats->c_proxy as $proxy => $amount) {
    $color = $color == '#ffffff' ? '#ececec' : '#ffffff';
    $percent = $dstats->c_total > 0 ? format_float_to_percent($amount / $dstats->c_total, 1) : 0;
    ?>
                  <tr bgcolor="<?php 
    echo $color;
    ?>
">
                    <td class="ta-right" style="padding-right: 4px;"><?php 
    echo $counter++;
    ?>
</td>
                    <td><?php 
    echo $proxy;
    ?>
</td>
                    <td style="padding: 0px;" class="va-middle">
                      <div class="percent-bar ta-right" style="width: <?php 
コード例 #6
0
ファイル: utility.php プロジェクト: hackingman/TradeX
function write_outlist($file, $sort_key, &$points, $amount = null)
{
    global $g_outlist_key;
    $g_outlist_key = $sort_key;
    uasort($points, 'cmp_outlist_points');
    $fp = fopen($file, 'w');
    flock($fp, LOCK_EX);
    foreach ($points as $trade => $data) {
        $high_priority_instant = $sort_key == POINTS_MAIN && $data['trade']['force_instant'] > 0 && $data['trade']['flag_force_instant_high'];
        $trade_points = $high_priority_instant ? format_float_to_percent($data['trade']['force_instant_owed'] / $data['trade']['force_instant'], 1) : round($data[$sort_key], 1);
        if (!$high_priority_instant && $trade_points <= 0) {
            continue;
        }
        $line = join('|', array($trade, $trade_points, ',' . $data['trade']['categories'] . ',', ',' . $data['trade']['groups'] . ',', $data['trade']['return_url'], $high_priority_instant, $sort_key == POINTS_FORCE ? $data['trade']['force_type'] : null, $data['trade']['flag_external']));
        $owed = $file == FILE_OUTLIST_PRIMARY || $file == FILE_OUTLIST_SECONDARY ? round($data['trade']['max_owed'] * 0.333) : $data['trade']['max_owed'];
        fwrite($fp, pack('LL', $owed, strlen($line)) . $line);
    }
    flock($fp, LOCK_UN);
    fclose($fp);
}