Ejemplo n.º 1
0
/**
 * @return &array объект запроса
 */
function &construct()
{
    $Request = [];
    setQuery($Request, isset($_GET) ? $_GET : []);
    setPost($Request, isset($_POST) ? $_POST : []);
    setServer($Request, $_SERVER);
    global $argc, $argv;
    setArgc($Request, isset($argc) ? $argc : 0);
    setArgv($Request, isset($argv) ? $argv : []);
    return $Request;
}
                     } else {
                         if ($cellColumn == 'H') {
                             $profile[$profileDetails[$index]] = parseString($cell->getValue());
                         } else {
                             $profile[$profileDetails[$index]] = parseNumber($cell->getValue());
                         }
                     }
                     $index++;
                 }
                 setPost('upload', addProfile($profile));
                 // TODO: Detect if there are collision of ID numbers
                 if (getPost('upload') == 'success') {
                     $addedProfiles++;
                 }
             }
             setPost('upload', 'success');
         }
     }
 } else {
     if (issetPost('add')) {
         $profileString = array('id', 'course', 'surname', 'firstname', 'mi', 'mobile', 'email');
         $profileNull = array('birthday');
         $profileNum = array('yr', 'gender', 'scholar', 'dormer', 'currentStatus', 'loawRecord', 'y1s1', 'y1s2', 'y2s0', 'y2s1', 'y2s2', 'y3s0', 'y3s1', 'y3s2', 'y4s0', 'y4s1', 'y4s2', 'y5s0', 'y5s1', 'y5s2', 'familyLivingSituation', 'atmosphereAtHome', 'parentsMaritalStatus', 'relFather', 'relMother', 'spiritualSubscale', 'godSubscale', 'problemSolving', 'seekingSocialSupport', 'avoidance', 'lvlDepression', 'lvlAnxiety', 'suicideBehavior', 'suicidalThoughts', 'hypochondriasis', 'depression', 'denial', 'interProblems', 'alienation', 'perseIdeas', 'anxiety', 'thinkingDisorder', 'impulseExp', 'socialIntroversion', 'selfDepreciation', 'deviation', 'mentalDisorder', 'alcoholUse', 'drugUse', 'hopelessness', 'traumaAbuse', 'physicalIllness', 'pastSuicidalActs', 'familyHistorySuicide', 'familyHistoryMental', 'stressfulLifeEvents', 'relationalSocialLoss', 'accessLethalMeans', 'disciplinaryCases', 'sexualOrientation');
         $profile = array();
         for ($i = 0; count($profileString) > $i; $i++) {
             $profile[$profileString[$i]] = getPost($profileString[$i]);
         }
         for ($i = 0; count($profileNull) > $i; $i++) {
             $profile[$profileNull[$i]] = parseString(getPost($profileNull[$i]));
         }
         for ($i = 0; count($profileNum) > $i; $i++) {
Ejemplo n.º 3
0
        // si on a posté le formulaire :
        if (!empty($_POST)) {
            require MODELES . 'backoffice/createPost.php';
            if ($postId = createPost($_POST['question'], $_POST['reponse'])) {
                $message = 'Nouvelle entrée créée avec succès !';
            } else {
                $message = 'Oups ! Une erreur s\'est produite...';
            }
            $post = ['id' => $postId, 'question' => $_POST['question'], 'reponse' => $_POST['reponse']];
        } else {
            $post = ['id' => 'new', 'question' => '', 'reponse' => ''];
        }
    } else {
        if (isset($_GET['id']) && ($post = getPosts($_GET['id']))) {
            // si on a posté le formulaire :
            if (!empty($_POST)) {
                require MODELES . 'backoffice/setPost.php';
                if (setPost($_GET['id'], $_POST['question'], $_POST['reponse'])) {
                    $message = 'La modification a été effectuée !';
                } else {
                    $message = 'Oups ! Une erreur s\'est produite...';
                }
            }
            $post = getPosts($_GET['id']);
        } else {
            echo 'Invalid parameter';
            exit;
        }
    }
    require VUES . 'backoffice/editfaq.php';
}
<?php

session_start();
include_once $_SERVER['DOCUMENT_ROOT'] . '/Student-Risk-Monitoring-System/res/php/db.inc.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/Student-Risk-Monitoring-System/res/php/magicQuotes.inc.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/Student-Risk-Monitoring-System/res/php/otherHelpers.inc.php';
magicQuotes();
if (issetPost('logout')) {
    $_SESSION['account'] = NULL;
    //setSession('account', NULL);
}
connect('strims', 'root', 'Martinez');
if (issetPost('username') || issetPost('password')) {
    $account = login(getPost('username'), getPost('password'));
    if ($account != NULL) {
        setSession('account', $account);
        //$_SESSION['account'] = $account;
        include 'home.html.php';
        exit;
    } else {
        setPost('invalid', true);
    }
}
if (issetSession('account')) {
    include 'home.html.php';
    exit;
}
include 'index.html.php';