Example #1
0
function main($url, $user, $secret_key, $param)
{
    //加速乐开放API主函数
    ksort($param);
    $token = make_signiture($secret_key, $param);
    $header = make_header($user, $token);
    $postdata = http_build_query($param);
    $ret_cont = http_request($url, $postdata, $header);
    return $ret_cont;
}
Example #2
0
function bak()
{
    global $db;
    $fpath = "bak/" . date('Ymd', time()) . "_" . getRndStr(10);
    $sql = "";
    $p = 1;
    $tables = "{pre}art_topic,{pre}art_type,{pre}comment,{pre}gbook,{pre}link,{pre}mood,{pre}user,{pre}user_card,{pre}user_group,{pre}user_visit,{pre}vod_topic,{pre}vod_type,{pre}art,{pre}vod";
    $tables = replaceStr($tables, "{pre}", app_tablepre);
    $tablearr = explode(",", $tables);
    foreach ($tablearr as $table) {
        $sql .= make_header($table);
        $rsfield = $db->getTableFields(app_dbname, $table);
        $i = 0;
        while ($rowfield = mysql_fetch_field($rsfield)) {
            $fs[$i] = trim($rowfield->name);
            $i++;
        }
        unset($rsfield);
        $fsd = $i - 1;
        $nums = $db->getOne("select count(*) from {$table}");
        $pagecount = 1;
        if ($nums > 1000) {
            $pagecount = ceil($nums / 1000);
        }
        for ($n = 1; $n <= $pagecount; $n++) {
            $rsdata = $db->getAll("select * from {$table} limit " . 1000 * ($n - 1) . ",1000");
            $rscount = count($rsdata);
            $intable = "INSERT INTO `{$table}` VALUES(";
            for ($j = 0; $j < $rscount; $j++) {
                $line = $intable;
                for ($k = 0; $k <= $fsd; $k++) {
                    if ($k < $fsd) {
                        $line .= "'" . mysql_escape_string($rsdata[$j][$fs[$k]]) . "',";
                    } else {
                        $line .= "'" . mysql_escape_string($rsdata[$j][$fs[$k]]) . "');\r\n";
                    }
                }
                $sql .= $line;
                if (strlen($sql) >= 2000000) {
                    $fname = $fpath . "-" . $p . ".sql";
                    fwrite(fopen($fname, "wb"), $sql);
                    $p++;
                    $sql = "";
                }
            }
            unset($rsdata);
        }
        unset($fs);
    }
    $sql .= make_manager(replaceStr("{pre}manager", "{pre}", app_tablepre));
    $fname = $fpath . "-" . $p . ".sql";
    fwrite(fopen($fname, "wb"), $sql);
    echo "备份成功";
}
$title = $row["title"];
$basepath = $row["filename"];
$rootid = $row["id"];
$xslname = "xrai";
if ($id_pool) {
    $localisation[] = array("{$pool['name']}", "{$base_url}/pool.php?id_pool={$id_pool}", "Pool for topic {$pool['idtopic']}");
}
$i = sizeof($localisation);
do {
    if (DB::isError($row)) {
        fatal_error("Database error", $row->getUserInfo());
    }
    array_splice($localisation, $i, 0, array(array($row["filename"] != "" ? $row["filename"] : $row["collection"], "{$base_url}/collections/{$row['collection']}/{$row['filename']}?id_pool={$id_pool}", $row["title"])));
} while ($row["parent"] > 0 && ($row =& $xrai_db->getRow("SELECT * FROM {$db_files} WHERE id=?", array($row["parent"]))));
$up_url = $localisation[sizeof($localisation) - 2][1];
make_header("{$title}");
$xslfilename = dirname(__FILE__) . "/xsl/{$xslname}.xsl";
$xmlfilename = "{$xml_documents}/{$_SERVER['PATH_INFO']}/index.xrai";
// --- Retrieve assessments ---
if ($id_pool) {
    $res =& $xrai_db->query("SELECT * FROM {$db_statusview} WHERE rootid=? AND idpool={$id_pool}", array($rootid));
    if (DB::isError($res)) {
        non_fatal_error("Error while retrieving assessments", $res->getUserInfo());
    } else {
        while ($row = $res->fetchRow()) {
            $s = ($row["status"] == 2 ? 2 : 1) * ($row["inpool"] == $db_true ? 1 : -1);
            $assessments[$row["filename"]][$s] = $row["count"];
            $all_assessments[$s] += $row["count"];
            if (abs($row["status"]) != 3 && $row["count"] > 0) {
                $todojs .= ($todojs ? "," : "todo = new Array(") . "'{$row['filename']}'";
            }
Example #4
0
         if (write_file($sql, $filename)) {
             $msgs = "表-" . $_POST['tablename'] . "-数据备份完成,生成备份文件./backup/{$filename}";
         } else {
             $msgs = "备份表-" . $_POST['tablename'] . "-失败";
         }
         echo jsalert($msgs, "backup.php");
         exit;
     }
 } else {
     //分卷备份
     if (!$_POST['filesize']) {
         $msgs = "请填写备份文件分卷大小";
         echo jsalert($msgs, "backup.php");
         exit;
     }
     $sql = make_header($_POST['tablename']);
     $p = 1;
     $filename = date("Ymd", time()) . "_" . $_POST['tablename'];
     $db->query("select * from " . $_POST['tablename']);
     $num_fields = $db->nf();
     while ($db->nextrecord()) {
         $sql .= make_record($_POST['tablename'], $num_fields);
         if (strlen($sql) >= $_POST['filesize'] * 1000) {
             $filename .= "_v" . $p . ".sql";
             if (write_file($sql, $filename)) {
                 $msgs = "表-" . $_POST['tablename'] . "-卷-" . $p . "-数据备份完成,生成备份文件./backup/{$filename}";
             } else {
                 $msgs = "备份表-" . $_POST['tablename'] . "-失败";
             }
             $p++;
             $filename = date("Ymd", time()) . "_" . $_POST['tablename'];
Example #5
0
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
*/
require("include/xrai.inc");
if (!$is_root) {
   header("Location: index.php");
   exit;
}

make_header("Statistics");

$state = $_GET["state"];
$states = $xrai_db->getAssoc("SELECT state, count(*) FROM pools GROUP BY state");
if (DB::isError($res)) fatal_error("DB error",$res);

print "<h1>Pool states</h1><ul>";
foreach($states as $s => $n) {
      print "<li><a href=\"?state=$s\">$s</a> ($n pools)</li>";
   }
   print "</ul>";
   
if (!($states[$state] > 0)) {
   make_footer();
   exit();
}
Example #6
0
<?php

/**
 * 获取订单列表
 *
 * Author: yosolin
 * Date: 2016/01/13
 */
require_once "config.php";
require_once "functions.php";
require_once "header.php";
// api url与method
$http_url = "https://sandbox-tradeopen.futu5.com/orders";
// 生产环境去掉 'sandbox-'
$http_method = "GET";
// http请求body
$http_body = array();
// 生成http请求头部
$http_header = make_header($http_body, $http_url, $http_method, false, 'tc');
// http请求
$ret = ssl_curl($http_url, $http_method, $http_header, $http_body, Config::$ssl_cert, Config::$ssl_key);
echo $ret;

chdir("..");
include_once("include/xrai.inc");
include_once("include/assessments.inc");
include_once("admin/common.php");

$view_state = $_REQUEST["view_state"];
$action  = $_REQUEST["action"];

// Abort with user
ignore_user_abort(true);


if (!$pool_file) {
make_header("View pools" . ($view_state ? " - state \"$view_state\"" : "" ) );

// ---- Delete a pool

if ($action == "delete") {
  $expect = "I want to remove pool $_REQUEST[pool].";
  if ($_REQUEST["confirm"] == $expect) {
    sql_query("delete from $db_assessments where id_pool=$_REQUEST[pool]");
    sql_query("delete from $db_keywords where id_pool=$_REQUEST[pool]");
    sql_query("delete from $db_pools where id_pool=$_REQUEST[pool]");
    print "<div class='message'>Pool $_REQUEST[pool] was <em>deleted</em></div>";
  } else print "<div class='error'>Deletion was not confirmed (expected '$expect' and had '$confirm') </div>";
}

// ---- Clear a pool
if ($action == "clear") {
Example #8
0
       (c) B. Piwowarski, 2003
   */


require_once("include/xrai.inc");
require_once("include/astatus.inc");
// require_once("include/assessments.inc");

if (!$id_pool) {
   header("Location: index.php");
   exit;
}

if ($id_pool) $localisation[] = array("$pool[name]","$PHP_SELF", "Pool for topic $pool[idtopic]" );
make_header("Pool summary for topic $id_topic");


// Retrieve assessments


$todojs = "";
$res = &$xrai_db->query("SELECT sv.*,f.collection FROM $db_files f, $db_statusview sv WHERE f.parent is null AND f.id=sv.rootid AND idpool=?",array($id_pool));
if (DB::isError($res)) non_fatal_error("Error while retrieving assessments",$res->getUserInfo());
else {
   while ($row = $res->fetchRow()) {
      $s = ($row["status"] == 2 ? 2 : 1) * ($row["inpool"] == $db_true ? 1 : -1);
//       print "$row[collection] / $s / $row[inpool] $db_true / $row[count]<br/>";
      $a[$row["collection"]][$s] = $row["count"];
      $t[$s] = $row["count"];
      $total[$s]++;
Example #9
0
<?php

include "config.php";
// setting cookie back to neutral without $vars:
//setcookie("authacc");
require "account_inc.php";
// making header and title:
make_header("account: logout");
?>
Succesfully logged out!<br>
<a href="<?php 
// as defined in the config.php
echo $logout_url;
?>
">click here</a> to continue
<?php 
// making footerrr:
make_footer();
Example #10
0
			print "<div style='color:red'>Can't convert $currentfile#$attrs[path]</div>";
		} else {
 			if ($doit) sql_query("INSERT INTO $db_assessments (id_pool,in_pool,inferred,xid) VALUES ($new_id_pool, 'Y','N',$xid)","</div>");
//        $attrs[file]#$attrs[path]\n";
		}
		} else {
			print "<div style='color:red'>No current file for path $attrs[path]</div>";
		}
	}
}

function endElement($parser, $tagname) {
	if ($tagname == "file") $currentfile = false;
}

make_header("Adding a new pool");


$fsize = filesize($_FILES["pool_file"]['tmp_name']);
$cratio = 0;
$bytes_read = 0;

print "<div class='message'>Processing file " . $_FILES[pool_file][name] . "</div><div>";
if (!$doit) print "<div class='message'>Simulation (not inserting in database)</div>\n";
?>
<div style='background: red; width: 90%; padding: 0; margin: 5%;'>
<div id='progress' style='width: 0%; background: blue'>&nbsp;</div>
</div>
<script language="javascript">
var progress = document.getElementById("progress");
</script>
Example #11
0
<?php

require "include/page.php";
make_header("documentation", "Manual", "./", "@import \"manual.css\";");
?>
<h1 xmlns="http://www.w3.org/1999/xhtml" xmlns:doc="http://cssbox.sourceforge.net/docs">jStyleParser Manual</h1><p xmlns="http://www.w3.org/1999/xhtml" xmlns:doc="http://cssbox.sourceforge.net/docs" class="author">
			[ <a href="manual.html">Downloadable version</a> ]
		</p><div xmlns="http://www.w3.org/1999/xhtml" xmlns:doc="http://cssbox.sourceforge.net/docs" class="toc"><h2>Table of Contents</h2><ul><li><a href="#intro">Introduction</a></li><li><a href="#parsing">Style Sheet Parsing</a><ul><li><a href="#sheet">Parsed style sheet processing</a></li></ul></li><li><a href="#used">Obtaining the style sheets used in an HTML document</a></li><li><a href="#dom">DOM Analysis</a><ul><li><a href="#analyze">Analyzing a Style Sheet</a></li><li><a href="#direct">Simplified and Direct Usage Method</a></li><li><a href="#domstyle">Retrieving the Style of DOM Elements</a></li><li><a href="#pseudoelements">Obtaining the Style of Pseudo-Elements</a></li><li><a href="#pseudoclasses">Applying Pseudo-Classes</a></li></ul></li><li><a href="#media">Media</a><ul><li><a href="#media_parser">Automatic loading of imported style sheets</a></li><li><a href="#media_dom">DOM style analysis</a></li></ul></li><li><a href="#structure">Internal Structure of the Library</a><ul><li><a href="#package_css">Package cz.vutbr.web.css</a></li><li><a href="#package_csskit">Package cz.vutbr.web.csskit</a></li><li><a href="#package_domassign">Package cz.vutbr.web.domassign</a></li></ul></li><li><a href="#extend">Extending Current Version</a><ul><li><a href="#performance">Extending Performance</a></li></ul></li></ul></div><div xmlns="http://www.w3.org/1999/xhtml" xmlns:doc="http://cssbox.sourceforge.net/docs" class="section" id="intro"><h2>Introduction</h2><p>
jStyleParser is a Java library for parsing CSS style sheets and assigning styles to the HTML or XML
document elements according to the W3C CSS 2.1 specification and a subset of the CSS 3 specification.
It allows parsing the individual CSS files as well as computing the efficient style of the DOM elements.  
</p></div><div xmlns="http://www.w3.org/1999/xhtml" xmlns:doc="http://cssbox.sourceforge.net/docs" class="section" id="parsing"><h2>Style Sheet Parsing</h2><p>This functionality may be used for parsing individual style sheets obtained from a remote file (URL),
local file or a string. Three static methods are defined in the <a href="api/cz/vutbr/web/css/CSSFactory.html" class="api"><code>CSSFactory</code></a> class for
this purpose:</p><ul>
	<li><a href="api/cz/vutbr/web/css/CSSFactory.html#parse(java.net.URL, java.lang.String)" class="api"><code>StyleSheet parse(URL url, String encoding)</code></a>, the most general method. 
			Transforms data available at the given <code>url</code>, expecting given <code>encoding</code>,
			or taking the default one if it is not provided.,			
	</li>
	<li><a href="api/cz/vutbr/web/css/CSSFactory.html#parse(java.net.URL, cz.vutbr.web.css.NetworkProcessor, java.lang.String)" class="api"><code>StyleSheet parse(URL url, NetworkProcessor network, String encoding)</code></a> 
			that has the same effect as above with providing a custom <code>NetworkProcessor</code> (see below), 			
	</li>
	<li><a href="api/cz/vutbr/web/css/CSSFactory.html#parse(java.lang.String, java.lang.String)" class="api"><code>StyleSheet parse(String fileName, String encoding)</code></a>,
			which internally transforms the
			<code>fileName</code> into an URL and		
	</li>
	<li><a href="api/cz/vutbr/web/css/CSSFactory.html#parseString(java.lang.String, java.net.URL)" class="api"><code>StyleSheet parseString(String css, URL base)</code></a>,
			which can be used to parse embedded CSS declarations that is declarations between the &lt;style&gt; tags.
	</li>
</ul><p>During the parsing process, the parser automatically imports all the style sheets referenced using the <code>@import</code>
rules. See the <a href="#media">Media</a> section for further reference about how to limit this behavior to certain
media only or disable it completely.</p><p>For obtaining the imported style sheets referenced by their URLs, it is possible to provide a custom implementation
Example #12
0
<?
require_once("include/xrai.inc");

if ($_GET["error"]) {
   $r = mail("*****@*****.**","X-Rai bug report",stripcslashes($_GET["error"]),"reply-to: inex@poleia.lip6.fr");
   header("location: $PHP_SELF?errorm=" . rawurlencode(stripcslashes("$_GET[error]")) . "&success=" . $r . "&whattodo=". rawurlencode(stripcslashes($_GET["whattodo"])));
   exit;  
}

make_header("Bug report");

if (!$_GET["success"]) print "<div class='error'>The email could not be send. Please copy the following error message and send it to <a href=\"mailto:$xrai_admin_email\">$xrai_admin_email</a></div>";

print '<div style="margin-left: auto; margin-right: auto; margin-top: 0.3cm; padding: 5px; background: #ffeeee; border: solid 1px red">The following error message was sent:<div><code>' . nl2br(htmlspecialchars(stripcslashes($_GET["errorm"]))) . '</code></div></div>';

if (!empty($_GET["whattodo"])) print '<div style="margin: 5px; ">' . stripcslashes($_GET["whattodo"]) . '</div>';

make_footer();
?>
Example #13
0
function make_manager($table)
{
    $sql = make_header($table);
    $rsfield = $GLOBALS['db']->getTableFields($GLOBALS['MAC']['db']['name'], $table);
    $i = 0;
    while ($rowfield = mysql_fetch_field($rsfield)) {
        $fs[$i] = trim($rowfield->name);
        $i++;
    }
    unset($rsfield);
    $fsd = $i - 1;
    $rsdata = $GLOBALS['db']->getAll('select * from ' . $table);
    $rscount = count($rsdata);
    $intable = 'INSERT INTO ' . $table . ' VALUES(';
    for ($j = 0; $j < $rscount; $j++) {
        $line = $intable;
        for ($k = 0; $k <= $fsd; $k++) {
            if ($k < $fsd) {
                $line .= "'" . mysql_escape_string($rsdata[$j][$fs[$k]]) . "',";
            } else {
                $line .= "'" . mysql_escape_string($rsdata[$j][$fs[$k]]) . "');\r\n";
            }
        }
        $sql .= $line;
    }
    unset($fs);
    unset($rsdata);
    return $sql;
}
Example #14
0
<?

include_once("../inex.inc");
include_once("common.php");
make_header("Admin");

?>
<dl>
<dt><a href="add_pool.php">Add a pool</a></dt><dd>Add a new pool</dd>
<dt><a href="manage_pools.php">Manage pools</a></dt><dd>Update, edit, view statistics</dd>
</dl>

<?

make_footer();

?>
Example #15
0
<?php

session_start();
include '../phpfunction.php';
if ($_SESSION['user'] == 0) {
    header("Location: ../index.php");
}
echo "<html>";
echo make_header('../');
?>

<style>
.clr {
	clear: both;
	font-size: 0;
	height: 0;
}

#filelist {
	width: 50%;
	float: left;
	height: 500px;
	overflow-y: scroll;
}

#preview-wrapper {
	width: 50%;
	float: left;
	height: 500px;
}
Example #16
0
// post id
$xslfilename = dirname(__FILE__) . "/xsl/" . $row[4] . ".xsl";
$xmlfilename = "{$xml_documents}/{$collection}/{$file}.xml";
// Begins output
if ($id_pool) {
    $localisation[] = array("{$pool['name']}", "pool.php?id_pool={$id_pool}", "Pool for topic {$pool['id_pool']}");
}
$i = sizeof($localisation);
while ($row["parent"] != $row["name"] && ($row = sql_get_row("SELECT * FROM {$collection}_{$db_files} WHERE name='{$row['parent']}'", false))) {
    array_splice($localisation, $i, 0, array(array($row["name"], "{$base_url}/collections/{$row['name']}?id_pool={$id_pool}", $row["title"])));
}
$up_url = $localisation[sizeof($localisation) - 1][1];
$localisation[] = array("File {$file}", "{$PHP_SELF}?id_pool={$id_pool}&amp;file={$file}", "{$title}");
add_icon("img_treeview", "{$base_url}/img/tree.png", "Tree view (shift + T)", "javascript:void(0)", "toggle_treeview()", '<div class="help_top">Displays/hides the panel with the tree view of the XML document, where only tag names appear. In this panel, you can click on any tag name to view it in the main document view.<br/><b>Shortcut</b>: hold <code>shift</code> and press <code>t</code></div>');
add_icon("img_bookmarks", "{$base_url}/img/trombone.png", "Bookmarks (shift + B)", "javascript:void(0)", "toggle_bookmarks()", '<div class="help_top">Displays/hides the panel with the current document bookmarks. In this panel, you can click on any displayed path to view it in the main document view.<br/><b>Shortcut</b>: hold <code>shift</code> and press <code>b</code></div>');
make_header($title);
$force_update = $_GET["force"];
if (!$force_update) {
    $force_update = 0;
}
$no_mathml = $force_update == 2;
// 2nd update ==> no mathml
?>
<!-- Our own style & js -->
<link rel="stylesheet" href="<?php 
echo $base_url;
?>
/css/article.css" />
<link rel="stylesheet" id="tags_css" href="<?php 
echo $base_url;
?>
Example #17
0
File: db.php Project: klarclm/sgv
        }
        ob_flush();
        flush();
        showMsg('共有' . $fcount . '个备份分卷文件需要还原,正在还原第' . $num . '个文件...', '?m=db-reduction-num-' . ($num + 1) . '-fcount-' . $fcount . '-file-' . $file);
    }
} elseif ($method == 'bak') {
    $fpath = 'bak/' . date('Ymd', time()) . '_' . getRndStr(10);
    $sql = '';
    $p = 1;
    $tables = ' `{pre}art_relation` , `{pre}art_topic` , `{pre}art_type` , `{pre}comment` , `{pre}gbook` , `{pre}link` , `{pre}user` , `{pre}user_card` , `{pre}user_group` , `{pre}user_pay` , `{pre}user_visit`  , `{pre}vod_relation` , `{pre}vod_topic` , `{pre}vod_type`, `{pre}vod_class` , `{pre}art`, `{pre}vod`';
    $tables = str_replace('{pre}', $GLOBALS['MAC']['db']['tablepre'], $tables);
    $tablearr = explode(',', $tables);
    $pagesize = 800;
    foreach ($tablearr as $table) {
        $table = trim($table);
        $sql .= make_header($table);
        $i = 0;
        $fs = array();
        $res = $db->query("SHOW COLUMNS FROM " . $table);
        while ($row = mysql_fetch_array($res)) {
            $fs[] = $row[0];
        }
        unset($res);
        $fsd = count($fs) - 1;
        $nums = $db->getOne('select count(*) from ' . $table);
        $pagecount = 1;
        if ($nums > $pagesize) {
            $pagecount = ceil($nums / $pagesize);
        }
        for ($n = 1; $n <= $pagecount; $n++) {
            $rsdata = $db->getAll('select * from ' . $table . ' limit ' . $pagesize * ($n - 1) . ',' . $pagesize);
Example #18
0
<?php

/**
 * 改单
 *
 * Author: yosolin
 * Date: 2016/01/13
 */
require_once "config.php";
require_once "functions.php";
require_once "header.php";
// api url与method
$http_url = "https://sandbox-tradeopen.futu5.com/orders/47";
// 生产环境去掉 'sandbox-',12为订单ID
$http_method = "PUT";
// http请求body
$http_body = array('action' => 1, 'quantity' => 200, 'price' => 1.5);
// 生成http请求头部
$http_header = make_header($http_body, $http_url, $http_method, true);
// http请求
$ret = ssl_curl($http_url, $http_method, $http_header, $http_body, Config::$ssl_cert, Config::$ssl_key);
echo $ret;
Example #19
0
    }
    include "usecode/{$data}.dat";
    if (isset($relation_data) && is_array($relation_data) && count($relation_data) > 0) {
        $list = array();
        foreach ($relation_data as $reldata) {
            if (array_key_exists($DATAFILE, $reldata)) {
                $list = $reldata[$DATAFILE];
                break;
            }
        }
        if (count($list) > 0) {
            $listout = array();
            foreach ($list as $key => $item) {
                if (!($item === $DATAFILE)) {
                    $listout[] = inline_code($item);
                }
            }
            if (count($listout) > 0) {
                make_header("Related {$relations}", false);
                add_list($listout, true, 0);
            }
        }
    }
    if (isset($seealso) && is_array($seealso) && count($seealso) > 0) {
        make_header("See also", false);
        add_list($seealso, true, 0);
    }
}
empty_submenubar();
$tpl->parse("MAIN", "main");
$tpl->FastPrint();
Example #20
0
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
*/
include_once "include/xrai.inc";
make_header("Home");
print "<h1>Choose a pool</h1>";
$qh = $xrai_db->query("select * from {$db_pools} " . ($is_root ? "" : " where login='******' ") . " order by id");
if (DB::isError($qh)) {
    print "<div class=\"warning\">Error while retrieving pools</div>";
    if ($do_debug) {
        print "<div>" . $qh->getUserInfo() . "</div>";
    }
} else {
    print "<ul>";
    while ($row = $qh->fetchRow(DB_FETCHMODE_ASSOC)) {
        $name = "Pool for topic {$row['idtopic']}" . ($is_root ? " ({$row['login']})" : "");
        print "<li><a href='pool.php?id_pool={$row['id']}'>{$name}</a></li>";
    }
    print "</ul>";
}
Example #21
0
        $auth = true;
    }
    if (!$auth) {
        // message when cookie is cheated:
        echo 'Invalid cookie!';
        exit;
    }
} else {
    echo "nao achei cookie";
    // the stuff that happens when cookie is not set:
    //requiring the layout file:
    require "account_inc.php";
    // this makes the header, and fills up the header title
    make_header("account: main title");
    // short login message
    echo "Please <a href=\"account_login.php\">login</a>";
    // making the footer:
    make_footer();
    exit;
}
require "account_inc.php";
// this makes the header, and fills up the header title
make_header("account: main <--= title");
?>

