<?php

$response = array();
$response["success"] = -1;
session_start();
if (!isset($_SESSION["session_name"])) {
    header("Location:../index.php");
    exit;
} else {
    // reaching from current directory to _user_info
    require_once __DIR__ . '/../../php/user_info.php';
    $user = new UserInfo();
    $json = $user->module_user_id("delta", "./school_management", $_SESSION["session_name"]);
    //echo $json;
    //var_dump(json_decode($json,true));
    //echo "<script>console.log(".$json.")</script>";
    $userInfo = json_decode($json, true);
    $myUserName = $userInfo['result'][0]['username'];
    $myUserType = $userInfo['result'][0]['user_role'];
    //$userInfo['result'][6]['user_info'];
    //echo $json['result'][6]['user_role'];
}
//echo json_encode($response);
?>


<style>
<?php 
include 'css/master-ui.css';
?>
</style>
示例#2
0
<?php

$response = array();
$response["success"] = -1;
session_start();
if (!isset($_SESSION["session_name"]) || $_SESSION["session_name"] == "") {
    header("Location:../index.php");
    exit;
} else {
    // reaching from current directory to _user_info
    require_once __DIR__ . '/../../php/user_info.php';
    $user = new UserInfo();
    $user_data_values = $user->module_user_id("delta", "./donations", $_SESSION["session_name"]);
    //echo $user_data_values;
    $zzzz = json_decode($user_data_values);
    //echo "\n" .
    $user_donor = $zzzz->result[0]->is_donor;
    $_SESSION["user_first_name_"] = $zzzz->result[0]->firstname;
    $_SESSION["user_last_name_"] = $zzzz->result[0]->lastname;
    $_SESSION["user_email_"] = $zzzz->result[0]->email;
    if ($user_donor == 1) {
        $_SESSION["user_type"] = "donor";
        echo "<script>window.location = 'donation_method.php'; </script>";
    } else {
        if ($user_donor == 0) {
            $_SESSION["user_type"] = "acceptor";
            echo "<script>window.location = 'method.php'; </script>";
        } else {
            if ($user_donor == 2) {
                $_SESSION["user_type"] = "admin";
                echo "<script>window.location = 'insert_monetary_help.php'; </script>";
<body>
<?php 
$response = array();
$response["success"] = -1;
session_start();
if (!isset($_SESSION["session_name"])) {
    header("Location:../index.php");
    exit;
} else {
    // reaching from current directory to _user_info
    require_once __DIR__ . '/../../php/user_info.php';
    $id = $_SESSION["session_name"];
    $pk = "delta";
    $project = "./drixel";
    $user = new UserInfo();
    $result = $user->module_user_id($pk, $project, $id);
    $array = json_decode($result, true);
    $user_info = $array["result"][0];
}
require_once 'db_functions.php';
$db = new db_functions();
if (isset($_POST["sub"])) {
    $user_profile = $db->storeUserProfile($id, $_POST["dateOfBirth"], $_POST["gender"], $_POST["contactNum"], $_POST["address"]);
} else {
    if (isset($_FILES["dp"])) {
        $imagename = $_FILES["dp"]["name"];
        file_put_contents('dps/' . $imagename, file_get_contents($_FILES['dp']['tmp_name']));
        $db->storeUserDP($id, 'dps/' . $imagename);
    }
}
$user_profile = $db->FindUser($id);