Beispiel #1
0
<?php

include 'includes/admin-settings.php';
include '../includes/db.php';
include 'includes/global-admin-functions.php';
assessLogin($securityArrPublisher);
$mysqli = new mysqli($DB_SERVER, $DB_USERNAME, $DB_PASSWORD, $DB_DATABASE);
$stmt = $mysqli->prepare('SELECT  DISTINCT(label) FROM route_geo WHERE is_waypoint = 1 OR is_destination = 1 order by label');
$stmt->execute();
//$result = $stmt->get_result();
$stmt->bind_result($label);
$json = '';
$results = array();
$i = 0;
while ($stmt->fetch()) {
    $results[$i]['label'] = $label;
    $i++;
}
$numRows = count($results);
if ($numRows > 0) {
    $i = 0;
    $json .= '[';
    foreach ($results as $row) {
        $json .= '"' . $row["label"] . '"';
        if ($i < $numRows - 1) {
            $json .= ',';
        }
        $i++;
    }
    $json .= ']';
}
Beispiel #2
0
<?php

include 'includes/admin-settings.php';
include '../includes/db.php';
include 'includes/global-admin-functions.php';
assessLogin($securityArrAuthor);
function getPages($DB_SERVER, $DB_USERNAME, $DB_PASSWORD, $DB_DATABASE)
{
    $mysqli = new mysqli($DB_SERVER, $DB_USERNAME, $DB_PASSWORD, $DB_DATABASE);
    $stmt = $mysqli->prepare('SELECT pages.id, pages.title, is_live FROM pages ORDER BY pages.order');
    $stmt->execute();
    $stmt->bind_result($id, $title, $is_live);
    $results = array();
    $i = 0;
    while ($stmt->fetch()) {
        $results[$i]['id'] = $id;
        $results[$i]['title'] = $title;
        $results[$i]['is_live'] = $is_live;
        $i++;
    }
    $stmt->close();
    $mysqli->close();
    return $results;
}
$pages = getPages($DB_SERVER, $DB_USERNAME, $DB_PASSWORD, $DB_DATABASE);
?>
<html>
<head>
    <title>List Pages</title>
    <?php 
include 'includes/head.php';
Beispiel #3
0
<?php

include 'includes/admin-settings.php';
include '../includes/db.php';
include 'includes/global-admin-functions.php';
assessLogin($securityArr);
?>
<html>
<head>
<?php 
include 'includes/head.php';
?>
</head>
<body>

<?php 
include 'includes/header.php';
?>

<section>
    <div class="row">
        <div class="large-12 columns">
            <h1>
            Home
            </h1>


            <?php 
if (in_array($_SESSION['adminRole'], $securityArrAuthor)) {
    ?>
                <p><a href="page-list.php">Pages</a></p>