Beispiel #1
0
    function printheader($title, $topleft = 'QMS', $topright = 'Quote Management System')
    {
        ob_start();
        header('Content-type: text/html; charset=utf-8');
        // begin editing after this line
        ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
 <title><?php 
        echo $title;
        ?>
</title>
 <link rel="alternate" type="text/xml" title="RSS" href="?rss" />
 <meta name="robots" content="noarchive,nofollow" />
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
 <style type="text/css" media="all">
  @import "./templates/rash/style.css";
 </style>
</head>
<body>
 <div id="rash_head_container">
 <div id="rash_head"><div id="rash_rash"><?php 
        echo $topleft;
        ?>
</div><div id="rash_qms"><?php 
        echo $topright;
        ?>
</div></div>
 </div>
 <div id="site_all">
  <div id="site_image">
  </div>
  <div id="site_nav">
<?php 
        print $this->get_menu();
        if (!isset($_SESSION['logged_in'])) {
            print '<a href="?' . urlargs('admin') . '" id="site_nav_admin">' . lang('menu_admin') . '</a>';
        } else {
            print sprintf(lang('logged_in_as'), htmlspecialchars($_SESSION['user']));
        }
        ?>
  </div>
<?php 
    }
Beispiel #2
0
    function printheader($title, $topleft = 'Owned', $topright = 'Quote Database')
    {
        $this->set_menu_join_str(' / ');
        header('Content-type: text/html; charset=utf-8');
        ob_start();
        // begin editing after this line
        ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
 <title><?php 
        echo $title;
        ?>
</title>
 <meta name="robots" content="noarchive,nofollow" />
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
 <link rel="icon" type="image/png" href="./templates/owned/favicon.png">
 <link rel="alternate" type="application/rss+xml" href="?rss" title="RSS">
 <style type="text/css" media="all">
  @import "./templates/owned/style.css";
 </style>
</head>
<body>
 <div id="site_all">
  <div id="site_nav">
   <div id="site_nav_upper">
      <div id="site_nav_upper_qms"><?php 
        echo $topleft;
        ?>
</div>&nbsp;
      <div id="site_nav_upper_qms-long"><?php 
        echo $topright;
        ?>
</div>
<?php 
        if (!isset($_SESSION['logged_in'])) {
            print '<a href="?' . urlargs('admin') . '" id="site_nav_admin">' . lang('menu_admin') . '</a>';
        } else {
            print '<span id="logged_in_as">' . sprintf(lang('logged_in_as'), htmlspecialchars($_SESSION['user'])) . '</span>';
        }
        print '</div>';
        print $this->get_menu();
        print '</div>';
        print '<div id="content">';
    }
Beispiel #3
0
    function printheader($title, $topleft = 'QMS', $topright = 'Quote Management System')
    {
        ob_start();
        // begin editing after this line
        ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
 <title><?php 
        echo $title;
        ?>
</title>
 <meta name="robots" content="noarchive,nofollow" />
 <link rel="alternate" type="application/rss+xml" href="?rss" title="RSS">
 <style type="text/css" media="all">
  @import "./templates/bash/style.css";
 </style>
</head>
<body>
 <div id="site_all">
  <div id="site_nav">
   <div id="site_nav_upper">
      <div id="site_nav_upper_qms-long"><?php 
        echo $topright;
        ?>
    </div>
      <div id="site_nav_upper_qms"><?php 
        echo $topleft;
        ?>
    </div>&nbsp;
<?php 
        if (!isset($_SESSION['logged_in'])) {
            print '<a href="?' . urlargs('admin') . '" id="site_nav_admin">' . lang('menu_admin') . '</a>';
        } else {
            print sprintf(lang('logged_in_as'), htmlspecialchars($_SESSION['user']));
        }
        print '</div>';
        print $this->get_menu();
        print '</div>';
        print $this->get_messages();
    }
   function flag_page($quoteid, $quotetxt, $flag)
   {
       global $CAPTCHA;
       $str = '';
       $str .= '<h1>' . lang('flag_quote_title') . '</h1>';
       $str .= $this->get_messages();
       if ($flag == 0) {
           $str .= '<p>' . lang('flag_quote_explanation');
       }
       $str .= '<div class="quote_quote">' . $quotetxt . '</div>';
       if ($flag == 0) {
           $str .= '<form action="?' . urlargs('flag', $quoteid, 'verdict') . '" method="post">';
           $str .= $CAPTCHA->get_CAPTCHA('flag');
           $str .= '<input type="submit" value="' . lang('flag_quote_submit_btn') . '" />
  <input type="reset" value="' . lang('flag_quote_reset_btn') . '" />
 </form>';
       }
       return $str;
   }
