Beispiel #1
0
<?php

require_once "../../class/Utils.php";
require_once "../../class/DBWork.php";
require_once "../../class/DBMemberWork.php";
require_once "../../class/SessionManager.php";
$memWork = new DBMemberWork(true);
try {
    //$_POST : [login_id], [login_pw]
    //$memWork->createWork($_GET, false);
    $memWork->createWork($_POST, false);
    $res = $memWork->requestLogin();
    //세션 정보 저장
    $manager = new SessionManager();
    $manager->setUserNm($res['user_name']);
    $manager->setCoNm($res['co_nm']);
    $manager->setUserType($res['auth_id']);
    $headContent = "Location:../../route.php";
    $manager->destory();
    $memWork->destoryWork();
    if ($res) {
        if (isset($_POST["contents"])) {
            $headContent = $headContent . '?contents=' . $_POST["contents"];
            header($headContent);
        } else {
            header($headContent);
        }
    } else {
        $_SESSION['isLoginFail'] = 'y';
        header($headContent);
    }
<?php

require_once "../../class/Utils.php";
require_once "../../class/DBWork.php";
require_once "../../class/SessionManager.php";
require_once "../../class/DBMemberWork.php";
$memWork = new DBMemberWork(true);
$index = (int) $_POST["index"];
$ret = array();
if ($index > -1) {
    $ret["CODE"] = '00';
    $companyArray = $_SESSION[DBWork::companyArray];
    $comp = $companyArray[$index];
    if (!empty($comp)) {
        //세션 설정
        $_SESSION[DBWork::companyKey] = $comp["co_id"];
        $manager = new SessionManager();
        $manager->setCoNm($comp["co_nm"]);
    } else {
        $ret["CODE"] = '99';
        $ret['MSG'] = "회사정보를 불러오는데 문제가 발생하였습니다.";
    }
    $ret['DATA'] = $comp;
} else {
    $ret["CODE"] = '99';
    $ret['DATA'] = $index;
    $ret['MSG'] = "회사정보를 불러오는데 문제가 발생하였습니다.";
}
echo json_encode($ret);
$memWork->destoryWork();
exit;
Beispiel #3
0
require_once "../../class/Utils.php";
require_once "../../class/DBWork.php";
require_once "../../class/DBMemberWork.php";
require_once "../../class/SessionManager.php";
$memWork = new DBMemberWork(true);
try {
    //$_POST : [login_id], [login_pw]
    //$memWork->createWork($_GET, false);
    $_POST['login_id'] = 'sample';
    $_POST['login_pw'] = 'sample';
    $memWork->createWork($_POST, false);
    $res = $memWork->requestLogin();
    //세션 정보 저장
    $manager = new SessionManager();
    $manager->setUserNm($res[3]);
    $manager->setCoNm($res[4]);
    $manager->setUserType($res[1]);
    $headContent = "Location:../../route.php";
    $manager->destory();
    $memWork->destoryWork();
    if ($res) {
        if (isset($_POST["contents"])) {
            $headContent = $headContent . '?contents=' . $_POST["contents"];
            header($headContent);
        } else {
            header($headContent);
        }
    } else {
        header($headContent);
    }
} catch (Exception $e) {