<?php

// Get instance of Lifts
$lifts = new Lifts();
// Check to see if this is a login request, If so display the login page
if (isset($_GET['login'])) {
    global $sess;
    // Already logged in? redirect to index
    if ($sess->getLoggedin()) {
        redirect('index');
    }
    // Styles written utilizing twitter bootstrap
    ?>
<!-- Begin Login -->
    <div class='col-md-12 center'>
        <h2>You must have an account to view this page.</h2>
    </div>
        <div id="login" style="margin-top: 50px;" class="mainbox col-md-6 col-md-offset-3 col-sm-offset-2">
        <div class="panel panel-info" >
            <div class="panel-heading">
                <div class="panel-title">Log In</div>            
            </div>

            <div style="padding-top: 30px" class="panel-body" >
                <?php 
    if (isset($_SESSION['l_error'])) {
        ?>
                <div id="login-alert" class="alert alert-danger col-sm-12">
                    <p>Error:</p>
                    <span><?php 
        echo $_SESSION['l_error'];
Esempio n. 2
0
<?php

require_once 'initialize.php';
if (!$sess->getLoggedin()) {
    $_SESSION['message'] = 'You must be logged in to do that!';
    redirect('index');
}
$page->setTitle('Edit of Chet\'s lift database');
$lifts = new Lifts();
include SITE_PATH . 'components/header.php';
// PAGE CONTENT GOES HERE
if (isset($_POST['lift'])) {
    // -- testing --
    // echo $_POST['lift'];
    // -- end testing --
    $id = $_POST['lift'];
    $date = $_POST['date'];
    $inspector = $_POST['inspector'];
    $lifts->updateLift($id, $date, $inspector);
    redirect('index');
} else {
    $id = $_GET['liftId'];
    echo $lifts->getLiftForEdit($id);
    // End Test
}
include SITE_PATH . 'components/footer.php';