예제 #1
0
    ?>
%;">
              <?php 
    if ($percent >= 60) {
        echo "<span>{$percent}%</span>";
    }
    ?>
            </div>
            <span class="va-middle"><?php 
    if ($percent < 60) {
        echo "{$percent}%";
    }
    ?>
</span>
          </td>
          <td class="ta-right">
            <?php 
    echo format_int_to_string($amount);
    ?>
          </td>
        </tr>
        <?php 
}
?>
      </tbody>

    </table>

    <div id="toolbar-vspacer"></div>
<?php 
include 'global-footer.php';
예제 #2
0
function _stats_network_table_row($so, $site, $menu = 'site-action-menu')
{
    $id = $so->trade['domain'];
    $domain = htmlspecialchars($so->trade['domain']);
    $status = $so->trade['status'];
    $status_lc = strtolower($status);
    $site = string_htmlspecialchars($site);
    ?>
        <tr <?php 
    if (!empty($so->trade['color'])) {
        echo 'bgcolor="' . $so->trade['color'] . '"';
    }
    ?>
 id="item-<?php 
    echo $id;
    ?>
" class="ta-right<?php 
    if ($so->i_raw_60 === STATS_UNKNOWN) {
        echo ' unknown';
    }
    ?>
">
          <?php 
    if (!empty($menu)) {
        ?>
          <td class="ta-center">
            <input type="checkbox" value="<?php 
        echo $id;
        ?>
"/>
          </td>
          <?php 
    }
    ?>
          <td class="va-middle" style="padding-right: 4px;"<?php 
    if (empty($menu)) {
        ?>
 colspan="2"<?php 
    }
    ?>
>
            <?php 
    if (!empty($menu)) {
        ?>
            <a href="<?php 
        echo $site['url'];
        ?>
" class="cp-login fw-bold" cpurl="<?php 
        echo $site['url'];
        ?>
" cppass="******" cpuser="******" target="_blank"><?php 
        echo $domain;
        ?>
</a>
            <span class="icon-menu-container" menu="#<?php 
        echo $menu;
        ?>
" style="position: relative;"><img src="images/actions-16x16.png"/></span>
            <?php 
    } else {
        ?>
            <?php 
        echo $domain;
        ?>
            <?php 
    }
    ?>
          </td>
          <td class="i_raw_60"><?php 
    echo format_int_to_string($so->i_raw_60);
    ?>
</td>
          <td><?php 
    echo format_int_to_string($so->o_raw_60);
    ?>
</td>
          <td><?php 
    echo format_int_to_string($so->c_raw_60);
    ?>
</td>
          <td style="padding: 2px 0px;">
            <div class="quality quality-good" style="width: <?php 
    echo $so->i_ctry_g_pct_60;
    ?>
%" title="Good: <?php 
    echo $so->i_ctry_g_pct_60;
    ?>
%"></div>
            <div class="quality quality-normal" style="width: <?php 
    echo $so->i_ctry_n_pct_60;
    ?>
%" title="Normal: <?php 
    echo $so->i_ctry_n_pct_60;
    ?>
%"></div>
            <div class="quality quality-bad" style="width: <?php 
    echo $so->i_ctry_b_pct_60;
    ?>
%" title="Bad: <?php 
    echo $so->i_ctry_b_pct_60;
    ?>
%"></div>
          </td>
          <td><?php 
    echo $so->prod_60;
    ?>
%</td>
          <td><?php 
    echo $so->return_60;
    ?>
%</td>

          <td><?php 
    echo format_int_to_string($so->i_raw_24);
    ?>
</td>
          <td><?php 
    echo format_int_to_string($so->o_raw_24);
    ?>
</td>
          <td><?php 
    echo format_int_to_string($so->c_raw_24);
    ?>
</td>
          <td style="padding: 2px 0px;">
            <div class="quality quality-good" style="width: <?php 
    echo $so->i_ctry_g_pct_24;
    ?>
%" title="Good: <?php 
    echo $so->i_ctry_g_pct_24;
    ?>
%"></div>
            <div class="quality quality-normal" style="width: <?php 
    echo $so->i_ctry_n_pct_24;
    ?>
%" title="Normal: <?php 
    echo $so->i_ctry_n_pct_24;
    ?>
%"></div>
            <div class="quality quality-bad" style="width: <?php 
    echo $so->i_ctry_b_pct_24;
    ?>
%" title="Bad: <?php 
    echo $so->i_ctry_n_pct_24;
    ?>
%"></div>
          </td>
          <td><?php 
    echo format_int_to_string($so->i_uniq_24);
    ?>
</td>
          <td><?php 
    echo $so->prod_24;
    ?>
%</td>
          <td><?php 
    echo $so->skim_24;
    ?>
%</td>
          <td><?php 
    echo $so->return_24;
    ?>
%</td>
        </tr>
<?php 
}
예제 #3
0
function _stats_overall_table_row($so, $menu = 'trade-action-menu', $system = false)
{
    $domain = htmlspecialchars($so->trade['domain']);
    $status = isset($so->trade['status']) ? $so->trade['status'] : null;
    $status_lc = strtolower($status);
    ?>
        <tr <?php 
    if (!empty($so->trade['color'])) {
        echo 'style="background-color: ' . $so->trade['color'] . ';"';
    }
    ?>
 id="item-<?php 
    echo $domain;
    ?>
" class="ta-right">
          <?php 
    if (!empty($menu)) {
        ?>
          <td class="ta-center">
            <input type="checkbox" value="<?php 
        echo $domain;
        ?>
"/>
          </td>
          <?php 
    }
    ?>
          <td class="va-middle" style="padding-right: 4px;"<?php 
    if (empty($menu)) {
        ?>
 colspan="2"<?php 
    }
    ?>
>
            <?php 
    if (isset($so->trade['return_url'])) {
        ?>
            <a href="<?php 
        echo $so->trade['return_url'];
        ?>
" target="_blank" class="trade-link fw-bold <?php 
        echo $status_lc;
        ?>
" title="<?php 
        echo $domain;
        ?>
 - <?php 
        echo $status;
        ?>
"><?php 
        echo $domain;
        ?>
</a>
            <?php 
    } else {
        echo '<b>' . $domain . '</b>';
    }
    if (!$system && !empty($menu)) {
        ?>
            <span class="trade-info-container">
              <img src="images/info-16x16.png" />
              <div class="trade-info" trade="<?php 
        echo $domain;
        ?>
"></div>
            </span>
            <?php 
    }
    if (!empty($menu)) {
        ?>
            <span class="icon-menu-container" menu="#<?php 
        echo $menu;
        ?>
" style="position: relative;"><img src="images/actions-16x16.png"/></span>
            <?php 
    }
    ?>
          </td>
          <td class="int"><?php 
    echo format_int_to_string($so->i_raw_60);
    ?>
</td>
          <td class="int"><?php 
    if ($system && $domain != 'Grand Total') {
        echo STATS_UNKNOWN;
    } else {
        echo format_int_to_string($so->o_raw_60);
    }
    ?>
</td>
          <td class="int"><?php 
    echo format_int_to_string($so->c_raw_60);
    ?>
</td>
          <td style="padding: 2px 0px;" class="qly">
            <div class="quality quality-good" style="width: <?php 
    echo $so->i_ctry_g_pct_60;
    ?>
%" title="Good: <?php 
    echo $so->i_ctry_g_pct_60;
    ?>
%"></div>
            <div class="quality quality-normal" style="width: <?php 
    echo $so->i_ctry_n_pct_60;
    ?>
%" title="Normal: <?php 
    echo $so->i_ctry_n_pct_60;
    ?>
%"></div>
            <div class="quality quality-bad" style="width: <?php 
    echo $so->i_ctry_b_pct_60;
    ?>
%" title="Bad: <?php 
    echo $so->i_ctry_b_pct_60;
    ?>
%"></div>
          </td>
          <td class="pct"><?php 
    echo $so->prod_60;
    ?>
%</td>
          <td class="pct"><?php 
    if ($system) {
        echo STATS_UNKNOWN;
    } else {
        echo $so->return_60;
    }
    ?>
%</td>

          <td class="column-separator" style="padding: 0; border: none;"></td>

          <td class="int" style="border-left: none;"><?php 
    echo format_int_to_string($so->i_raw_24);
    ?>
</td>
          <td class="int"><?php 
    if ($system && $domain != 'Grand Total') {
        echo STATS_UNKNOWN;
    } else {
        echo format_int_to_string($so->o_raw_24);
    }
    ?>
</td>
          <td class="int"><?php 
    echo format_int_to_string($so->c_raw_24);
    ?>
</td>
          <td style="padding: 2px 0px;" class="qly">
            <div class="quality quality-good" style="width: <?php 
    echo $so->i_ctry_g_pct_24;
    ?>
%" title="Good: <?php 
    echo $so->i_ctry_g_pct_24;
    ?>
%"></div>
            <div class="quality quality-normal" style="width: <?php 
    echo $so->i_ctry_n_pct_24;
    ?>
%" title="Normal: <?php 
    echo $so->i_ctry_n_pct_24;
    ?>
%"></div>
            <div class="quality quality-bad" style="width: <?php 
    echo $so->i_ctry_b_pct_24;
    ?>
%" title="Bad: <?php 
    echo $so->i_ctry_b_pct_24;
    ?>
%"></div>
          </td>
          <td class="int"><?php 
    echo format_int_to_string($so->i_uniq_24);
    ?>
</td>
          <td class="pct"><?php 
    echo $so->prod_24;
    ?>
%</td>
          <td class="pct"><?php 
    echo $so->skim_24;
    ?>
%</td>
          <td class="pct"><?php 
    if ($system) {
        echo STATS_UNKNOWN;
    } else {
        echo $so->return_24;
    }
    ?>
%</td>
        </tr>
<?php 
}
예제 #4
0
function _stats_hourly_table_row($sh, $menu = 'trade-action-menu')
{
    global $current_hour;
    $domain = htmlspecialchars($sh->trade['domain']);
    $status = $sh->trade['status'];
    $status_lc = strtolower($status);
    ?>
        <tr <?php 
    if (!empty($sh->trade['color'])) {
        echo 'style="background-color: ' . $sh->trade['color'] . ';"';
    }
    ?>
 id="item-<?php 
    echo $domain;
    ?>
" class="ta-right">
          <?php 
    if (!empty($menu)) {
        ?>
          <td class="ta-center">
            <input type="checkbox" value="<?php 
        echo $domain;
        ?>
"/>
          </td>
          <?php 
    }
    ?>
          <td class="va-middle" style="padding-right: 4px;"<?php 
    if (empty($menu)) {
        ?>
 colspan="2"<?php 
    }
    ?>
>
            <?php 
    if (isset($sh->trade['return_url'])) {
        ?>
            <a href="<?php 
        echo $sh->trade['return_url'];
        ?>
" target="_blank" class="trade-link-hourly fw-bold <?php 
        echo $status_lc;
        ?>
" title="<?php 
        echo $domain;
        ?>
 - <?php 
        echo $status;
        ?>
"><?php 
        echo $domain;
        ?>
</a>
            <?php 
    } else {
        echo $domain;
    }
    if (!$system && !empty($menu)) {
        ?>
            <span class="trade-info-container">
              <img src="images/info-16x16.png" />
              <div class="trade-info" trade="<?php 
        echo $domain;
        ?>
"></div>
            </span>
            <?php 
    }
    if (!empty($menu)) {
        ?>
            <span class="icon-menu-container" menu="#<?php 
        echo $menu;
        ?>
" style="position: relative;"><img src="images/actions-16x16.png"/></span>
            <?php 
    }
    ?>
          </td>
          <td class="triint" title="Prod: <?php 
    echo $sh->prod_24;
    ?>
%, Trade Prod: <?php 
    echo $sh->t_prod_24;
    ?>
%">
            <div class="multi-stat"><?php 
    echo format_int_to_string($sh->i_raw_24);
    ?>
</div>
            <div class="multi-stat"><?php 
    echo format_int_to_string($sh->o_raw_24);
    ?>
</div>
            <div class="multi-stat"><?php 
    echo format_int_to_string($sh->c_raw_24);
    ?>
</div>
          </td>
          <?php 
    for ($i = 0; $i < HOURS_PER_DAY; $i++) {
        ?>
          <td class="triint<?php 
        if ($current_hour == $i) {
            echo ' fw-bold';
        }
        ?>
" title="Prod: <?php 
        echo $sh->prod[$i];
        ?>
%, Trade Prod: <?php 
        echo $sh->t_prod[$i];
        ?>
%">
            <div class="multi-stat"><?php 
        echo format_int_to_string($sh->i_raw[$i]);
        ?>
</div>
            <div class="multi-stat"><?php 
        echo format_int_to_string($sh->o_raw[$i]);
        ?>
</div>
            <div class="multi-stat"><?php 
        echo format_int_to_string($sh->c_raw[$i]);
        ?>
</div>
          </td>
          <?php 
    }
    ?>
        </tr>
<?php 
}
예제 #5
0
파일: xhr.php 프로젝트: hackingman/TradeX
function _xSiteTemplatesReplace()
{
    global $compiler;
    $v =& Validator::Get();
    $v->Register(is_array($_REQUEST['templates']), VT_NOT_FALSE, 'You must select at least one template for this action');
    $v->Register($_REQUEST['search'], VT_NOT_EMPTY, 'The Search For field is required');
    if (is_array($_REQUEST['templates'])) {
        $templates = array();
        foreach ($_REQUEST['templates'] as $template) {
            $template = file_sanitize($template, 'tpl,css', 'tpl');
            $filename = DIR_TEMPLATES . "/{$template}";
            $templates[$template] = $filename;
            $v->Register($filename, VT_FILE_IS_WRITEABLE, "The template file {$template} has incorrect permissions; change to 666 then try again");
        }
    }
    if (!$v->Validate()) {
        return JSON::Warning(array(JSON_KEY_MESSAGE => 'Search and replace could not be executed; please fix the following items', JSON_KEY_WARNINGS => $v->GetErrors()));
    }
    require_once 'compiler.php';
    $search = string_format_lf($_REQUEST['search']);
    $replace = string_format_lf($_REQUEST['replace']);
    $replacements = 0;
    foreach ($templates as $template => $filename) {
        $template_code = file_get_contents($filename);
        $new_code = str_replace($search, $replace, $template_code);
        // Changes have been made
        if ($new_code != $template_code && ($code = $compiler->Compile($new_code)) !== false) {
            file_write($filename, $new_code);
            file_write(DIR_COMPILED . "/{$template}", $code);
            $replacements++;
        }
    }
    JSON::Success(array(JSON_KEY_MESSAGE => 'Search and replace has been completed.  Templates updated: ' . format_int_to_string($replacements), JSON_KEY_DIALOG => _xIncludeCapture('site-templates-replace.php')));
}