Ejemplo n.º 1
0
function adminDashboardView()
{
    if ($_SESSION['upower'] == 'admin') {
        $render = 'dashboard';
        renderHeader($render);
        include_once '_' . $render . '.php';
    } else {
        header("Location: " . url);
    }
}
Ejemplo n.º 2
0
require_once "../resources/config.php";
require_once LIBRARY_PATH . "/templating_functions.php";
require_once LIBRARY_PATH . "/functions.php";
// TO ALLOW USERS TO LOGIN ON EACH PAGE PLEASE COPY THIS CODE
require_once "./php/db_connect.php";
require_once "./php/classes/Login.class.php";
$login = new Login();
// END OF LOGIN SCRIPT
?>
    <!DOCTYPE html>
    <html lang="en">
    <?php 
$meta = array("<meta charset=\"UTF-8\">", "<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">", "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">");
$css = array("css/bootstrap.min.css", "css/theme.min.css", "css/main.css");
$js = array("https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js", "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js", "js/main.js");
renderHeader("Admin Tools", $meta, $css, $js);
?>
    <body>

    <?php 
require_once "../resources/templates/menu.php";
?>

    <div class="container">
        <div class="row">
            <?php 
if ($login->isUserLoggedIn() and isset($_SESSION['id']) and privilegeCheck($mysqli, $_SESSION['id']) == 0) {
    ?>
                <h1>Hello Boss xD</h1>
                <div id="admId" class="hidden"><?php 
    echo $_SESSION['id'];
Ejemplo n.º 3
0
require_once "../resources/config.php";
require_once LIBRARY_PATH . "/templating_functions.php";
require_once LIBRARY_PATH . "/functions.php";
// TO ALLOW USERS TO LOGIN ON EACH PAGE PLEASE COPY THIS CODE
require_once "./php/db_connect.php";
require_once "./php/classes/Login.class.php";
$login = new Login();
// END OF LOGIN SCRIPT
?>
<!DOCTYPE html>
<html lang="en">
<?php 
$meta = array("<meta charset=\"UTF-8\">", "<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">", "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">");
$css = array("css/bootstrap.min.css", "css/theme.min.css", "css/main.css", "css/index.css", "https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css");
$js = array("https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js", "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js", "js/main.js");
renderHeader("WonderBlog! [testing2]", $meta, $css, $js);
?>
<body>
<?php 
require_once "../resources/templates/menu.php";
?>

<?php 
//prepare rating and adventure
$adventures = array();
$total_progress = 0;
// adventure
$query = "SELECT a.id, a.name, a.description, rate.total_rate, p.id, p.file_ext\n          FROM adventures a, photos p, (\n              SELECT a.id, (IFNULL(v.rate,0)+a.admin_vote) as total_rate\n              FROM adventures a\n              LEFT JOIN (\n                  SELECT id, COUNT(*) as rate, v.date\n                  FROM adventures a, votes v\n                  WHERE a.id = v.adv_id\n                 GROUP BY id\n              ) v\n              ON a.id = v.id\n          ) rate\n          WHERE a.id = rate.id\n          AND (p.adv_id = a.id\n          AND p.is_cover = 1)\n          ORDER BY rate.total_rate\n          DESC LIMIT 5";
$stmtAdventure = new mysqli_stmt($mysqli, $query);
if ($stmtAdventure) {
    $stmtAdventure->execute();
Ejemplo n.º 4
0
<?php require("helpers.php"); ?>

<?php renderHeader(["title" => "Week 1"]); ?>

<ul>
  <li><a href="http://cdn.cs50.net/2013/fall/lectures/1/m/week1m.pdf">Monday</a></li>
  <li><a href="http://cdn.cs50.net/2013/fall/lectures/1/w/week1w.pdf">Wednesday</a></li>
  <li><a href="week1.php">Week 1</a></li>
</ul>

<?php renderFooter(); ?>
Ejemplo n.º 5
0
    <html lang="en">
    <?php 
$meta = array("<meta charset=\"UTF-8\">", "<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">", "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">");
$css = array("css/bootstrap.min.css", "css/theme.min.css", "css/main.css", "https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css");
$js = array("https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js", "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js", "js/main.js");
$search = "";
if (isset($_GET["q"])) {
    $search = $mysqli->real_escape_string($_GET["q"]);
}
$search_type = "";
if (isset($_GET["search_type"])) {
    $search_type = $_GET["search_type"];
} else {
    $search_type = "adventure";
}
renderHeader("Search: " . $search, $meta, $css, $js);
?>
    <body>

    <?php 
require_once "../resources/templates/menu.php";
?>

    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <h1>Advance search</h1>
                <form name="advanceSearch" method="get" action="<?php 
echo $_SERVER['PHP_SELF'];
?>
">
Ejemplo n.º 6
0
require_once LIBRARY_PATH . "/functions.php";
require_once "./php/db_connect.php";
//sec_session_start();
// TO ALLOW USERS TO LOGIN ON EACH PAGE PLEASE COPY THIS CODE
require_once "./php/db_connect.php";
require_once "./php/classes/Login.class.php";
$login = new Login();
// END OF LOGIN SCRIPT
?>
<!DOCTYPE html>
<html lang="en">
<?php 
$meta = array("<meta charset=\"UTF-8\">", "<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">", "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">");
$css = array("css/bootstrap.min.css", "css/theme.min.css", "css/main.css", "css/adventure.css");
$js = array("https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js", "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js", "js/main.js");
renderHeader("Adventure", $meta, $css, $js);
$tagString = "";
?>
<body>

<?php 
require_once "../resources/templates/menu.php";
?>



<?php 
$adv_id = $_GET["id"];
// create a SQL query as a string
//$sql_query = "SELECT description FROM adventures WHERE id = $adv_id";
// execute the SQL query
Ejemplo n.º 7
0
$loop = \React\EventLoop\Factory::create();
$board = \Calcinai\PHPi\Factory::create($loop);
$loop->addPeriodicTimer(0.5, function () use($board) {
    //Move cursor back up if it's moved
    static $num_lines = 0;
    if ($num_lines) {
        printf("[%sA", $num_lines);
    }
    ob_start();
    $meta = $board->getMeta();
    printf(bold("Raspberry Pi %-15s %44s\n"), $meta->board_name, date('r'));
    printf("s/n: %s\n", $meta->serial);
    printf("rev: %s, %sMHz, %d cores\n", $meta->revision, $meta->speed, $meta->num_cores);
    //Dump the headers
    foreach ($board->getPhysicalPins() as $header_name => $physical_pins) {
        renderHeader($board, $header_name, $physical_pins);
        echo "\n";
    }
    $buffer = ob_get_clean();
    echo $buffer;
    //Record how much was printed
    $num_lines = substr_count($buffer, "\n");
});
$loop->run();
/**
 * @param \Calcinai\PHPi\Board $board
 * @param string $header_name
 * @param Calcinai\PHPi\Board\Feature\Header\PhysicalPin[] $physical_pins
 */
function renderHeader($board, $header_name, $physical_pins)
{
Ejemplo n.º 8
0
require_once "../resources/config.php";
require_once LIBRARY_PATH . "/templating_functions.php";
// TO ALLOW USERS TO LOGIN ON EACH PAGE PLEASE COPY THIS CODE
require_once "./php/db_connect.php";
require_once "./php/classes/Login.class.php";
$login = new Login();
// END OF LOGIN SCRIPT
?>
<!DOCTYPE html>
<html lang="en">
<?php 
$meta = array("<meta charset=\"UTF-8\">", "<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">", "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">");
$css = array("css/bootstrap.min.css", "css/theme.min.css", "css/main.css");
$js = array("https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js", "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js", "js/main.js");
renderHeader("WonderBlog!", $meta, $css, $js);
?>
<body>

<?php 
require_once "../resources/templates/menu.php";
?>

<div class="container">
    <div class="row">
        //TODO your application here
    </div>
</div>

</body>
</html>
Ejemplo n.º 9
0
 */
require 'inc/lib.php';
?>
<page style="list">
    <models>
        <model>
            <instance>
                <data>
                    <search-location/>
                </data>
            </instance>
            <submission method="urlencoded-post" resource="search.php"/>
        </model>
    </models>
<?php 
echo renderHeader();
?>
    <content>
        <module>
            <block>Find what's on the menu!</block>
            <search-box ref="search-location">
                <label>Find</label>
            </search-box>
            <placard layout="simple" class="link">
                <layout-items>
                    <block class="title">Nearby</block>
                </layout-items>
                <load event="activate" resource="nearby.php"/>
            </placard>
            <placard layout="simple" class="link">
                <layout-items>
Ejemplo n.º 10
0
function personalizarAplicacion()
{
    $request = \Slim\Slim::getInstance()->request();
    $val = json_decode($request->getBody(), TRUE);
    //obtener el archivo plantilla
    $html = file_get_contents('../header.tpl.html');
    //reemplazar las variables de la plantilla
    $outputHtml = renderHeader($html, $val);
    //escribir el archivo
    file_put_contents('../header.html', $outputHtml);
    //obtener el archivo plantilla
    $html = file_get_contents('../headerGeneral.tpl.html');
    //reemplazar las variables de la plantilla
    $outputHtml = renderHeader($html, $val);
    //escribir el archivo
    file_put_contents('../headerGeneral.html', $outputHtml);
    echo 200;
}
Ejemplo n.º 11
0
<?php

require "helpers.php";
?>

<?php 
renderHeader(["title" => "Lectures"]);
?>

<ul>
    <li><a href="week0.php">Week 0</a></li>
    <li><a href="week1.php">Week 1</a></li>
</ul>

<?php 
renderFooter();
Ejemplo n.º 12
0
function renderLogin($notice = '', $script = '')
{
    renderHeader();
    global $g_config;
    ?>
		<link href="css/login.css" rel="stylesheet" media="screen">
	    <div class="container">
        <div class="card card-container">
            <!-- <img class="profile-img-card" src="//lh3.googleusercontent.com/-6V8xOA6M7BA/AAAAAAAAAAI/AAAAAAAAAAA/rzlHcD0KYwo/photo.jpg?sz=120" alt="" /> -->
            <img id="profile-img" class="profile-img-card" src="//ssl.gstatic.com/accounts/ui/avatar_2x.png" />
            <p id="profile-name" class="profile-name-card">Login To <?php 
    echo $g_config['house']['name'];
    ?>
</p>
            <?php 
    if ($notice != '') {
        ?>
            <div class="alert alert-dismissible alert-danger">
                <button type="button" class="close" data-dismiss="alert">×</button>
                <strong>Oh snap!</strong><p><?php 
        echo $notice;
        ?>
</p>
              </div>
          <?php 
    }
    ?>
            <form class="form-signin" method="post">
                <span id="reauth-email" class="reauth-email"></span>
                <input type="text" id="inputEmail" class="form-control" name="account" placeholder="Account" required autofocus>
                <input type="password" id="inputPassword" class="form-control" name="password" placeholder="Password" required>
                
                <button class="btn btn-lg btn-primary btn-block btn-signin" type="submit">Sign in</button>
            </form><!-- /form -->
            <p class="text-center small"><?php 
    echo SAB_NAME . ' ' . SAB_VERSION . ' ' . SAB_RELASE_STATUS;
    ?>
</p>
            
        </div><!-- /card-container -->
    </div><!-- /container -->
	<?php 
    renderFooter($script);
}
Ejemplo n.º 13
0
function createPatch($updatecache = false)
{
    include_once "Lib/Archive/Tar.php";
    include_once 'Lib/Text/Diff.php';
    include_once 'Lib/Text/Diff/Renderer/unified.php';
    $start = microtime(true);
    $tar_object = new Archive_Tar(_bmoddir . "Data/Cache.tar");
    $tar_object->setErrorHandling(PEAR_ERROR_PRINT);
    $tardata = $tar_object->listContent();
    $working = checkDir2("");
    $fmerged = array_merge($tardata, $working);
    $tarf_db = reIndexByFile($tardata);
    $work_db = reIndexByFile($working);
    $workidx = indexFilename($working);
    $tar_idx = indexFilename($tardata);
    $f_names = array_unique(array_merge($workidx, $tar_idx));
    $out = "";
    foreach ($f_names as $file) {
        //speed optimization
        if ($tarf_db[$file] && $work_db[$file] && $tarf_db[$file]["mtime"] == $work_db[$file]["mtime"] && $updatecache != true) {
            continue;
        }
        if ($tarf_db[$file]) {
            $fts1 = $tarf_db[$file]["mtime"];
            $fdata = $tar_object->extractInString($file);
            $lines1 = explode("\n", $fdata);
            //$lines1 = file("Data/$file");
            if (substr($fdata, -1, 1) == "\n") {
                //$lines1[] = "";
            }
        } else {
            $fts1 = 0;
            $lines1 = array();
        }
        if ($work_db[$file]) {
            $fts2 = $work_db[$file]["mtime"];
            //$lines2 = file(_bpatdir."$file");
            $filetext = file_get_contents(_bmoddir . _bpatdir . "{$file}");
            $lines2 = explode("\n", $filetext);
        } else {
            $fts2 = 0;
            $lines2 = array();
            $filetext = "";
        }
        if (array_search($file, $workidx) === false && array_search($file, $tar_idx) !== false) {
            //delted file
            $out .= renderHeader($file, $fts1, $fts2);
            $out .= "@@ -0,0 @@\n\n";
            continue;
        }
        if (array_search($file, $workidx) !== false && array_search($file, $tar_idx) === false) {
            //added file
        }
        if ($filetext == $fdata) {
            continue;
        }
        $diff = new Text_Diff('auto', array($lines1, $lines2));
        $renderer = new Text_Diff_Renderer_unified();
        $render = $renderer->render($diff);
        if ($render != "") {
            $out .= renderHeader($file, $fts1, $fts2);
            //get ts to work!
            $out .= $render . "\n";
            if (substr($filetext, -1, 1) != "\n") {
                $out .= "\\ No newline at end of file\n\n";
            }
        }
    }
    if ($updatecache == true) {
        $tar_object->create(array());
        foreach ($f_names as $file) {
            $tar_object->addString($file, file_get_contents(_bmoddir . _bpatdir . "{$file}"));
        }
    }
    return array(microtime(true) - $start, $out, count($addlist));
}
Ejemplo n.º 14
0
<?php

require "helpers.php";
?>

<?php 
renderHeader(["title" => "CS50"]);
?>

<ul>
    <li><a href="lectures.php">Lectures</a></li>
    <li><a href="http://cdn.cs50.net/2014/fall/lectures/0/w/syllabus/syllabus.html">Syllabus</a></li>
</ul>

<?php 
renderFooter();
Ejemplo n.º 15
0
<?php

require "helpers.php";
?>

<?php 
renderHeader(["title" => "Week 0"]);
?>

<ul>
    <li><a href="http://cdn.cs50.net/2014/fall/lectures/0/w/week0w.pdf">Wednesday</a></li>
    <li><a href="http://cdn.cs50.net/2014/fall/lectures/0/f/week0f.pdf">Friday</a></li>
</ul>

<?php 
renderFooter();
Ejemplo n.º 16
0
        $html[] = 'profilingInfo = ' . (function_exists('json_encode') ? json_encode($profilingInfo) : '{}') . ';';
        $html[] = '</script>';
        echo implode("\n", $html);
        renderFooter();
        $footerHarness = ob_get_clean();
        if ($returnRaw) {
            echo $bodyData;
        } else {
            echo $headerHarness;
            echo $bodyData;
            echo $footerHarness;
        }
        break;
    default:
        require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'insight-devcomp' . DIRECTORY_SEPARATOR . '_init_.php';
        renderHeader();
        renderFrameset();
        renderFooter();
        break;
}
function renderHeader()
{
    ?>
<html>
    <head>
        <style>
            HTML, BODY {
                width: 100%;
                height: 100%;
                margin: 0px;
                padding: 0px;
Ejemplo n.º 17
-1
function render()
{
    global $model;
    renderHeader();
    if (in_array('loggedIn', $_SESSION) && $_SESSION['loggedIn'] === true) {
        include $_SERVER['DOCUMENT_ROOT'] . '/inc/home.php';
    } else {
        include $_SERVER['DOCUMENT_ROOT'] . '/inc/login.php';
    }
    renderFooter();
}