$site = new Site(array('on_debug' => $_COOKIE['debug'] ? 1 : 0, 'on_admin_keel' => 1));
ini_set('display_errors', 0);
$sqlK = "SELECT encoding FROM keel WHERE on_default = '1'";
$sthK = new SQL($sqlK);
$encoding = $sthK->fetchsingle();
$encoding = $encoding ? $encoding : 'UTF-8';
$cli = php_sapi_name() == 'cli' ? true : false;
if (!($site->user->is_superuser || $cli)) {
    print '<font color=red>Error: you need permissions to run updates.</font>';
    exit;
}
############# CONF
$CONF = ReadConf();
# db connect data from config.php
############# VERSION CHECK
$current_ver = current_version();
# try to connect database and find which version is installed returns 0, if no database found
//$current_ver = '4.7.FINAL';
############# VERSION NUMBERS
$versions = array('4.0.0', '4.0.1', '4.0.2', '4.0.3', '4.0.4', '4.0.5', '4.0.6', '4.0.7', '4.0.8', '4.0.9', '4.0.10', '4.0.11', '4.0.12', '4.0.13', '4.0.14', '4.0.15', '4.1.0', '4.1.1', '4.2.0', '4.2.1', '4.2.2', '4.2.3', '4.2.4', '4.3.0', '4.3.1', '4.3.2', '4.3.3', '4.3.4', '4.3.5', '4.3.6', '4.4.0', '4.4.1', '4.4.2', '4.4.3', '4.4.4', '4.4.5', '4.4.6', '4.4.7', '4.4.8', '4.5.0', '4.5.1', '4.5.2', '4.5.3', '4.5.4', '4.5.5', '4.5.6', '4.5.7', '4.5.8', '4.6.0', '4.6.1', '4.6.2', '4.6.3', '4.6.4', '4.6.5', '4.6.6', '4.7.0', '4.7.1');
##############################
# get the new version number
$new_ver = end($versions);
//$url = site_url();
##########################
# default_data_files
$default_data_files = array();
foreach ($versions as $version_array_index => $tmpver) {
    $next = $versions[$version_array_index + 1];
    # if not current version yet, go to next ver
    # jooksev ver <= installitav ver
    echo "<p><label><u>Log In Here</u></label></p>\n";
    echo "<form name=\"authenticate\" method=\"post\" action=\"\">\n";
    echo "Username: <input class=\"input-medium\" name=\"user\" id=\"user\" type=\"text\" /><br />\n";
    echo "Password: <input class=\"input-medium\" name=\"pass\" id=\"pass\" type=\"password\" />\n";
    echo "<br />\n";
    echo "<button type=\"submit\" name=\"submit\" class=\"btn btn-primary\">Login</button>\n";
    echo "</form>\n";
} else {
    if ($_SESSION["admin"] == "1") {
        // If CONTINUE was not pressed
        if (!isset($_POST['upgrade_database'])) {
            // Get the current application version
            $app_version = current_version("app");
            echo "The current application version is: " . $app_version . "<br />\n";
            // Get the current database version
            $db_version = current_version("db");
            echo "The current database version is: " . $db_version . "<br />\n";
            // If the version to upgrade is the current version
            if ($db_version == $version_to_upgrade) {
                echo "This script will ugprade your database from version " . $version_to_upgrade . " to the version that goes with these application files.  Click &quot;CONTINUE&quot; to proceed.<br />\n";
                echo "<br />\n";
                echo "<form name=\"upgrade_database\" method=\"post\" action=\"\">\n";
                echo "<button type=\"submit\" name=\"upgrade_database\" class=\"btn btn-primary\">CONTINUE</button>\n";
                echo "</form>\n";
            } else {
                if ($db_version == $app_version) {
                    echo "Your database is already upgraded to the version that matches your application files.  No additional upgrade is necessary to make it work properly.<br />\n";
                } else {
                    echo "This script was meant to upgrade database version " . $version_to_upgrade . " but your current database version is " . $db_version . ".  You will need to use a different database upgrade script instead.<br />\n";
                }
            }
/***********************************/
$class_path = "./classes/";

$is_installation_script = true; # needed for error display handling in core
include_once($class_path."port.inc.php");
include_once($class_path."nodebug.inc.php");
include_once($class_path."install.inc.php"); # all installation related functions

# set error display second time - to override settings in port.inc.php
ini_set('display_errors', $display_errors); // hide or display all errors from screen

############# CONF
$CONF = ReadConf(); # db connect data from config.php

############# VERSION CHECK
$current_ver = current_version(); # try to connect database and find which version is installed returns 0, if no database found

############# VERSION NUMBERS

# version numbers // the CE version can only be update'd from a 4.6.6 version
$versions = array();
array_push($versions, '4.6.6');
array_push($versions, '4.7.0');

##############################

# get the new version number
$new_ver = end($versions);

# kui esileht ja current versiooni ei leitud, siis järelikult install
if (!$current_ver && !$install) {
?>
</li>
                  <li>You are running Application version <?php 
echo current_version("app");
?>
</li>
                </ul>
                </p>
                <p><h4>Database Version</h4>
                <ul>
                  <li>The latest Database version is <?php 
echo latest_version("db");
?>
</li>
                  <li>You are running Database version <?php 
echo current_version("db");
?>
</li>
                </ul>
                </p>
                <p>You can download the most recent code <a href="http://code.google.com/p/simplerisk/downloads/list" target="newwindow">here</a>.</p>
              </div>
            </div>
          </div>
          <div class="row-fluid">
            <div class="span6">
              <div class="hero-unit">
                <p><a href="http://www.joshsokol.com" target="newwindow">Josh Sokol</a> wrote this Risk Management system after being fed up with the high-priced alternatives out there.  When your only options are spending tens of thousands of dollars or using a spreadsheet, good risk management is simply unattainable.</p>
                <p>Josh lives in Austin, TX and has four little ones starving for his time and attention.  If this tool is useful to you and you want to encourage him to keep his attention fixed on developing new features for you, perhaps you should consider donating via the PayPal form on the right.  It&#39;s also good karma.</p>
              </div>
            </div>
Beispiel #5
0
<?php 
require 'charts.lib.php';
?>
<div id="page">
	<div id="header">
		<p class="logo"><img src="<?php 
echo logo();
?>
" alt="Logo powered by Google Chart PHP Library"></p>
		<h1>Google Chart PHP Library</h1>
		<p id="catchphrase">A lightweight object-oriented charting library for PHP 5 built on top of the powerful Google Chart API.</p>
	</div>

	<div id="main">
		<p id="version"><a href="http://code.google.com/p/googlechartphplib/downloads/list" title="This icon is powered by Google Chart PHP Library too."><?php 
echo current_version('0.6');
?>
</a></p>

		<div id="content">
			<p>Google Chart PHP Library is a <strong>open-source</strong> (MIT License) and <strong>free to use</strong> wrapper for the awesome <a href="http://code.google.com/intl/fr-FR/apis/chart/docs/making_charts.html">Google Chart API</a>, a tool provided by Google to create PNG charts using a simple HTTP request. Google Chart PHP Library aims to to simplify the request generation by offering a <strong>high-level object-oriented PHP interface</strong>.</p>
			
			<h2>What's the difference with other charting libraries?</h2>
			
			<p>The main difference is that Google Chart PHP Library <strong>doesn't generate any image</strong>, but instead generate an HTTP request (GET or POST) to call Google Chart API.</p>
			<ul>
				<li>Generation of the chart is <strong>blazing fast</strong>.</li>
				<li>It doesn't require <strong>any additional PHP modules</strong> (like GD or imagemagick).</li>
				<li>You can use the generated URL in a <code>img</code> HTML tag and <strong>save bandwith</strong>.</li>
				<li>Or, you can fetch the PNG image and <strong>cache it locally</strong>.</li>
			</ul>