Exemple #1
0
}
?>
    

</head>
<body>
  <div id='wrapper'>
    <div id='header'><?php 
echo $header;
?>
</div>
        <?php 
if (isset($navbar)) {
    ?>
        <?php 
    echo CNavigation::GenerateMenu($navbar, 'navbar');
}
?>

    <div id='main'><?php 
echo $main;
?>
</div>
    <div id='footer'><?php 
echo $footer;
?>
</div>

  </div>
</body>
</html>
Exemple #2
0
<?php

include __DIR__ . '/config.php';
$elf['title'] = "Hello World";
$elf['header'] = "<img class='sitelogo' src='img/elf.png' alt='elf Logo'/>" . CNavigation::GenerateMenu($menu);
$elf['main'] = "";
$elf['header'] .= <<<EOD
\t<hr /> 
\t 
\t
\t<span class='sitetitle'>Elf webbtemplate</span>
\t<span class='siteslogan'>Återanvändbara moduler för webbutveckling med PHP</span>
\t 
EOD;
if (isset($_GET["p"])) {
    $page = $_GET["p"];
    switch ($page) {
        case 'your page':
            include "yourpage.php";
            break;
        default:
            include "example.php";
            break;
    }
} else {
    include "example.php";
}
$elf['footer'] = <<<EOD
 <footer>
<div class="container">
<span class='sitefooter'> <a href='https://github.com/edtau/Elf.git'>ELF på github</a> | <a href='http://validator.w3.org/unicorn/check?ucn_uri=referer&amp;ucn_task=conformance'>Unicorn</a></span>
Exemple #3
0
<?php

function setActive($items)
{
    $ref = isset($_GET['p']) && isset($items[$_GET['p']]) ? $_GET['p'] : null;
    if ($ref) {
        $items[$ref]['class'] .= 'activeNav';
    }
    return $items;
}
$menu = array('callback' => 'setActive', 'items' => array('about' => array('text' => 'Om mig', 'url' => '?p=about', 'class' => null), 'dice' => array('text' => 'Tärningar', 'url' => '?p=dice', 'class' => null), 'slideshow' => array('text' => 'Bildspel', 'url' => '?p=slideshow', 'class' => null), 'code' => array('text' => 'Källkod', 'url' => '?p=code', 'class' => null), 'desc' => array('text' => 'Redovisningar', 'url' => '?p=desc', 'class' => null)));
//menu to display
$nav = CNavigation::GenerateMenu("navmenu", $menu);
$urbax['nav'] = $nav;
//content to show
if (!isset($_GET['p'])) {
    header("location:?p=about");
} else {
    switch ($_GET['p']) {
        case "about":
            $file = "aboutme.php";
            $urbax['title'] = "Om mig";
            break;
        case "dice":
            $file = "dice.php";
            $urbax['title'] = "Kasta tärning";
            break;
        case "slideshow":
            $file = "slideshow.php";
            $urbax['title'] = "Visa bildspel";
            break;
Exemple #4
0
<?php

include 'inc/upconfig.php';
include 'inc/functions.php';
include 'nav.php';
echo CNavigation::GenerateMenu($menu);
// Create connection
$link = mysqli_connect($db_host, $db_user, $db_pass, $db_name);
// Check connection
if (!$link) {
    die("Connection failed: " . mysqli_connect_error());
}
$servername = mysqli_real_escape_string($link, $_REQUEST['servername']);
$ip = mysqli_real_escape_string($link, $_REQUEST['ip']);
$company = mysqli_real_escape_string($link, $_REQUEST['company']);
$pass = mysqli_real_escape_string($link, $_REQUEST['pass']);
//$OS = mysqli_real_escape_string($link, $_POST['OS']);
//$lsbresult   = array();
//$lsbcmd    = exec("ssh root@$ip 'lsb_release -as'",$lsbresult );
//print_r(exec("ssh root@$ip 'lsb_release -as'",$lsbresult ));
//$response = array();
//print_r($lsbresult);
@(list($OS, $version, $releasever) = getOS($pass));
//if(!empty($lsbresult)) {
//	$OS        = $lsbresult[0];
//	$version  = $lsbresult[3];
//	$releasever = $lsbresult[2];
//}
//$version = mysqli_real_escape_string($link, $_POST['version']);
$description = mysqli_real_escape_string($link, $_POST['description']);
$sql = "INSERT INTO servers (servername,ip,company,OS,version,description,releasever) VALUES ('{$servername}','{$ip}','{$company}','{$OS}','{$version}','{$description}','{$releasever}')";
foreach ($stylesheets as $val) {
    ?>
<link rel='stylesheet' type='text/css' href='<?php 
    echo $val;
    ?>
'/>
<?php 
}
?>
</head>
<body>
    <div id='wrapper'>
        <div id='header'><?php 
echo $header;
?>
</div>
        <?php 
echo CNavigation::GenerateMenu($menu, "navbar");
?>
        <div id='main'><?php 
echo $main;
?>
</div>
        <div id='footer'><?php 
echo $footer;
?>
</div>
    </div>
</body>
</html>