示例#1
0
function dir_header($title)
{
    echo common_header($title);
    echo <<<_END
  <link rel="stylesheet" href="/css/styles.css">
_END;
    begin_body();
}
/**
 * Smart Restaurant
 *
 * An open source application to manage restaurants
 *
 * @package		SmartRestaurant
 * @author		Gjergj Sheldija
 * @copyright	Copyright (c) 2008-2012, Gjergj Sheldija
 * @license		http://www.gnu.org/licenses/gpl.txt
 * @since		Version 1.0
 * @filesource
 * 
 *  Smart Restaurant is free software: you can redistribute it and/or modify
 *	it under the terms of the GNU General Public License as published by
 *	the Free Software Foundation, version 3 of the License.
 *
 *	Smart Restaurant 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 General Public License for more details.
 *	You should have received a copy of the GNU General Public License
 *	along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */
function check_db_status()
{
    $query = "USE `" . $_SESSION['common_db'] . '`';
    $res = common_query($query, __FILE__, __LINE__, true);
    if (!$res) {
        $url = ROOTDIR . '/install/install.php';
        header('Location: ' . $url);
        $error_msg = common_header('Database not found');
        $error_msg .= redirectJS($url);
        $error_msg .= 'DB not found. Going to installation page.';
        $error_msg .= common_bottom();
        echo $error_msg;
        die;
    }
    $query = "SHOW TABLES";
    $tableslist = common_query($query, __FILE__, __LINE__, true);
    // this is unlikely to happen
    if (!$tableslist) {
        $url = ROOTDIR . '/install/install.php';
        header('Location: ' . $url);
        $error_msg = common_header('Database tables not found');
        $error_msg .= redirectJS($url);
        $error_msg .= 'No table found on the database. Going to installation page.';
        $error_msg .= common_bottom();
        echo $error_msg;
        die;
    }
    $numtables = mysql_num_rows($tableslist);
    if (!$numtables) {
        $url = ROOTDIR . '/install/install.php';
        header('Location: ' . $url);
        $error_msg = common_header('Database tables not found');
        $error_msg .= redirectJS($url);
        $error_msg .= 'No table found on the database. Going to installation page.';
        $error_msg .= common_bottom();
        echo $error_msg;
        die;
    }
}
/*
The next if contains a primitive access control
to avoid that 2 waiters simultaneously work on the same table

this is done by updating a timestamp field in the sources table
and by checking (if the waiter changed)
if the elapsed time from the last update is > than the config lock_time
*/
if (isset($_SESSION['sourceid']) && $_SESSION['sourceid']) {
    if (table_lock_check($_SESSION['sourceid'])) {
        $remaining_time = table_lock_remaining_time($_SESSION['sourceid']);
        $user = new user($_SESSION['userid']);
        if ($remaining_time == 0) {
            $remaining_time = 1;
        }
        $error_msg = common_header('Tavolina ne perdorim');
        $error_msg .= navbar_lock_retry_pos('');
        $error_msg .= ucfirst(phr('TABLE_ALREADY_IN_USE_ERROR')) . ' ' . '.<br><br>' . "\n";
        $error_msg .= ucfirst(phr('IF_YOU_ARE_NOT_DISCONNECT_0')) . ' <b>' . $user->data['name'] . '</b> ' . ucfirst(phr('IF_YOU_ARE_NOT_DISCONNECT_1')) . '<br>' . "\n";
        $error_msg .= common_bottom();
        die($error_msg);
    }
}
/*
We get the printed categories flag, and write to $_SESSION['catprinted'][]
*/
if (isset($_SESSION['sourceid'])) {
    $query = "SELECT * FROM `sources` WHERE `id`='" . $_SESSION['sourceid'] . "'";
    $res = common_query($query, __FILE__, __LINE__);
    if (!$res) {
        return ERR_MYSQL;
示例#4
0
<?php

include "../include/functions.php";
$TITLE = "Sample Test [PHP-QAT: Quality Assurance Team]";
$SITE_UPDATE = date("D M d H:i:s Y T", filectime(__FILE__));
/* $Id$ */
common_header();
?>

<div style="padding: 10px">
<h1>Sample Test: skipif2.inc</h1>
<p>Back to &quot;<a href="../phpt_details.php">PHPT Test File Layout</a>&quot;</p>
<pre>&lt;?php
  if (!extension_loaded(&#039;soap&#039;)) die(&#039;skip soap extension not available&#039;);
?&gt;
</pre>
<p>Back to &quot;<a href="../phpt_details.php">PHPT Test File Layout</a>&quot;</p>
</div>

<?php 
common_footer();
 $tableslist = mysql_list_tables($db_common, $link);
 $numtables = mysql_num_rows($tableslist);
 if ($numtables == 0) {
     die(GLOBALMSG_DB_NO_TABLES_ERROR);
 }
 $_SESSION['common_db'] = $db_common;
 start_language();
 if (!common_allowed_ip($_SERVER['REMOTE_ADDR'])) {
     $error_msg = common_header('IP address not authorized');
     $error_msg .= 'IP <b>' . $_SERVER['REMOTE_ADDR'] . '</b> is not authorized.<br/>' . "\n";
     $error_msg .= 'IP <b>' . sprintf("%u", ip2long($_SERVER['REMOTE_ADDR'])) . '</b> is not authorized.' . "\n";
     $error_msg .= common_bottom();
     die($error_msg);
 }
 if ($res_loc = check_output_files()) {
     $error_msg = common_header('Output files not writeable');
     $error_msg .= navbar_empty();
     switch ($res_loc) {
         case 1:
             $err = 'error file not writeable';
             break;
         case 2:
             $err = 'error dir not writeable';
             break;
         case 3:
             $err = 'debug file not writeable';
             break;
         case 4:
             $err = 'debug dir not writeable';
             break;
     }
示例#6
0
 $link = mysql_pconnect($cfgserver, $cfguser, $cfgpassword) or die(GLOBALMSG_DB_CONNECTION_ERROR);
 /*
 we check at least to have some tables in each db
 otherwise we stop execution and report an error
 TODO: link to db installation page in the error msg
 */
 $tableslist = mysql_list_tables($db_common, $link);
 $numtables = mysql_num_rows($tableslist);
 if ($numtables == 0) {
     die(GLOBALMSG_DB_NO_TABLES_ERROR);
 }
 $_SESSION['common_db'] = $db_common;
 start_language();
 $found_accounting_db = true;
 if (!$found_accounting_db) {
     $error_msg = common_header('No accounting db has been found');
     $error_msg .= GLOBALMSG_NO_ACCOUNTING_DB_FOUND . "\n";
     $error_msg .= GLOBALMSG_CONFIGURE_DATABASES . "\n";
     $error_msg .= common_bottom();
     error_msg(__FILE__, __LINE__, 'No accounting db has been found');
     die($error_msg);
 }
 $_SESSION['common_db'] = common_find_first_db($_SESSION['common_db']);
 // unsets all the waiters' _SESSION vars
 unset($_SESSION['catprinted']);
 if ($_SERVER['PHP_SELF'] != $_SESSION['page']) {
     $_SESSION['page'] = $_SERVER['PHP_SELF'];
     unset($_SESSION['orderby']);
     unset($_SESSION['ordersort']);
 }
 if (isset($_GET['mgmt_db_number'])) {
示例#7
0
if (!$database) {
    die("Error opening DB file: " . $database->lastErrorMsg());
}
// GET infos from DB
$query = 'SELECT reports.* FROM failed JOIN reports ON reports.id=failed.id_report WHERE signature=X\'' . $signature . '\'';
$q = $database->query($query);
$reportsArray = array();
while ($tab = $q->fetchArray(SQLITE3_ASSOC)) {
    $reportsArray[$tab['id']] = $tab;
}
$tab = $database->query('SELECT test_name FROM failed WHERE signature=X\'' . $signature . '\' LIMIT 1');
list($testName) = $tab->fetchArray(SQLITE3_NUM);
// We stop everything
$database->close();
$TITLE = "Report details";
common_header(array('<meta name="robots" content="noindex">'));
?>
<script src="sorttable.js"></script>
<div style="margin:10px">
<h1><a href="/reports/">
<img title="Go back home" src="home.png" border="0" style="vertical-align:middle;" /></a>
List of reports associated</h1>
<b>Test name: </b><?php 
echo $testName;
?>
<br />
<b>Version: </b><?php 
echo $version;
?>
<br /><br />
<style>
/*
The next if contains a primitive access control
to avoid that 2 waiters simultaneously work on the same table

this is done by updating a timestamp field in the sources table
and by checking (if the waiter changed)
if the elapsed time from the last update is > than the config lock_time
*/
if (isset($_SESSION['sourceid']) && $_SESSION['sourceid']) {
    if (table_lock_check($_SESSION['sourceid'])) {
        $remaining_time = table_lock_remaining_time($_SESSION['sourceid']);
        $user = new user($_SESSION['userid']);
        if ($remaining_time == 0) {
            $remaining_time = 1;
        }
        $error_msg = common_header('Table in use');
        $error_msg .= navbar_lock_retry('');
        $error_msg .= ucfirst(phr('TABLE_ALREADY_IN_USE_ERROR')) . ' ' . $remaining_time . ' ' . ucfirst(phr('SECONDS')) . '.<br><br>' . "\n";
        $error_msg .= ucfirst(phr('IF_YOU_ARE_NOT_DISCONNECT_0')) . ' <b>' . $user->data['name'] . '</b> ' . ucfirst(phr('IF_YOU_ARE_NOT_DISCONNECT_1')) . '<br>' . "\n";
        $error_msg .= common_bottom();
        die($error_msg);
    }
}
/*
We get the printed categories flag, and write to $_SESSION['catprinted'][]
*/
if (isset($_SESSION['sourceid'])) {
    $query = "SELECT * FROM `sources` WHERE `id`='" . $_SESSION['sourceid'] . "'";
    $res = common_query($query, __FILE__, __LINE__);
    if (!$res) {
        return ERR_MYSQL;
   | You should have received a copy of the GNU Lesser General Public     |
   | License along with this library; if not, write to the Free Software  |
   | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA             |
   | 02111-1307  USA.                                                     |
   +----------------------------------------------------------------------+
   |                     http://validator.aborla.net/                     |
   +----------------------------------------------------------------------+

vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:

     $Id: translators.php 8377 2005-08-15 09:27:49Z akill $
*/
ini_set('default_charset', 'UTF-8');
include './include.inc';
include './local/en.inc';
common_header('Translators');
$files = scandir('./local');
$files = array_splice($files, 2);
// remove '.' and '..'
$skip = array('CVS' => 1, 'en.inc' => 1, 'convert.php' => 1);
// fetch the english revision
preg_match('/\\$' . 'Revision: 1\\.(\\d+)/', file_get_contents('./local/en.inc'), $data);
$revision = $data[1];
echo <<<HTML
<p>&nbsp;</p>
<p>This page is used to keep track of the current translations and their maintainers and revisions.
 Therefore we thank all the translators listed below for their work!</p>
<p>If you would like to become the maintainer of the translation of a language, please download the
 <a href="/local/en.inc">english file</a> and translate it (please encode the file in UTF-8). Then, send the file
 and your details (name, site, e-mail) to our <a href="mailto:htmlchecker-devl@lists.sourceforge.net">mailling list</a>.</p>
示例#10
0
<?php

error_reporting(E_ALL);
include "include/functions.php";
$TITLE = "PHP: QA: PFTT";
$SITE_UPDATE = date("D M d H:i:s Y T", filectime(__FILE__));
/* $Id$ */
common_header(NULL, $TITLE);
?>

<img src="howto_phpt.png" />

<p><strong>PFTT Command</strong> - Run this command in the <b>PFTT Shell</b> to reproduce the same tests. Use the `<b>rg</b>` command to get the same release if you don't already have it. Download and install PFTT from <a href="http://qa.php.net/pftt.php" target="_blank">http://qa.php.net/pftt.php</a>.</p>

<p><strong>Scenario Set</strong> - Scenarios that are tested (CLI, Apache mod_php ; Opcache, Filesystem, etc...)</p>

<p><strong>FAILED</strong> - PHPT tests that failed</p>
<p><strong>TIMEOUT</strong> - PHPT tests that did not finish after a minute</p>
<p><strong>CRASH</strong> - PHPT tests that CRASHed PHP</p>
<p><strong>SKIP</strong> - PHPT test that was not run. Should minimize this count as much as possible for better code coverage</p>
<p><strong>XSKIP</strong> - PHPT test that could not be run on OS. It is ok to skip these tests (whereas SKIP tests should be run if possible)</p>

<p>Report compares ERROR, FAILURE, TIMEOUT, CRASH and PASS for two PHP Builds, the <strong>Base Build</strong> with the <strong>Test Build</strong>. A +X indicates the count increased from Base to Test. A -X indicates the count decreased from Base to Test. If the difference is <font color="green">good</font>, it is shown in <font color="green">green</font> (fe increase in PASS, decrease in FAIL). If the difference is <font color="red">bad</font>, it is shown in <font color="red">red</font> (fe increase in FAIL).</p>

<p><a href="http://git.php.net/?p=pftt2.git;a=blob;f=src/com/mostc/pftt/model/core/EPhptTestStatus.java;h=9c0e00a92b05e1f0bd21601e197ccb4466e2b6d4;hb=HEAD" target="_blank">Full info on PHPT Test Statuses</a></p>

<p><strong>Result-Pack</strong> All the test logs are compressed into result-packs, which can be downloaded using the two links in the report.</p>

<?php 
common_footer();
示例#11
0
<?php

ini_set('default_charset', 'UTF-8');
require './include.inc';
require './local/en.inc';
common_header('Dev Zone');
?>

<p>
This program is open-source and is licensed under the <a href="/lgpl.txt">LGPL license</a>.
It is powered by PHP 5 and HTML tidy.
</p>

<p>Our current TODO list includes:</p>
<ul>
<li>Localize the messages to a lot more languages</li>
<li>Implement a link checker bot</li>
<li>Implement a CSS validator and repairer (we need to find out if there is some library usable)</li>
<li>Help the HTML tidy project to localize their messages (with our translators database)</li>
</ul>

<p>
We would like also to receive any feedback about improvements that could be done (providing
patch or not), security bugs (very important to us), interface suggestions, etc.. All the
feedback should go into our <a href="http://sourceforge.net/tracker/?group_id=143995">tracker</a>.
</p>

<p>
The <a href="http://sourceforge.net/project/showfiles.php?group_id=143995">source code</a>
is freely available for downloading.
</p>
示例#12
0
//*****************
$ReturnFile = $ThisFile;
//戻り先のファイル名
//==============================
//=============================
$_SESSION['CallJob'] = $ThisFile;
//log_in.php からの戻り用
include "log_in_check.php";
//check off中
//=============================
include $kanri_file;
include "csv_db_access.php";
//このPROC名
$Proc_name = $ThisFile;
//******** ここよりメインPROC ****************************
common_header($menu_title);
$user_level = Access_check($acc_level, 1, 1, $ReturnFile);
print 'レベル = 1:一般ユーザ 2:管理ユーザ 3:システム管理者<br>';
print $memo;
//テーブル別の補助ルーチン
if ($db_file == "common_user") {
    change_sha256();
}
if ($db_file == "report") {
    report_manage();
}
if ($db_file == "lightclass") {
    set_imagefile($ICON_dir);
}
if ($db_file == "fgroup") {
    set_fctable();
示例#13
0
<?php

include_once "include.php";
$ThisFile = "log_in.php";
$NextFile = $_SESSION["NextJob"];
$ReturnFile = $_SESSION['CallJob'];
$Case1File = "common_user_append.php";
//ユーザ登録なしの場合のアクセスファイル名
common_header("Log in ");
//①---- Log in :ID パスワードの要求 ----
if ($_POST["log_in_flg"] == "") {
    print '<form method="POST" action="' . $ThisFile . '">';
    echo '
	★IDとパスワードを入力してください。<br>
	<input type="hidden" name="log_in_flg" value="1" >
	ID:<br>
	<input type="text"     name="log_in_id"   size=20 ><br>
	パスワード:<br>
	<input type="password" name="log_in_pass" size=20 ><br>
	<input type="submit" value="送信">
	</form>

	<form method="POST" action="' . $ReturnFile . '">
	<input type="hidden" name="mode" value="">
	<input type="submit" value="戻る">
	</form>
	<br>
	<br>
	<input type="button" value="閉じる" onclick="self.close()">
	';
    //①のIf Else -----------