-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
70 lines (64 loc) · 2.06 KB
/
index.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
define('ROOT_PATH',dirname(__FILE__).'/');
include ROOT_PATH.'comm/common.inc.php';
if($_GET['action']=='logout'){
unset($_SESSION);
session_destroy();
echo '<script>alert("登出成功!");location.href="index.php";</script>';
exit;
}
$subPage="index.html";
if($_GET["action"]){
$_GET["action"] = addslashes(strip_tags(trim($_GET["action"])));
$subPage=$_GET["action"].".html";
}
$action=isset($_GET['action'])?$_GET['action']:'';
if($action==''){
$action='index';
}
if ($action!="index") {
if(!isset($_SESSION['customer_id'])){
redirect("index.php");
}else{
$_SESSION['customer_id']=(int)$_SESSION['customer_id'];
if($_SESSION['customer_id']){
$cusClass=new registration();
$customerInfo=$cusClass->getCustomer($_SESSION['customer_id']);
}else{
$customerInfo=array();
}
}
if(isset($_GET['patient_id'])){
$_SESSION['patient_id']=(int)$_GET['patient_id'];
} else if (!in_array($_GET["action"],$action_pages)) {
// unset($_SESSION['patient_id']);
}
if($_SESSION['patient_id']){
$patientClass=new patient();
$patientInfo=$patientClass->getInfo((int)$_SESSION['patient_id']);
if($patientInfo['birthday']=='0000-00-00'){
$patientInfo['birthday']='';
}
if ($patientInfo['ACS_24']==1&&$patientInfo['2dm']==1&&$patientInfo['20years']==1&&$patientInfo['consent_given']==1&&$patientInfo['ACS_comorbidity']==0&&$patientInfo['study']==0) $Penroll=true;
else $Penroll=false;
$lockstatus=explode(",",$patientInfo['lock_status']);
$qastatus=explode(",",$patientInfo['qa_status']);
// print_r($qastatus);
}
$noPermission=false;
if ($customerInfo['group_id']<=2) {
if ($customerInfo['hospital_id']!=$patientInfo['hospital_id']) $noPermission=true;
}
$ModifyPermission=true;
if ($customerInfo['group_id']==1) {
// if (in_array($_GET["action"],$action_pages)) {
// }
$actionkey = array_search($_GET["action"], $action_pages);
if ($lockstatus[$actionkey]==1) $ModifyPermission=false;
}
}
if(file_exists(ROOT_PATH.'Tpl/'.$subPage))
include(ROOT_PATH.'Tpl/'.$subPage);
elseif(file_exists(ROOT_PATH.'Tpl/'.$_GET["action"].".php"))
include(ROOT_PATH.'Tpl/'.$_GET["action"].".php");
?>