-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject.php
42 lines (39 loc) · 1.2 KB
/
project.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
include_once __DIR__ . '/lib/common.php';
$page = $_GET['page'];
switch ($page) {
case 'home':
$isExist = include_once __DIR__ . '/action/project/InitProjInfo.class.php';
if ($isExist) {
$action = new InitProjInfo;
$rtn = $action -> doAction();
if ($rtn['errcode'] == 0) {
extract($rtn['data']);
include_once __DIR__ . '/view/project/home.html';
} else {
echo json_encode($rtn);
}
}
break;
case 'profile':
$isLogin = checkInvestorLogin();
if (!$isLogin) {
header('Location: project.php?page=login');
} else {
include_once __DIR__ . '/view/project/' . $page . '.html';
}
break;
default:
include_once __DIR__ . '/view/project/' . $page . '.html';
break;
}
function checkInvestorLogin () {
$projId = $_SESSION['projId'];
$investorId = $_SESSION['investorId'];
$investorSign = $_SESSION['investorSign'];
$sign = md5("projId-$projId&investorId$investorId&kingco");
if ($investorSign != $sign) {
return false;
}
return true;
}