コード例 #1
0
ファイル: functions.php プロジェクト: jamestoot/Eval
function logoutUser()
{
    // Unset all of the session variables.
    $_SESSION = array();
    // If it's desired to kill the session, also delete the session cookie.
    // Note: This will destroy the session, and not just the session data!
    if (ini_get("session.use_cookies")) {
        $params = session_get_cookie_params();
        setcookie(session_name(), '', time() - 42000, $params["path"], $params["domain"], $params["secure"], $params["httponly"]);
    }
    // Finally, destroy the session.
    session_destroy();
    session_start();
    setTopMessage('success', 'You have been logged out.');
    header("location:../admin/login.php");
}
コード例 #2
0
ファイル: add_eval.php プロジェクト: jamestoot/Eval
}
if (!empty($_POST)) {
    if (!empty($_POST['evaluation-id'])) {
        $objEvaluation = new Evaluation($_POST, $_POST['evaluation-id']);
        $blnEvaluationUpdated = $objEvaluation->addEvaluation(true);
        if ($blnEvaluationUpdated && !empty($_POST['complete'])) {
            header('Location: ' . $strLocation . 'admin/view_eval.php?eval_id=' . $_POST['evaluation-id']);
        } else {
            setTopMessage('success', 'Success! An the Evaluation for ' . $_POST['name'] . ' has been updated.');
            header('Location: ' . $strLocation . 'admin/');
        }
    } else {
        $objEvaluation = new Evaluation($_POST);
        $blnEvaluationAdded = $objEvaluation->addEvaluation(false);
        if ($blnEvaluationAdded) {
            setTopMessage('success', 'Success! An Evaluation has been added for ' . $_POST['name'] . '.');
            header('Location: ' . $strLocation . 'admin/');
        }
    }
}
$objComment = new Comment(NULL, NULL, NULL);
$arrComponents = $objComment->getComponents();
$arrCommentTypes = $objComment->getCommentTypes();
if (is_array($arrComponents)) {
    ?>
<div data-magellan-expedition="fixed">
  <dl class="sub-nav">
  <?php 
    foreach ($arrComponents as $arrComponent) {
        ?>
    <dd data-magellan-arrival="component-<?php 
コード例 #3
0
ファイル: view_eval_pdf.php プロジェクト: jamestoot/Eval
        $Result = curl_exec($curlSession);
        if (!empty($_POST['email-pdf'])) {
            $blnSent = false;
            $objEvaluation = new Evaluation(NULL, $iEvaluationId);
            $arrEvaluation = $objEvaluation->getEvaluation();
            if (!empty($arrEvaluation['email'])) {
                $strEmail = $arrEvaluation['email'];
                $strName = $arrEvaluation['student'];
                $strFilename = 'evaluation-' . $iEvaluationId . '.pdf';
                $blnSent = $objEvaluation->emailEvaluation($strEmail, $strName, $Result, $strFilename);
            }
            if ($blnSent) {
                setTopMessage('success', 'Success! the PDF has been sent to ' . $strEmail . '.');
                header('Location: ' . $strLocation . 'admin/view_eval.php?eval_id=' . $iEvaluationId);
            } else {
                setTopMessage('errro', 'Error! The PDF was not sent, please check the email address.');
                header('Location: ' . $strLocation . 'admin/view_eval.php?eval_id=' . $iEvaluationId);
            }
        } else {
            header('Cache-Control: public');
            header('Content-type: application/pdf');
            header('Content-Disposition: attachment; filename="evaluation-' . $iEvaluationId . '.pdf"');
            header('Content-Length: ' . strlen($Result));
            echo $Result;
        }
    }
}
$strPageTitle = 'Puckstoppers Goaltending Evaluation';
include "layout/header.php";
if (isset($_GET['eval_id']) && is_numeric($_GET['eval_id'])) {
    $iEvaluationId = $_GET['eval_id'];
コード例 #4
0
ファイル: delete_eval.php プロジェクト: jamestoot/Eval
<?php

$strPageTitle = 'Puckstoppers Goaltending Evaluation';
include "layout/header.php";
if (isset($_GET['eval_id']) && is_numeric($_GET['eval_id'])) {
    $iEvaluationId = $_GET['eval_id'];
    $objEvaluation = new Evaluation(NULL, $iEvaluationId);
    $blnDeleted = $objEvaluation->deleteEvaluation();
    if ($blnDeleted) {
        setTopMessage('success', 'Success! The Evaluation has been deleted.');
        header('Location: ' . $strLocation . 'admin/');
    } else {
        setTopMessage('error', 'Error! The Evaluation has not been deleted, please try again.');
        header('Location: ' . $strLocation . 'admin/');
    }
} else {
    header('Location: ' . $strLocation . 'admin/');
}
include "layout/footer_js.php";
include "layout/footer.php";
コード例 #5
0
ファイル: logincheck.php プロジェクト: jamestoot/Eval
session_start();
function __autoload($class_name)
{
    require_once '../classes/' . $class_name . '.class.php';
}
include "../config/config.php";
include "../includes/dbconnect.php";
include "../includes/functions.php";
if (isset($_GET['eval_id']) && isset($_GET['skip_auth']) && $_GET['skip_auth'] == '1HGstGtw8272891H') {
} else {
    $blnLoggedIn = false;
    if (!empty($_SESSION['AdminUser']) && !empty($_SESSION['AdminPassword'])) {
        $blnLoggedIn = checkUser($_SESSION['AdminUser'], $_SESSION['AdminPassword'], null);
        if ($blnLoggedIn && $_SERVER['PHP_SELF'] == $strLocation . 'admin/login.php') {
            header("location:../admin/");
        }
    } elseif (!empty($_POST['username']) && !empty($_POST['password'])) {
        $blnLoggedIn = checkUser($_POST['username'], $_POST['password'], true);
        if ($blnLoggedIn) {
            header("location:../admin/");
        } else {
            setTopMessage('alert', 'We were unable to log you in, please check your details.');
            header("location:../admin/login.php");
        }
    }
    if (!$blnLoggedIn && $_SERVER['PHP_SELF'] != $strLocation . 'admin/login.php') {
        setTopMessage('alert', 'Please login to view this page.');
        header("location:../admin/login.php");
    }
}
コード例 #6
0
ファイル: add_comments.php プロジェクト: jamestoot/Eval
<?php

$strPageTitle = 'Add a Comment';
include "layout/header.php";
if (!empty($_POST)) {
    $objComment = new Comment($_POST['comment'], $_POST['component'], $_POST['type']);
    $blnCommentAdded = $objComment->addComment();
    if ($blnCommentAdded) {
        setTopMessage('success', 'Success! the comment has been added.');
        header('Location: ' . $strLocation . 'admin/add_comments.php');
    }
}
$objComment = new Comment(NULL, NULL, NULL);
$arrComponents = $objComment->getComponents();
$arrCommentTypes = $objComment->getCommentTypes();
?>
  <form id="comment-form" data-abide method="post" action="add_comments.php">
    <div class="row">
      <div class="medium-8 panel columns left">
        <div class="row collapse">
          <p>Please fill out the comment details below:</p>
        </div>
        <?php 
if (is_array($arrComponents)) {
    ?>
        <div class="row prefix-radius">
          <div class="columns">
            <select name="component">
              <option disabled="disabled" selected>Choose a Component</option>
              <?php 
    foreach ($arrComponents as $arrComponent) {