Beispiel #5
0
    function quote_iter($quoteid, $rating, $quotetxt, $canflag, $canvote, $date = null)
    {
        $str = '<div class="quote_whole" id="q' . $quoteid . '">
    <div class="quote_separator">&nbsp;</div>
    <div class="quote_option-bar">
     <a href="?' . urlargs($quoteid) . '" class="quote_number">#' . $quoteid . '</a>' . ' ' . $this->quote_upvote_button($quoteid, $canvote, TRUE) . ' ' . '<span class="quote_rating">(<span id="quote_rating_' . $quoteid . '">' . $rating . '</span>)</span>' . ' ' . $this->quote_downvote_button($quoteid, $canvote, TRUE) . ' ' . $this->quote_flag_button($quoteid, $canflag) . ' ' . edit_quote_button($quoteid);
        if (isset($date)) {
            $str .= "     <span class=\"quote_date\">" . $date . "</span>\n";
        }
        $str .= '
    </div>
    <div class="quote_quote">
     ' . $quotetxt . '
    </div>
   </div>
';
        return $str;
    }
Beispiel #6
0
function page_numbers($origin, $quote_limit, $page_default, $page_limit)
{
    global $CONFIG, $db;
    $numrows = $db->getOne("SELECT COUNT(id) FROM " . db_tablename('quotes') . ' WHERE queue=0');
    $testrows = $numrows;
    $pagenum = 0;
    $ret = '';
    do {
        $pagenum++;
        $testrows -= $quote_limit;
    } while ($testrows > 0);
    if (!($page_limit % 2)) {
        $page_limit += 1;
    }
    if ($page_limit == 1 || $page_limit < 0 || !$page_limit) {
        $page_limit = 5;
    }
    $page_base = 0;
    do {
        $page_base++;
        $page_limit -= 2;
    } while ($page_limit > 1);
    $ret .= "<div class=\"quote_pagenums\">";
    $ret .= "<a href=\"?" . urlargs(strtolower($origin), '1') . "\">" . lang('page_first') . "</a>&nbsp;&nbsp;";
    $ret .= "<a href=\"?" . urlargs(strtolower($origin), $page_default - 10 > 1 ? $page_default - 10 : 1) . "\">-10</a>&nbsp;&nbsp;";
    if ($page_default - $page_base > 1) {
        $ret .= "&nbsp;...&nbsp;";
    }
    $x = $page_default - $page_base;
    do {
        if ($x > 0) {
            $ret .= "&nbsp;<a href=\"?" . urlargs(strtolower($origin), $x) . "\">{$x}</a>&nbsp;";
        }
        $x++;
    } while ($x < $page_default);
    $ret .= "&nbsp;{$page_default}&nbsp;";
    $x = $page_default + 1;
    do {
        if ($x <= $pagenum) {
            $ret .= "&nbsp;<a href=\"?" . urlargs(strtolower($origin), $x) . "\">{$x}</a>&nbsp;";
        }
        $x++;
    } while ($x < $page_default + $page_base + 1);
    if ($page_default + $page_base < $pagenum) {
        $ret .= "&nbsp;...&nbsp;";
    }
    $ret .= "&nbsp;&nbsp;<a href=\"?" . urlargs(strtolower($origin), $page_default + 10 < $pagenum ? $page_default + 10 : $pagenum) . "\">+10</a>&nbsp;&nbsp;";
    $ret .= "&nbsp;&nbsp;<a href=\"?" . urlargs(strtolower($origin), $pagenum) . "\">" . lang('page_last') . "</a>";
    $ret .= "</div>\n";
    return $ret;
}
Beispiel #7
0
function page_numbers($origin, $quote_limit, $page_default, $page_limit)
{
    global $CONFIG, $db;
    $numrows = $db->query("SELECT COUNT(id) AS cnt FROM " . db_tablename('quotes') . ' WHERE (flag!=3)')->fetch();
    $testrows = $numrows['cnt'];
    $parts = array();
    $pagenum = 0;
    $sep = '<span class="sep">&nbsp;&nbsp;</span>';
    $skipamount = 10;
    do {
        $pagenum++;
        $testrows -= $quote_limit;
    } while ($testrows > 0);
    if (!($page_limit % 2)) {
        $page_limit += 1;
    }
    if ($page_limit == 1 || $page_limit < 0 || !$page_limit) {
        $page_limit = 5;
    }
    $page_base = 0;
    do {
        $page_base++;
        $page_limit -= 2;
    } while ($page_limit > 1);
    if ($page_default != 1) {
        array_push($parts, '<a class="first" href="?' . urlargs(strtolower($origin), '1') . '">' . lang('page_first') . '</a>');
    } else {
        array_push($parts, '<span class="first">' . lang('page_first') . '</span>');
    }
    if ($page_default - $skipamount >= 1) {
        array_push($parts, '<a class="skipback" href="?' . urlargs(strtolower($origin), $page_default - $skipamount > 1 ? $page_default - $skipamount : 1) . '">' . -$skipamount . '</a>');
    } else {
        array_push($parts, '<span class="skipback">' . -$skipamount . '</span>');
    }
    if ($page_default - $page_base > 1) {
        array_push($parts, '<span class="ellipsis">...</span>');
    } else {
        array_push($parts, '<span class="noellipsis"></span>');
    }
    $x = $page_default - $page_base;
    do {
        if ($x > 0) {
            array_push($parts, '<a href="?' . urlargs(strtolower($origin), $x) . '">' . $x . '</a>');
        } else {
            array_push($parts, '<span class="nopage"></span>');
        }
        $x++;
    } while ($x < $page_default);
    array_push($parts, '<span class="currpage"><b>' . $page_default . '</b></span>');
    $x = $page_default + 1;
    do {
        if ($x <= $pagenum) {
            array_push($parts, '<a href="?' . urlargs(strtolower($origin), $x) . '">' . $x . '</a>');
        } else {
            array_push($parts, '<span class="nopage"></span>');
        }
        $x++;
    } while ($x < $page_default + $page_base + 1);
    if ($page_default + $page_base < $pagenum) {
        array_push($parts, '<span class="ellipsis">...</span>');
    } else {
        array_push($parts, '<span class="noellipsis"></span>');
    }
    if ($page_default + $skipamount <= $pagenum) {
        array_push($parts, '<a class="skipfwd" href="?' . urlargs(strtolower($origin), $page_default + $skipamount < $pagenum ? $page_default + $skipamount : $pagenum) . '">+' . $skipamount . '</a>');
    } else {
        array_push($parts, '<span class="skipfwd">+' . $skipamount . '</span>');
    }
    if ($page_default < $pagenum) {
        array_push($parts, '<a class="last" href="?' . urlargs(strtolower($origin), $pagenum) . '">' . lang('page_last') . '</a>');
    } else {
        array_push($parts, '<span class="last">' . lang('page_last') . '</span>');
    }
    return '<div class="quote_pagenums">' . join($sep, $parts) . "</div>\n";
}