TOP000_G2.php
3.35 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
<?php
//*****************************************************************************
//*
//* プログラム名:インデックスページ
//* プログラムID:TOP000_G2.php
//* 作成者 :
//*
//*****************************************************************************
header("Content-type: text/html; charset=EUC-JP");
include("include/session_start.inc");
include("include/SessionChk.inc");
include('include/smarty.conf');
include('include/date.inc');
include('./include/Get_GooGleCal.inc');
include('./include/XML_unserialize.php');
$strDBinc="include/dbcon.inc";
include($strDBinc);
if ($scdl_bumon!=99){
if ($scdl_bumon==0){
$SQL = "SELECT syain_cd as syain_cd_a,name_kj_sei,name_kj_mei".
" FROM syain_tbl Where syain_cd<>'$PHP_SYAIN_CD' and del_flg=true Order By Disp_rank";
}else{
$SQL = "SELECT syain_tbl.syain_cd as syain_cd_a,name_kj_sei,name_kj_mei ".
"FROM syain_tbl INNER JOIN syozoku_tbl ON ".
"syain_tbl.syain_cd = syozoku_tbl.syain_cd".
" Where syain_tbl.syain_cd<>'$PHP_SYAIN_CD' and syozoku_cd=$scdl_bumon and del_flg=true ".
" Order By Disp_rank";
}
$ALSCH_RS = pg_exec($SQL);
$intMax=pg_numrows($ALSCH_RS)-1;
for($intCnt = 0; $intCnt < $intMax ; $intCnt++) {
$objRecData = pg_fetch_object($ALSCH_RS, $intCnt);
$strSyain[$intCnt]=$objRecData->syain_cd_a;
}
}else{
//*****個人設定*****//
$strSQL="SELECT syain_cd,disp_no,mygroup,jyokyo_flg FROM kojinset_TBL WHERE syain_cd='$PHP_SYAIN_CD'";
$objRecSet = pg_exec($strSQL);
if (pg_numrows($objRecSet)>0){
$objRecData = pg_fetch_object($objRecSet, 0);
if ($intsts==0){
if($scdl_bumon==""){
$scdl_bumon=$objRecData->disp_no;
}
$bumon_no=$objRecData->disp_no;
}
$mygroup=$objRecData->mygroup;
if ($objRecData->jyokyo_flg==Null || $objRecData->jyokyo_flg==""){
$jyokyo_flg=1;
}else{
$jyokyo_flg=$objRecData->jyokyo_flg;
}
}else{
if ($intsts==0){
if($scdl_bumon==""){
$scdl_bumon=0;
}
$bumon_no=0;
}
$jyokyo_flg=1;
}
$strData=split("/", $mygroup);
for ($intCnt = 0; $intCnt < count($strData)-1; $intCnt++) {
$strSyain[$intCnt]=$strData[$intCnt];
}
}
$RetunData = array();
for ($intCnt = 0; $intCnt < count($strSyain)-1; $intCnt++) {
$Google_URL="";
$strCHKSQL = "select memo from kojin_data_tbl where syain_cd='".$strSyain[$intCnt]."' and seq=23";
$objGoogleData = pg_exec($strCHKSQL);
if(pg_numrows($objGoogleData) > 0){
$objGoogleRec = pg_fetch_object($objGoogleData,0);
//echo $syain_cd."<hr>";
if ($objGoogleRec->memo=="1"){
//Googleカレンダー取得
$strSQL="SELECT * FROM kojin_data_tbl WHERE seq=21 AND syain_cd='".$strSyain[$intCnt]."'";
$objID = pg_exec($strSQL);
if($objID==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
if (pg_numrows($objID) > 0){
$objIDData=pg_fetch_object($objID, 0);
$Google_URL=$objIDData->memo;
}
}
}
$RetunData[$strSyain[$intCnt]]["id"] = "";
$RetunData[$strSyain[$intCnt]]["key"] = "";
if ($Google_URL!=""){
$aryUrl = split("/",$Google_URL);
if (count($aryUrl)<8){
}else{
$RetunData[$strSyain[$intCnt]]["id"] = $aryUrl[5];
$RetunData[$strSyain[$intCnt]]["key"] = str_replace("private-", "", $aryUrl[6]);
}
}
}
echo json_encode($RetunData);
//echo $AryG_Data;
//echo $kojin_sche;
//echo $kojin_sche;
?>