SIM0010.php
4.31 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<?PHP
//*****************************************************************************
//* プログラム名:ユーザログイン
//* プログラムID:SIM0010.php
//* 機能 :グループログインチェック+ユーザログイン画面
//*****************************************************************************
header("Content-type: text/html; charset=EUC-JP");
include("./inc/session_start.inc");
include("./inc/dbcon_group.inc");
include('./inc/smarty.conf');
include('./inc/const.inc');
if(trim($_POST["gid"]) != "" && trim($_POST["gpw"]) != ""){
$gid = trim($_POST["gid"]);
$gpw = trim($_POST["gpw"]);
}else{
header("Location:".$DEFARR[1]);
exit;
}
$strSQLGroup="SELECT * From group_inf where group_id='".$gid."' and group_pw='".$gpw."'";
$objRecGroup = pg_exec($strSQLGroup);
if($objRecGroup==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
session_unregister("PHP_DB_NAME");
session_unregister("PHP_GROUP_NAME");
session_unregister("PHP_GROUP_ID");
session_unregister("PHP_USE_FUNC");
if(pg_numrows($objRecGroup) > 0){
$objGroup = pg_fetch_object($objRecGroup, 0);
$PHP_DB_NAME = $objGroup->db_name;
$PHP_GROUP_NAME = $objGroup->group_name;
$regiDate = $objGroup->regi_date;
$PHP_GROUP_ID = $gid;
$PHP_USE_FUNC = $objGroup->use_func; //20100510 use_func判定
session_register("PHP_DB_NAME");
session_register("PHP_GROUP_NAME");
session_register("PHP_GROUP_ID");
session_register("PHP_USE_FUNC");
//クッキーセット
setcookie("cookie_GroupID",$gid,time() + 604800);
setcookie("cookie_GroupPW",$gpw,time() + 604800);
}else{
if ($_POST["backurl"] == hp) {
header("Location:".$DEFARR[1]);
}else{
header("Location:./index.php?err=1");
}
exit;
}
//担当者情報
$strSQLTanto="SELECT * From register_info where group_id='".$gid."'";
$objRecTanto = pg_exec($strSQLTanto);
if($objRecTanto==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
session_unregister("PHP_TANTO_NAME");
session_unregister("PHP_TANTO_MAIL");
session_unregister("PHP_LIMIT_FLAG");
$PHP_LIMIT_FLAG="";
if(pg_numrows($objRecTanto) > 0){
$objTanto = pg_fetch_object($objRecTanto, 0);
$PHP_TANTO_NAME = $objTanto->tanto_name;
$PHP_TANTO_MAIL = $objTanto->tanto_mail;
$PHP_REGIST_FLAG = $objTanto->regist_flg;
/* 無料化により、期限チェックを外しました
$limitMonth = date("Y/m/d",mktime(0, 0, 0, intval(date("m",strtotime($regiDate)))+1, date("d",strtotime($regiDate)), date("Y",strtotime($regiDate))));
$todayMonth = date("Y/m/d");
if($todayMonth >= $limitMonth && $PHP_REGIST_FLAG != 1){
//echo "期限オーバー";
$PHP_LIMIT_FLAG = "NG";
}
*/
session_register("PHP_TANTO_NAME");
session_register("PHP_TANTO_MAIL");
session_register("PHP_LIMIT_FLAG");
session_register("PHP_REGIST_FLAG");
}
//最終ログイン時間
$lastDate = date("Y/m/d H:i:s");
$strSQLGroup="UPDATE group_inf SET last_login = '". $lastDate ."' WHERE group_id='".$gid."' AND group_pw='".$gpw."'";
$objRecGroup = pg_exec($strSQLGroup);
if($objRecGroup==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
//ユーザリスト
include("./inc/dbcon.inc");
$strSQL = "select * from user_inf order by disp_rank";
$objRec = pg_exec($strSQL);
if($objRec==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
$userCMB = "";
for ($intCnt = 0; $intCnt < pg_numrows($objRec); $intCnt++) {
$objUser = pg_fetch_object($objRec, $intCnt);
$userCMB .= '<option value="'.$objUser->user_seq.'"';
if(($objUser->user_seq == $_COOKIE["cookie_user_cd"])){
$userCMB .= " selected";
}
$userCMB .= '>'.$objUser->user_namekj."</option>";
}
//HTMLヘッダの書き出し
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; cahrset=euc-jp">
<meta http-equiv="content-style-type" content="text/css">
<meta name="robots" content="noindex, nofollow">
<title><?PHP echo($PHP_SYSNAME); ?></title>
<link rel="stylesheet" href="./templates/SIMlite.css" type="text/css" />
</head>
<?PHP
//[0]システムURL、[1]HP URL、[2]マニュアルURL、[3]MTC HP URL、[4]マスタメールアドレス、
//[5]期間区分名、[6]大区分名、[7]小区分名、[8]支出名、[9]収入名、[10]消費税率(文字型)
$o_smarty->assign('DEFARR',$DEFARR);
$o_smarty->assign('PHP_SYSNAME',$PHP_SYSNAME);
$o_smarty->assign('PHP_GROUP_NAME',$PHP_GROUP_NAME);
$o_smarty->assign('userCMB',$userCMB);
$o_smarty->assign('gid',$gid);
$o_smarty->assign('gpw',$gpw);
$o_smarty->display('SIM0010.tpl');
?>