Example #1
0
/**
 * This file is a part of MyWebSQL package
 *
 * @file:      modules/infoserver.php
 * @author     Samnan ur Rehman
 * @copyright  (c) 2008-2014 Samnan ur Rehman
 * @web        http://mywebsql.net
 * @license    http://mywebsql.net/license
 */
function processRequest(&$db)
{
    if (!$db->hasServer()) {
        echo view('infoserverless', array());
        return;
    }
    if ($db->queryVariables()) {
        $folder = $db->name();
        include find_view(array($folder . '/templates/variables', 'templates/variables'));
        $vars = parseVariables($db);
        $replace = $vars + array('JS' => '');
        if (getDbName() == '') {
            // no database selected, hide menus that belong to a db only
            $replace['JS'] = 'parent.$("#main-menu").find(".db").hide();';
        }
        echo view(array($folder . '/infoserver', 'infoserver'), $replace);
    }
}
Example #2
0
    ?>
<!-- <?php 
    echo $PAGE;
    ?>
 | <?php 
    echo getcwd();
    ?>
 | /<?php 
    echo $URL;
    ?>
 -->
  </head>
  <body>
    <div class="main-container">
<?php 
    echo parseVariables(file_get_contents($PAGE));
    ?>
    </div>
    <!-- JS -->
    <script src="/js/jquery.js"></script>
    <?php 
    if ($URL_SPLIT[0] == "admin") {
        ?>
    <script src="/js/bootstrap.js"></script>
    <?php 
    }
    ?>
    <!--<script src="/js/smartforumsview.js"></script> My Cool Test Thingy (TODO) -->
  </body>
</html>
<?php 
Example #3
0
function things($variables)
{
    parseVariables($variables);
    $output = '';
    $output .= <<<'EOD'

	drv.moveTo(Math.round(Math.random()*MAX_X_4+MAX_X_2), Math.round(Math.random()*MAX_Y_4+MAX_Y_2));

	for(i = 0; i < max; i++)
	{
		x = Math.random()*MAX_X_4;
		y = Math.random()*MAX_Y_4;
		dx = (((x + y)%2) == 0)?(x+Math.random()*MAX_X_2)%CANVAS_MAX_X:(x-Math.random()*MAX_X_2)%CANVAS_MAX_X;
		dy = (x > y)?(y+Math.random()*MAX_Y_2)%CANVAS_MAX_Y:(y-Math.random()*MAX_Y_2)%CANVAS_MAX_Y;

		randcolor1 = Math.round(Math.random()*16).toString(16);
		randcolor2 = Math.round(Math.random()*16).toString(16);
		randcolor3 = Math.round(Math.random()*16).toString(16);
		randcolor4 = Math.round(Math.random()*16).toString(16);
		randcolor5 = Math.round(Math.random()*16).toString(16);
		randcolor6 = Math.round(Math.random()*16).toString(16);

		drv.fillStyle = '#'+randcolor1+randcolor2+randcolor3+randcolor4+randcolor5+randcolor6;

		if(Math.round(Math.random()*50)%2 == 1)
		{
			drv.lineTo(Math.round(dx), Math.round(dy));
		}
		else if(Math.round(Math.random()*50)%2 == 1)
		{
			drv.stroke(Math.round(dx), Math.round(dy));
		}
		else
		{
			drv.fill();
		}
	}

EOD;
    return $output;
}