<?php

add_required_class('Application.Controller.php', CONTROLLER);
$application = ApplicationController::getInstance();
if (!$application->session->isSessionAuthenticated()) {
    ?>

<a href="login.php" target="login_module" class="trigger">Login</a>

<div class="lightbox" id="login_module">
	<form action="<?php 
    echo CONTROLLER_PATH;
    ?>
User.Controller.php" method="GET" class="form">
		<h3>Login</h3>
		<p>
			<input type="hidden" name="redirect" value="IndexPage" />
			<input type="hidden" name="message" value="login" />
			<label for="username_login">Username:</label><input type="text" name="username_login" id="username_login" value="username" validate="username"/>
		</p>
		<p>
			<label for="password_login">Password:</label><input type="password" name="password_login" id="password_login" value="password" validate="password"/>
		</p>
		<p>
			<input type="submit" name="submit" id="submit_login" value="Login &gt;&gt;" />
		</p>
	</form>
	<h3>Dont't have an account?</h3>
	<p>
		<a href="login.php?action=register">Register</a> for an account with Techweaver Contractor Services now!
	</p>
Beispiel #2
0
<?php

require_once "resources/bin/constants.php";
add_required_class('Scaffold.Controller.php', SCAFFOLD);
add_required_class('Scaffold.Class.php', SCAFFOLD);
add_required_class('Scaffolding.Class.php', SCAFFOLD);
$controller = ScaffoldController::getInstance($application);
$action = $_REQUEST["action"];
$table = $_REQUEST["table"];
$id = $_REQUEST["id"];
if (isset($_REQUEST["submit"])) {
    echo $controller->doSubmission($action, $table, $id, $_REQUEST);
} else {
    echo $controller->doAction($action, $table, $id);
}
//$action = $_REQUEST["action"];
//$connection = $application->getDatabaseConnection();
//
//switch($action){
//	case "create":
//		showCreateInfo($connection);
//		break;
//	case "tableInfo":
//		showTableInfo($connection);
//		break;
//	case "allTables":
//	default:
//		showAllTables($connection);
//}
//
//function showAllTables($connection) {
<?php

//add_required_class( 'Connection.Class.php', MODEL );
add_required_class('User.Class.php', MODEL);
add_required_class('Document.Class.php', MODEL);
// tools already a part of the app
//require_once( 'resources/bin/helpers/tools.php' );
define(ERROR_MESSAGES, "errors");
define(WARNING_MESSAGES, "warnings");
define(INFORMATIONAL_MESSAGES, "messages");
class ApplicationController
{
    public $isLoggedIn;
    private $user;
    private $connection;
    public $session;
    private $appSettings;
    public $registrationPage;
    private static $instance;
    private $messages;
    private function __construct()
    {
        $this->connection = DatabaseConnection::getInstance();
        $this->session = SessionController::getInstance();
        $this->session->start();
        $this->appSettings = new ApplicationSettings(APPLICATION_SETTINGS_FILE, ENVIRONMENT);
        $username = '';
        $this->messages = array(ERROR_MESSAGES => array(), WARNING_MESSAGES => array(), INFORMATIONAL_MESSAGES => array());
        if (isset($_SESSION['username'])) {
            $username = $_SESSION['username'];
        }
Beispiel #4
0
<?php

add_required_class('Calendar.Class.php', MODEL);
$calendar = new Calendar();
$calendar->buildCalendar();
echo $calendar->getOutput();
echo "<hr/>";
$calendar = new Calendar("2010-3-21");
$calendar->buildCalendar();
echo $calendar->getOutput();
echo "<hr/>";
$calendar = new Calendar("12-2-2009", "d-m-Y");
$calendar->buildCalendar();
echo $calendar->getOutput();
echo "<hr/>";
//$calendar = new Calendar(DateTime::createFromFormat("d-m-Y","29-05-1981"));
$calendar = new Calendar(date_create("29-05-1981"));
$calendar->buildCalendar();
echo $calendar->getOutput();
//DateTime::createFromFormat($this->format,"{$this->year}-{$this->mon}-01");
Beispiel #5
0
	public function processDependency($nodes){
		if(!isset($nodes)){
			return;
		}

		foreach($nodes as $node){		
			if($node->hasAttributes()){
				// setup dependencies
				$head = $this->template->query("head");
				if(!isset($head) || 0 == $head->length){
					return;
				}
				// we are really only expecting one head element in an xhtml document ...
				$head = $head->item(0);
				$dependencyType = '';
				$element = null;
				
				/********************************************
				 * current host is 5.2.1, does not support closures, will update when host updates
				 
				$compareElements = function($node1,$node2){
					$linkType = '';
					$duplicate = true;
					if(isset($node1) && isset($node2)){
						$linkType = ($node1->nodeName == "link") ? "href" : "src";
						if($node1->hasAttribute($linkType) && $node2->hasAttribute($linkType)){
							$duplicate = (0 == strcmp($node1->getAttribute($linkType), $node2->getAttribute($linkType))) ? true : false;						
						}
					}
					return $duplicate;
				};
				*/
				
				if($node->hasAttribute("type")){
					$dependencyType = $node->getAttribute("type");
					switch($dependencyType){
						case DEPENDENCY_TYPE_STYLE_VALUE:
							$element = $this->template->createElement("link");
							$element->setAttribute("rel","stylesheet");
							$element->setAttribute("href", STYLE_PATH . $node->nodeValue);
							$element->setAttribute("type","text/css");
							$element->setAttribute("media",(($node->hasAttribute("media")) ? $node->getAttribute("media") : "media"));
							$this->template->appendUniqueChildToParent($head,$element,array("Page", "compareElements"));							
							break;
						case DEPENDENCY_TYPE_SCRIPT_VALUE:
							$element = $this->template->createElement("script");
							$element->setAttribute("src", JAVASCRIPT_PATH . $node->nodeValue);
							$element->setAttribute("type","text/javascript");
							$this->template->appendUniqueChildToParent($head,$element,$compareElements);
							break;
						case DEPENDENCY_TYPE_CLASS_VALUE:
							if($node->hasAttribute("subtype")){
								add_required_class( $node->nodeValue, $node->getAttribute("subtype") );
							}
							break;
						default:
							break;
					}
				}
			}
		}
	}
Beispiel #6
0
<?
ob_start();
require_once( "resources/bin/constants.php");
add_required_class( 'Page.Class.php', MODEL );
//$application = new ApplicationSettings( "MedTeleNursing.AppSettings", ENVIRONMENT);
$pageName = $_REQUEST[ 'page' ];
if($application->isPageGated($pageName)){
	if(!$application->session->isSessionAuthenticated()){
		$application->enforceGate();
	}
}
$page = new Page( $pageName );
$page->process();
echo htmlspecialchars_decode( $page->output() );
echo ob_get_clean();
?>