$topicId = ($postId != 0) ? $postId : $articleId; $parentId = ($postId == 0) ? $postId : $articleId; // db -table and stored procedure $tblTopic = DBT_Topic; $spGetTopicAndAttachment = DBSP_PGetTopicAndAttachment; // path to javascript $javaPath = WS_JAVASCRIPT; $attachedFile = ""; //--------------------------------------------------------------------------------------------- // // creating necessary objects // $artNav = new CNavigation(); $articleNav = $artNav->CreateLinksToArticles(); $pc = new CPageController(); //--------------------------------------------------------------------------------------------- // // preparing and performing query // //checking if quering is needed if($newtopic == 'newtopic') { $parentId = $articleId; $articleId = 0; $topicId = 0;
//--------------------------------------------------------------------------------------------- // // taking care of get variables // $articleId = isset($_GET['articleId']) ? $_GET['articleId'] : 0; $idUser = isset($_SESSION['idUser']) ? $_SESSION['idUser'] : ''; $spPDisplayArticle = DBSP_PDisplayArticle; //--------------------------------------------------------------------------------------------- // // creating necessary objects // $artNav = new CNavigation(); $db = new CDatabaseController(); $queryObject = new CSQL(); $pc = new CPageController(); //--------------------------------------------------------------------------------------------- // // preparing and performing query // $result = ARRAY(); $query = "call {$spPDisplayArticle}(@pGrantRights, {$articleId}, {$idUser}); SELECT @pGrantRights AS editArticle;"; $mysqli = $db->connectToDatabase(); $res = $db->performDirectMultiQuery($query); $db->getAndStoreResults($result);
if(!$frontDoor) die('No direct access to pagecontroller allowed!'); $iFilter = new CInterceptionFilter(); $iFilter->FrontControllerIsVisited(); $iFilter->UserLoginStatus(); //$iFilter->UserGroupStatus(); //--------------------------------------------------------------------------------------------- // // creating objects // $pc = new CPageController(); $nav = new CNavigation(); //--------------------------------------------------------------------------------------------- // // taking care of variables // $accountUser = $pc->SESSIONIsSetOrSetDefault('accountUser'); $idUser = $pc->SESSIONIsSetOrSetDefault('idUser'); $uniqueName = $pc->GETIsSetOrSetDefault('uniquename'); $navSet = $pc->GETIsSetOrSetDefault('p'); $spGetFileDetails = DBSP_PGetFileDetails; global $gModule; // -------------------------------------------------------------------------------------------
include "./../src/CNavigation.php"; /** * Start the session. * */ session_name(preg_replace('/[^a-z\\d]/i', '', __DIR__)); session_start(); /** * Create the Orange variable. * */ $Orange = array(); $Orange['lang'] = 'sv'; $Orange['title_append'] = ' | Orange min webbtemplate'; $menu = array('startsida' => array('text' => 'Startsida', 'url' => 'me.php'), 'redovisning' => array('text' => 'Redovisning', 'url' => 'redovisning.php'), 'kallkod' => array('text' => 'Källkod', 'url' => 'scource.php'), 'calender' => array('text' => 'Kalender', 'url' => 'calender.php'), 'movie' => array('text' => 'Movie', 'url' => 'movie.php')); $Orange['navbar'] = CNavigation::generateMenu($menu); $Orange['header'] = <<<EOD <img class='sitelogo' src='./../img/orangeLogo.png' alt='Orange Logo'/> <span class='sitetitle'>Orange webbtemplate</span> <span class='siteslogan'>Återanvändbar modul för webbutveckling med PHP</span> EOD; $Orange['footer'] = <<<EOD <footer> <span class='sitefooter'>Copyright (c) Hannes Alm (hannes@almar.se)</span> <div class='icons'> <a href='http://validator.w3.org/check/referer'><img title='HTML5' src='./../img/html5Flat.png' alt='HTML5'/></a> <a href='http://jigsaw.w3.org/css-validator/check/referer'><img title='CSS3'src='./../img/cssFlat.png' alt='CSS'/></a> <a href='http://validator.w3.org/unicorn/check?ucn_uri=referer&ucn_task=conformance'><img title='UNICORN' src='./../img/w3Flat.png' alt='UNICORN'/></a> <a href='#'><img title='Facebookpage' src='./../img/facebookFlat.png' alt='FACEBOOK'/></a> <a href='#'><img title='GITHUB' src='./../img/gitFlat.png' alt='GITHUB'/></a> <div>
$user = isset($_SESSION['accountUser']) ? $_SESSION['accountUser'] : ''; $idUser = isset($_SESSION['idUser']) ? $_SESSION['idUser'] : ''; if($articleList == "all") { $headline = "Artiklar i Dolphins arkiv"; } else { $headline = "Mina artiklar"; } //--------------------------------------------------------------------------------------------- // // creating necessary objects // $artNav = new CNavigation(); $articleNav = $artNav->articleNavigation(); $db = new CDatabaseController(); $queryObject = new CSQL(); //--------------------------------------------------------------------------------------------- // // preparing and performing query // $query = "call PListArticles({$idUser}, '{$articleList}');"; $mysqli = $db->connectToDatabase(); $res = $db->performDirectQuery($query); //---------------------------------------------------------------------------------------------
if(!$frontDoor) die('No direct access to pagecontroller allowed!'); $iFilter = new CInterceptionFilter(); $iFilter->FrontControllerIsVisited(); //$iFilter->UserLoginStatus(); //$iFilter->UserGroupStatus(); //--------------------------------------------------------------------------------------------- // // creating objects // $pc = new CPageController(); $nav = new CNavigation(); //--------------------------------------------------------------------------------------------- // // the content of the page // $subHeadline ="Undermeny"; $subNavigation = ARRAY ( 'Länk 1' => '?p=home', 'Länk 2' => '?p=hom', 'Länk 3' => '?p=home', 'Länk 4' => '?p=home' );
} ?> </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>
<?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&ucn_task=conformance'>Unicorn</a></span>
<?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}')";
<?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;
// // error reporting on // error_reporting(E_ALL); //--------------------------------------------------------------------------------------------- // // creating object // //$redirect = isset($_SESSION['redirect']) ? $_SESSION['redirect'] : ''; //$pc = newCPageController; // $redirect = $pc->SESSIONIsSetOrSetDefault('history2'); $pc = new CPageController(); $nav = new CNavigation(); //--------------------------------------------------------------------------------------------- // // taking care of variables // $userId = $_SESSION['idUser']; $errorMessage = isset($_SESSION['errorMessage']) ? $_SESSION['errorMessage'] : ""; //--------------------------------------------------------------------------------------------- // // preparing and performing query // $result = ARRAY();
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>