예제 #1
0
 public function getTotal($type, $filters)
 {
     switch ($type) {
         case 'sales':
             $sql = $this->getDataSales($filters);
             break;
         case 'customer':
             $sql = $this->getDataCustomer($filters);
             break;
         case 'returns':
             $sql = $this->getDataReturns($filters);
             break;
         case 'coupons':
             $sql = $this->getDataCoupons($filters);
             break;
         case 'products_viewed':
             $sql = $this->getDataViews($filters);
             break;
         case 'products_sales':
             return $this->getDataProductSales($filters);
             break;
     }
     if (!empty($sql)) {
         $sql = str_replace('SELECT', 'SELECT COUNT(*) AS get_total_' . $type . '/* ', $sql);
         $sql = str_replacE('FROM', '*/ FROM', $sql);
         $result = $this->query($sql);
         if ($result) {
             $result = $result->fetch();
             if (isset($result['get_total_' . $type])) {
                 return $result['get_total_' . $type];
             }
         }
     }
     return 0;
 }
예제 #2
0
 public function compile($page_id = NULL)
 {
     $pages = $this->getData()->get();
     $this->output = array();
     // Apply spacing and build output
     foreach ($pages as $page_id => $page) {
         if ($this->getShowPageIds()) {
             $tag = $this->getSettings()->pageTag;
             $this->output[] = "<{$tag}>{$page_id}</{$tag}>";
         }
         foreach ($page as $record) {
             $this->output[] = "<hr />";
             $class = $this->cssSafe($page_id);
             $data = str_replacE('"', '\\"', $page_id);
             $this->output[] = "<table class=\"page {$class}\" data-page=\"{$data}\">";
             $this->output[] = "<tbody>";
             $odd = TRUE;
             foreach ($record as $key => $value) {
                 $zebra = $odd ? 'odd' : 'even';
                 $odd = !$odd;
                 $this->output[] = "<tr class=\"{$zebra}\"><td class=\"key\">{$key}</td><td class=\"value\">{$value}</td></tr>";
             }
             $this->output[] = "</tbody>";
             $this->output[] = "</table>";
         }
     }
     $this->output = implode(PHP_EOL, $this->output);
 }
예제 #3
0
    echo $i;
    ?>
'><?php 
    echo $i;
    ?>
</label>
    </div>
    <div class='col-md-9'>
<?php 
    // Don't allow aliases to have zones. Only real interfaces can.
    if (strpos($i, ":") !== false) {
        list($tmpint) = explode(":", $i);
        $parent = str_replace(".", "_", $tmpint);
        $disabled = true;
    } else {
        $parent = str_replacE(".", "_", $i);
        $disabled = false;
    }
    ?>
      <span class='radioset zoneset'>
<?php 
    foreach ($z as $zn => $zone) {
        if ($zn === $currentzone) {
            $active = "active";
            $checked = "checked";
        } else {
            $active = "";
            $checked = "";
        }
        print "<input class='p{$parent} v{$zn}' data-parent='{$parent}' type='radio' name='int-{$i}' id='int-{$i}-{$zn}' value='{$zn}' {$checked}><label for='int-{$i}-{$zn}'>" . $zone['name'] . "</label>\n";
    }
예제 #4
0
         $colors = array($rawscores);
         //scorestocolors($rawscores,1,0,false);
     }
 } else {
     $colors = array();
 }
 displayq(0, $_GET['qsetid'], $seed, true, true, $attempt, false, false, false, $colors);
 echo "<input type=submit value=\"Submit\"><input type=submit name=\"regen\" value=\"Submit and Regen\">\n";
 echo "<input type=button value=\"White Background\" onClick=\"whiteout()\"/>";
 echo "<input type=button value=\"Show HTML\" onClick=\"document.getElementById('qhtml').style.display='';\"/>";
 echo "</form>\n";
 echo '<code id="qhtml" style="display:none">';
 $message = displayq(0, $_GET['qsetid'], $seed, false, false, 0, true);
 $message = printfilter(forcefiltergraph($message));
 $message = preg_replace('/(`[^`]*`)/', "<span class=\"AM\">\$1</span>", $message);
 $message = str_replacE('`', '\\`', $message);
 echo htmlentities($message);
 echo '</code>';
 if (isset($CFG['GEN']['sendquestionproblemsthroughcourse'])) {
     echo "<p>Question id: {$_GET['qsetid']}.  <a href=\"{$imasroot}/msgs/msglist.php?add=new&cid={$CFG['GEN']['sendquestionproblemsthroughcourse']}&to={$line['ownerid']}&title=Problem%20with%20question%20id%20{$_GET['qsetid']}\" target=\"_blank\">Message owner</a> to report problems</p>";
 } else {
     echo "<p>Question id: {$_GET['qsetid']}.  <a href=\"mailto:{$line['email']}?subject=Problem%20with%20question%20id%20{$_GET['qsetid']}\">E-mail owner</a> to report problems</p>";
 }
 echo "<p>Description: {$line['description']}</p><p>Author: {$line['author']}</p>";
 echo "<p>Last Modified: {$lastmod}</p>";
 if ($line['deleted'] == 1) {
     echo '<p style="color:red;">This question has been marked for deletion.  This might indicate there is an error in the question. ';
     echo 'It is recommended you discontinue use of this question when possible</p>';
 }
 if ($line['replaceby'] > 0) {
     echo '<p style="color:red;">This message has been marked as deprecated, and it is recommended you use question ID ' . $line['replaceby'] . ' instead.  You can find this question ';