示例#1
0
<?php

include_once $_SERVER["DOCUMENT_ROOT"] . "/app/controller/access.controller.php";
include_once $_SERVER["DOCUMENT_ROOT"] . "/app/model/profile.model.php";
$profile = new Profile();
if (!empty($_POST) && $_SERVER['REQUEST_URI'] != "/search/") {
    $id = $_SESSION["id"];
    if (empty($profile->gimme("name", "id", $id))) {
        include_once $_SERVER["DOCUMENT_ROOT"] . "/app/model/sign-up.model.php";
        $signUp = new signUp();
        $signUp->notifySlack($id, $_POST["name"], $_POST["occupation"], $_POST["location"], $_POST["cause"]);
    }
    if (!empty($_FILES["photo"]["name"])) {
        include_once $_SERVER["DOCUMENT_ROOT"] . "/app/model/avatar.model.php";
        $avatar = new Avatar();
        $avatar->save($_FILES["photo"], $id);
    }
    if (isset($_POST["jcrop-x"]) && $_POST["jcrop-w"] != 0) {
        // Create array to hold jcrop values
        $jcrop = array();
        // Push incoming jcrop values to jcrop[]
        array_push($jcrop, $_POST["jcrop-x"], $_POST["jcrop-y"], $_POST["jcrop-w"], $_POST["jcrop-h"]);
        // Get Avatar class so we can crop
        include_once $_SERVER["DOCUMENT_ROOT"] . "/app/model/avatar.model.php";
        $avatar = new Avatar();
        $avatar->crop($jcrop, $id);
    }
    unset($_POST["jcrop-x"]);
    unset($_POST["jcrop-y"]);
    unset($_POST["jcrop-w"]);
    unset($_POST["jcrop-h"]);