Beispiel #1
0
} else {
    echo '<button onclick="window.location.href=\'/coffee2.0/menu.php\'" type="button" class="btn btn-default navbar-btn">Go to Menu</button>
					<button onclick="window.location.href=\'/coffee2.0/logout.php\'" type="button" class="btn btn-default navbar-btn">Logout</button>';
}
?>
				<button type="button" class="btn btn-default navbar-btn" data-toggle="modal" data-target="#modal-about">About</button>
			</div>
		  </div>
		</nav>
		<?php 
if (isset($_SESSION['user'])) {
    echo $_SESSION['user'];
}
if (isset($_POST['login'])) {
    $login = new coffee("login", array($_POST['usr'], $_POST['passwd']));
    echo $login->rtrnAll();
}
?>
			  <!-- about-model -->
			  <div class="modal fade" id="modal-about" role="dialog">
			    <div class="modal-dialog">
			    
			      <!-- Modal content-->
			      <div class="modal-content">
			        <div class="modal-header">
			          <button type="button" class="close" data-dismiss="modal">&times;</button>
			          <h4 class="modal-title">About Coffee Project</h4>
			        </div>
			        <div class="modal-body">
			          <p>This is a simple reservation (coffee) system.</p>
			          <p>This web app is specially made for developers who share there coffeemachine with each other.
Beispiel #2
0
/**
 * @author Kevin Lorenzo Storms
 * @version 2.0
 *
 * This file receives uploaded profile pictures.
 * Processes it in the database, and it stores the image serverside with a random generaded name.
 * 
 */
require_once $_SERVER['DOCUMENT_ROOT'] . '/coffee2.0/_funct/coffee.php';
if (isset($_POST['f']) && !empty($_POST['f'])) {
    if (isset($_POST['p']) && !empty($_POST['p'])) {
        $functionTroughAjax = new coffee($_POST['f'], $_POST['p']);
    } else {
        $functionTroughAjax = new coffee($_POST['f']);
    }
    print_r(json_encode($functionTroughAjax->rtrnAll()));
}
if (isset($_POST['s'])) {
    if (!isset($_SESSION['coffeeSession']) || empty($_SESSION['coffeeSession'])) {
        echo '06';
    } else {
        echo $_SESSION['coffeeSession'];
    }
}
//if a File is beeing upload
$_GET['f'] = null;
if (isset($_FILES) && $_GET['f'] == "profilePhotoUpload") {
    //checks if there is a file received.
    if ($_FILES['file']['error'] < 0) {
        echo 'Error: ' . $_FILES['file']['error'] . '<br>';
    } else {
Beispiel #3
0
<?php

require_once $_SERVER['DOCUMENT_ROOT'] . '/coffee2.0/_funct/coffee.php';
if (!empty($_SESSION['user']) && isset($_SESSION['user'])) {
    $getUserData = new coffee('renderTemplate');
    echo $getUserData->rtrnAll();
} else {
    echo "<script>alert('First Login');</script>";
    echo '<meta http-equiv="refresh" content="0; url=http://' . DOMAIN . '/coffee2.0/" />';
}
if (isset($_POST['createNewUser'])) {
    $newUSer = new coffee('new_user', $_POST);
    echo $newUSer->rtrnAll();
}
Beispiel #4
0
			 <div class="panel-body">
			    <div class="input-group">
			      <input type="text" class="form-control" name="token" title="token" placeholder="Token" required>
			      <span class="input-group-btn">
			       <input class="btn btn-default" type="submit" name="GO" title="GO" value="GO">
			      </span>
			      </form>
			    </div><!-- /input-group -->
			  
		
		
	<?php 
///print_r($_SESSION);
if (isset($_POST['GO']) && !empty($_POST['token'])) {
    $regis = new coffee("checkToken", $_POST['token']);
    echo $regis->rtrnAll();
    header('Location: http://localhost/coffee2.0/register.php');
}
if (isset($_POST['register'])) {
    if (isset($_POST['passw1']) && isset($_POST['passw2'])) {
        if ($_POST['passw1'] == $_POST['passw2']) {
            $complReg = new coffee("register", array($_POST['passw1'], $_POST['passw2']));
            echo "<script>alert('registered successfully!');</script>";
            header('Location: http://localhost/coffee2.0');
        } else {
            echo "the passwords do not match";
        }
    }
}
if (isset($_SESSION['tempRegSes']) && !empty($_SESSION['tempRegSes'][2])) {
    echo $_SESSION['tempRegSes'][2];