ACCOUNT CONTENT
<a href="account_logout.php">logout</a>

<?php 
// making the footer:
make_footer();
Example #22
0
	<tr><th>Keywords II (null, true, false etc)</th><td><input type="text" name="keywords-2" value="color: #000; font-weight: bold;" /></td></tr>
	<tr><th>Inbuilt Functions (echo, print etc)</th><td><input type="text" name="keywords-3" value="color: #000066;" /></td></tr>
	<tr><th>Data Types (int, boolean etc)</th><td><input type="text" name="keywords-4" value="color: #f63333;" /></td></tr>

	<tr><th>Comments (//, <!--  --> etc)</th><td><input type="text" name="comments" value="color: #808080;" /></td></tr>
	<tr><th>Escaped Characters (\\n, \\t etc)</th><td><input type="text" name="escaped-chars" value="color: #000033; font-weight: bold;" /></td></tr>
	<tr><th>Brackets ( ([{}]) etc)</th><td><input type="text" name="brackets" value="color: #66cc66;" /></td></tr>
	<tr><th>Strings ("foo" etc)</th><td><input type="text" name="strings" value="color: #ff0000;" /></td></tr>
	<tr><th>Numbers (1, -54, 2.5 etc)</th><td><input type="text" name="numbers" value="color: #ff33ff;" /></td></tr>
	<tr><th>Methods (Foo.bar() etc)</th><td><input type="text" name="methods" value="color: #006600;" /></td></tr>
</table>';
    echo '<input type="hidden" name="geshi-path" value="' . realpath($geshi_path) . '" /><input type="hidden" name="geshi-lang-path" value="' . realpath($geshi_lang_path) . '" />
<input type="submit" value="Step 3" /></form>';
    make_footer();
} elseif ($step == 3) {
    make_header('Step 3');
    echo '<p>Here is your completed stylesheet. Note that it may not be perfect - no regular expression styles are included for one thing,
you\'ll have to add those yourself (php and xml are just two languages that use them), and line numbers are not included, however
it includes most of the basic information.</p>';
    // Make the stylesheet
    $part_selector_1 = '';
    $part_selector_2 = '';
    $part_selector_3 = '';
    $langs = get_var('langs');
    $extra_langs = trim(get_var('extra-langs'));
    if ($extra_langs != '') {
        $l = explode("\r\n", $extra_langs);
        foreach ($l as $lng) {
            $langs[$lng] = true;
        }
    }
    echo $path;
    ?>
componentframework.js'></script>
	</head>
	<body>
		<a href='http://www.wwu.edu'><img src='<?php 
    echo $path;
    ?>
images.jpg'></a>
		<div class='title'>Computer Science Department Virtual Tour</div>
		<hr>
		</br>	
	<?php 
    return ob_get_clean();
}
$header = make_header();
function footer($more)
{
    $html = "\n\t\t</br></br>\n\t\t<hr>\n\t\t<h3>" . $more . "<a href='index.php'>Logout</a>\n\t\t</h3>\n\t\t</body>\n\t\t</html>\n\t";
    return $html;
}
function get_map_list()
{
    global $link;
    $query = "SELECT * FROM maps ORDER BY `ordering` ASC";
    $result = mysqli_query($link, $query);
    $maps = array();
    if ($result) {
        while ($row = mysqli_fetch_array($result)) {
            $maps[$row["id"]] = $row;
        }