TOP000.php
12.9 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
<?php
header("Content-type: text/html; charset=EUC-JP");
include("include/session_start.inc");
include("include/SessionChk.inc");
include('include/smarty.conf');
//***** 広告設定 *****//
if ($PHP_MODE_FLG==2){
// e-グルPro広告画面誘導処理
//クッキーが存在しない場合は、クッキーをセットし、広告画面へ移動
$cookie_date = date("Y").date("m").date("d");
if (($cookie_date - $_COOKIE["cookie_e-gru_pro_free"]) > 0){
setcookie ("cookie_e-gru_pro_free", $cookie_date,time()+86400);
$strLoginUrl = "Location:e-gru_pro_info.php";
header($strLoginUrl);
}
}
include("inc/header.inc");
include("inc/TOP000.inc");
include("inc/TOP001.inc");
include("inc/TOP005_1.inc");
include("inc/input_chk.inc");
//メニューセット
include("menu_opacity.php");
$strDBinc="include/dbcon.inc";
$DISP_URL="TOP000.php";
include($strDBinc);
//****変数****//
// $name ユーザー名
// $name_sei ユーザー名
// $name_mei ユーザー名
// $SQL SQL
// $Kojin_RS 個人レコードセット
// $KSCH_RS 個人スケジュールレコードセット
// $ALSCH_RS 全体スケジュールレコードセット
// $MEMO_RS 電話メモレコードセット
// $KAI_RS 回覧板レコードセット
// $BBS_RS 掲示板レコードセット
// $PRO_RS プロジェクト管理レコードセット
// $Result 戻り値
// $Today 今日の日付
// $Week 1週間後
// $Work ワーク
// $intMidoku 未読カウンタ
//*****カレンダー編集*****//
$youbi=array("日","月","火","水","木","金","土");
$clender=array("#FDDFFD","#ffffe6","#ffffe6","#ffffe6","#ffffe6","#ffffe6","#CCF8FB");
$schedule=array("#FDDFFD","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#CCF8FB");
//** 表示基準曜日取得 **//
$strSTChk="";
$strSQL = "select memo from kojin_data_tbl where syain_cd='".$PHP_SYAIN_CD."' and seq=15";
$objCHKData = pg_exec($strSQL);
if(pg_numrows($objCHKData) > 0){
$objCHKRec = pg_fetch_object($objCHKData,0);
$strSTChk = $objCHKRec->memo;
}
if ($strwkdate==""){
if ($strSTChk==""){
//*** 基準曜日なし ***//
$st_date = date("Y/m/d");
list($st_year,$st_mon,$st_day)=split("/", $st_date);
//** 先月 **//
$st_sengetu = date("Ymd", mktime (0,0,0,$st_mon-1,$st_day,$st_year));
//** 来月 **//
$st_raigetu = date("Ymd", mktime (0,0,0,$st_mon+1,$st_day,$st_year));
}else{
//*** 基準曜日あり ***//
$st_date = date("Y/m/d");
list($st_year,$st_mon,$st_day)=split("/", $st_date);
//** 今週 **//
$intDateFlg = 0;
for($intCnt = 0; $intCnt < 7 ; $intCnt++) {
$intYoubi=date("w", mktime (0,0,0,$st_mon,$st_day-$intCnt,$st_year));
if ($intYoubi==$strSTChk){
$intDateFlg=$intCnt;
break;
}
}
$st_date =date("Y/m/d", mktime (0,0,0,$st_mon,$st_day-$intDateFlg,$st_year));
list($st_year,$st_mon,$st_day)=split("/", $st_date);
//** 先月 **//
$intDateFlg = 0;
$chk_date =date("Y/m/d", mktime (0,0,0,$st_mon-1,$st_day,$st_year));
list($chk_year,$chk_mon,$chk_day)=split("/", $chk_date);
$intDateFlg = 0;
for($intCnt = 0; $intCnt < 7 ; $intCnt++) {
$intYoubi=date("w", mktime (0,0,0,$chk_mon,$chk_day-$intCnt,$chk_year));
if ($intYoubi==$strSTChk){
$intDateFlg=$intCnt;
break;
}
}
$st_sengetu =date("Ymd", mktime (0,0,0,$chk_mon,$chk_day-$intDateFlg,$chk_year));
//** 来月 **//
$intDateFlg = 0;
$chk_date =date("Y/m/d", mktime (0,0,0,$st_mon+1,$st_day,$st_year));
list($chk_year,$chk_mon,$chk_day)=split("/", $chk_date);
$intDateFlg = 0;
for($intCnt = 0; $intCnt < 7 ; $intCnt++) {
$intYoubi=date("w", mktime (0,0,0,$chk_mon,$chk_day-$intCnt,$chk_year));
if ($intYoubi==$strSTChk){
$intDateFlg=$intCnt;
break;
}
}
$st_raigetu =date("Ymd", mktime (0,0,0,$chk_mon,$chk_day-$intDateFlg,$chk_year));
}
$st_sensyu = date("Ymd", mktime (0,0,0,$st_mon,$st_day-7,$st_year));
$st_kinou = date("Ymd", mktime (0,0,0,$st_mon,$st_day-1,$st_year));
$st_honjitu = date("Ymd", mktime (0,0,0,$st_mon,$st_day,$st_year));
$st_raisyu = date("Ymd", mktime (0,0,0,$st_mon,$st_day+7,$st_year));
$st_ashita = date("Ymd", mktime (0,0,0,$st_mon,$st_day+1,$st_year));
$strwkdate = $st_honjitu;
}else{
if ($strSTChk==""){
//*** 基準曜日なし ***//
$st_honjitu = date("Ymd");
$st_year = substr($strwkdate, 0, 4);
$st_mon = substr($strwkdate, 4, 2);
$st_day = substr($strwkdate, 6, 2);
$st_sengetu = date("Ymd", mktime (0,0,0,$st_mon-1,$st_day,$st_year));
$st_sensyu = date("Ymd", mktime (0,0,0,$st_mon,$st_day-7,$st_year));
$st_raisyu = date("Ymd", mktime (0,0,0,$st_mon,$st_day+7,$st_year));
$st_raigetu = date("Ymd", mktime (0,0,0,$st_mon+1,$st_day,$st_year));
$st_kinou = date("Ymd", mktime (0,0,0,$st_mon,$st_day-1,$st_year));
$st_ashita = date("Ymd", mktime (0,0,0,$st_mon,$st_day+1,$st_year));
}else{
//** 今週 //
list($st_year,$st_mon,$st_day)=split("/", date("Y/m/d"));
$intDateFlg = 0;
for($intCnt = 0; $intCnt < 7 ; $intCnt++) {
$intYoubi=date("w", mktime (0,0,0,$st_mon,$st_day-$intCnt,$st_year));
if ($intYoubi==$strSTChk){
$intDateFlg=$intCnt;
break;
}
}
$st_honjitu =date("Ymd", mktime (0,0,0,$st_mon,$st_day-$intDateFlg,$st_year));
$st_year = substr($strwkdate, 0, 4);
$st_mon = substr($strwkdate, 4, 2);
$st_day = substr($strwkdate, 6, 2);
//** 先月 **//
$intDateFlg = 0;
$chk_date =date("Y/m/d", mktime (0,0,0,$st_mon-1,$st_day,$st_year));
list($chk_year,$chk_mon,$chk_day)=split("/", $chk_date);
$intDateFlg = 0;
for($intCnt = 0; $intCnt < 7 ; $intCnt++) {
$intYoubi=date("w", mktime (0,0,0,$chk_mon,$chk_day-$intCnt,$chk_year));
if ($intYoubi==$strSTChk){
$intDateFlg=$intCnt;
break;
}
}
$st_sengetu =date("Y/m/d", mktime (0,0,0,$chk_mon,$chk_day-$intDateFlg,$chk_year));
//** 来月 **//
$intDateFlg = 0;
$chk_date = date("Y/m/d", mktime (0,0,0,$st_mon+1,$st_day,$st_year));
list($chk_year,$chk_mon,$chk_day)=split("/", $chk_date);
$intDateFlg = 0;
for($intCnt = 0; $intCnt < 7 ; $intCnt++) {
$intYoubi=date("w", mktime (0,0,0,$chk_mon,$chk_day-$intCnt,$chk_year));
if ($intYoubi==$strSTChk){
$intDateFlg=$intCnt;
break;
}
}
$st_raigetu =date("Ymd", mktime (0,0,0,$chk_mon,$chk_day-$intDateFlg,$chk_year));
$st_sensyu = date("Ymd", mktime (0,0,0,$st_mon,$st_day-7,$st_year));
$st_raisyu = date("Ymd", mktime (0,0,0,$st_mon,$st_day+7,$st_year));
$st_kinou = date("Ymd", mktime (0,0,0,$st_mon,$st_day-1,$st_year));
$st_ashita = date("Ymd", mktime (0,0,0,$st_mon,$st_day+1,$st_year));
}
}
//*****部門設定*****//
$strBumon[0][0]=99;
$strBumon[0][1]="- MYグループ -";
$strBumon[1][0]=0;
$strBumon[1][1]="- 全てのグループ -";
$SQL = "SELECT syozoku_cd,bumon_name,disp_rank From mst_bumon Where del_flg=0 Order By disp_rank";
$objBumon = pg_exec($SQL);
$intMax=pg_numrows($objBumon);
for($intCnt = 0; $intCnt < $intMax ; $intCnt++) {
$objRecData = pg_fetch_object($objBumon, $intCnt);
$strBumon[$intCnt+2][0]=$objRecData->syozoku_cd;
$strBumon[$intCnt+2][1]=$objRecData->bumon_name;
}
//*****個人設定*****//
$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;
}
//*****未読電話メモ*****//
if ($PHP_TITLE_NAME[6]!=""){
$SQL = "SELECT message FROM telmemo_TBL WHERE to_code='$PHP_SYAIN_CD' and read_flg=0";
$MEMO_RS = pg_exec($SQL);
$intTelmemo=pg_numrows($MEMO_RS);
}
//201310対応 ToDo・Myノート非表示
$todo_memo_flg = 0;
$strSQL = "select memo from kojin_data_tbl where syain_cd='".$PHP_SYAIN_CD."' and seq=32";
$objRS = pg_exec($strSQL);
if(pg_numrows($objRS) > 0){
$todo_memo_flg = 1;
}
//201310対応 ToDo・Myノート非表示
if ( $todo_memo_flg == 0 ) {
//メモ帳情報取得
$strSQLmemo="Select memo From memo_tbl Where syain_cd = '$PHP_SYAIN_CD' ";
$objRecmemo = pg_exec($strSQLmemo);
if($objRecmemo==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
if (pg_numrows($objRecmemo) > 0){
$objDatamemo = pg_fetch_object($objRecmemo, 0);
$freememo=$objDatamemo->memo;
}else{
$freememo="";
}
$intSeinseiNow=0;
$intSeinseiOK=0;
$intSeinseiNO=0;
//メモ帳
$strSQL="Select memo From kojin_data_tbl Where seq=1 AND syain_cd='$PHP_SYAIN_CD'";
$objRec = pg_exec($strSQL);
if($objRec==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
if (pg_numrows($objRec) > 0){
$objData=pg_fetch_object($objRec, 0);
$memo_mode=$objData->memo;
if ($memo_mode==""){
$memo_mode=0;
}
}else{
$memo_mode=0;
}
$strSQL="Select seq,title,memo From mymemo_tbl Where syain_cd = '$PHP_SYAIN_CD' ORDER BY title";
$objRec = pg_exec($strSQL);
if($objRec==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
if (pg_numrows($objRec) > 0){
for ($intCnt=0; $intCnt < pg_numrows($objRec); $intCnt++){
$objData = pg_fetch_object($objRec, $intCnt);
$MEM_title.='<OPTION value="'.$objData->seq.'"';
if ($memo_mode==$objData->seq){
$MEM_title.=' selected';
}
$MEM_title.='>'.$objData->title.'</OPTION>';
}
}
//ToDoソートコンボ
$strSQL="Select memo From kojin_data_tbl Where seq=4 AND syain_cd='$PHP_SYAIN_CD'";
$objRec = pg_exec($strSQL);
if($objRec==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
if (pg_numrows($objRec) > 0){
$objData=pg_fetch_object($objRec, 0);
$todo_mode=$objData->memo;
if ($todo_mode==""){
$todo_mode=0;
}
}else{
$todo_mode=0;
}
//リスト 0:Todo名ASC 1:重要度DESC 2:終了日DESC
$tempArr[0] = "ToDo名";
$tempArr[1] = "重要度";
$tempArr[2] = " 〆日";
for ($intCnt=0; $intCnt <= 2; $intCnt++){
$ToDo_title.='<OPTION value="'.$intCnt.'"';
if ($todo_mode==$intCnt){
$ToDo_title.=' selected';
}
$ToDo_title.='>'.$tempArr[$intCnt].'</OPTION>';
}
}
//新着情報
$BR_CT=0;
$SPRIT = 5;
/*
if($HTML_SMET!=""){
$BR_CT+=1;
if($BR_CT % $SPRIT == 0){
$HTML_SMET.="<BR>";
}
}
if($HTML_EMET!=""){
$BR_CT+=1;
if($BR_CT % $SPRIT == 0){
$HTML_EMET.="<BR>";
}
}
if($HTML_SCH!=""){
$BR_CT+=1;
if($BR_CT % $SPRIT == 0){
$HTML_SCH.="<BR>";
}
}
if($HTML_MIL!=""){
$BR_CT+=1;
if($BR_CT % $SPRIT == 0){
$HTML_MIL.="<BR>";
}
}
if($HTML_TEL!=""){
$BR_CT+=1;
if($BR_CT % $SPRIT == 0){
$HTML_TEL.="<BR>";
}
}
if($HTML_BBS!=""){
$BR_CT+=1;
if($BR_CT % $SPRIT == 0){
$HTML_BBS.="<BR>";
}
}
if($HTML_CIR!=""){
$BR_CT+=1;
if($BR_CT % $SPRIT == 0){
$HTML_CIR.="<BR>";
}
}
if($HTML_MET!=""){
$BR_CT+=1;
if($BR_CT % $SPRIT == 0){
$HTML_MET.="<BR>";
}
}
if($HTML_PRT!=""){
$BR_CT+=1;
if($BR_CT % $SPRIT == 0){
$HTML_PRT.="<BR>";
}
}
if($HTML_FLO!=""){
$BR_CT+=1;
if($BR_CT % $SPRIT == 0){
$HTML_FLO.="<BR>";
}
}
if($HTML_FLO2[$i]!=""){
$BR_CT+=1;
if($BR_CT % $SPRIT == 0){
$HTML_FLO2[$i].="<BR>";
}
}
*/
$o_smarty->assign('SMET',$HTML_SMET);
$o_smarty->assign('EMET',$HTML_EMET);
$o_smarty->assign('GMET',$HTML_GMET);
$o_smarty->assign('NMET',$HTML_NMET);
$o_smarty->assign('SCH',$HTML_SCH);
$o_smarty->assign('MIL',$HTML_MIL);
$o_smarty->assign('TEL',$HTML_TEL);
$o_smarty->assign('BBS',$HTML_BBS);
$o_smarty->assign('CIR',$HTML_CIR);
$o_smarty->assign('MET',$HTML_MET);
$o_smarty->assign('PRT',$HTML_PRT);
$o_smarty->assign('FLO',$HTML_FLO);
//$o_smarty->assign('FLO2',$HTML_FLO2);
$o_smarty->assign('FLO3',$HTML_FLO3);
$o_smarty->assign('FLO4',$HTML_FLO4);
$o_smarty->assign('FLO5',$HTML_FLO5);
$o_smarty->assign('PRJ',$HTML_PRJ);
//メモ帳
$o_smarty->assign('MEM_title',$MEM_title);
//20091007 スケジュールタイトル名 表示のため追加
$o_smarty->assign('PHP_TITLE_NAME2',$PHP_TITLE_NAME[12]);
//Todo
$o_smarty->assign('ToDo_title',$ToDo_title);
//20091007 スケジュールタイトル名 表示のため追加
$o_smarty->assign('PHP_TITLE_NAME1',$PHP_TITLE_NAME[1]);
//スケジュールヘッダー部分
$o_smarty->assign('strwkdate',$strwkdate);
$o_smarty->assign('scdl_bumon',$scdl_bumon);
$o_smarty->assign('group_combo',$group_combo);
$o_smarty->assign('year',$year);
$o_smarty->assign('month',$month);
$o_smarty->assign('Weekdate',$Weekdate);
$o_smarty->assign('st_sengetu',$st_sengetu);
$o_smarty->assign('st_sensyu',$st_sensyu);
$o_smarty->assign('st_kinou',$st_kinou);
$o_smarty->assign('st_honjitu',$st_honjitu);
$o_smarty->assign('st_ashita',$st_ashita);
$o_smarty->assign('st_raisyu',$st_raisyu);
$o_smarty->assign('st_raigetu',$st_raigetu);
$o_smarty->assign('Group_Name',$info_title);
$o_smarty->assign('Schedule_Main',$info_value);
$o_smarty->assign('scdl_bumon',$scdl_bumon);
$o_smarty->assign('PHP_SYAIN_CD', $PHP_SYAIN_CD);
//201310対応 ToDo・Myノート非表示
$o_smarty->assign('todo_memo_flg',$todo_memo_flg);
$o_smarty->display('TOP000.tpl');
?>