Example #1
0
include "fragment/head.php";
?>
<body>
<div id="wrapper">
    <?php 
include "fragment/header.php";
?>
    <?php 
require_once dirname(__FILE__) . '\\..\\util.php';
require_controller('listqueriescontroller');
require_controller('profilecontroller');
require_controller('photoController');
use Qnet\Controller\ListQueriesController;
$controller = new ListQueriesController();
use Qnet\Controller\PhotoController;
$photoController = new PhotoController();
$photoPath = $photoController->getPhoto();
?>

    <div id="page">
        <div id="content">
            <div class="post">
                <h2 class="title">Select a query to answer!</h2>
                <div class="entry">
                <?php 
while ($controller->hasMoreQueries()) {
    $controller->nextQuery();
    echo '<p>' . $controller->getQueryLink() . '</p>';
}
?>
                </div>
Example #2
0
<?php

namespace Qnet\Controller;

require_once dirname(__FILE__) . '\\..\\util.php';
require_dao("photoDAO");
use Qnet\dao\photoDAO;
require_controller("SessionController");
use Qnet\Controller\SessionController;
$actionId = $_GET['actionId'];
if ($actionId == 1) {
    $photoController = new PhotoController();
    $photoController->uploadAndRedirect();
}
class PhotoController
{
    private $photoDao;
    private $sessionController;
    public function __construct()
    {
        $this->photoDao = new PhotoDao();
        $this->sessionController = new SessionController();
    }
    public function uploadPhoto()
    {
        $mime = $_FILES["uploadedfile"]["type"];
        $type = substr($mime, 6, strlen($mime) - 1);
        if ($type == "jpeg") {
            $size = $_FILES["uploadedfile"]["size"] / 1024;
            $userID = $this->sessionController->getUID();
            $path = "/images/profilePhotos/{$userID}.{$type}";