RPT001.php
2.75 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
<?php
//*****************************************************************************
//*
//* プログラム名:営業日報
//* プログラムID:RPT001.php
//* 機能 :営業日報一覧画面
//* 作成者 :
//*
//*****************************************************************************
header("Content-type: text/html; charset=EUC-JP");
include("include/session_start.inc");
include("include/SessionChk.inc");
include("inc/header.inc");
include("inc/input_chk.inc");
include('./include/smarty.conf');
include("inc/RPT001.inc");
//メニューセット
include("menu_opacity.php");
$strDBinc="include/dbcon.inc";
include($strDBinc);
$strSQL="";
$objRec="null";
$strSyain="";
$objRecSyain="null";
$strChek="";
$objRecChek="null";
if (empty($intPage)){
$intPage=0;
}
if(empty($disp_mode)){
$disp_mode = "1";
}
//自分の所属を取得
$strSQL_s = "SELECT syozoku_cd FROM syozoku_tbl WHERE syain_cd ='$PHP_SYAIN_CD' ";
$objRec_s = pg_exec($strSQL_s);
if($objRec_s==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
for ($intSyozoku=0; $intSyozoku < pg_numrows($objRec_s); $intSyozoku++){
$objSyozoku = pg_fetch_object($objRec_s, $intSyozoku);
if ($intSyozoku==0){
$strJoken= " Where (bumon_cd =0 or bumon_cd = " .$objSyozoku->syozoku_cd ;
}else{
$strJoken=$strJoken. " or bumon_cd=".$objSyozoku->syozoku_cd ;
}
}
if (pg_numrows($objRec_s) > 0){
$strJoken=$strJoken. ") ";
}else{
$strJoken= " Where (bumon_cd =0)";
}
//営業日報情報取得
$strSQL="SELECT read_flg,eigyo_memo_tbl.seq,date,time,time_e,tori_name,charge,eigyo_memo_tbl.syain_cd,syain_list,visit_purpose,memo,subject,bikou ".
" FROM eigyo_memo_tbl,peigyou_tbl ".$strJoken.
" and ( eigyo_memo_tbl.seq = peigyou_tbl.seq and peigyou_tbl.syain_cd ='$PHP_SYAIN_CD' ) ".
// " Order by read_flg,date DESC,time DESC,eigyo_memo_tbl.seq DESC ";
" Order by read_flg,eigyo_memo_tbl.update DESC,date DESC,time DESC,eigyo_memo_tbl.seq DESC ";
$objRec = pg_exec($strSQL);
if($objRec==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
//<!--営業日報-->
if($admin_session=="administrator"){
$PhpTitle = " 営業日報編集 ";
}else{
$PhpTitle = " 作成一覧 ";
}
if (($intPage > 0) && (pg_numrows($objRec) > (10 * ($intPage+1)))){
$PageBackPrm = $intPage-1;
$PageNextPrm = $intPage+1;
}elseif(($intPage > 0) && (pg_numrows($objRec) <= (10 * ($intPage+1)))){
$PageBackPrm = $intPage-1;
$PageNextPrm = "";
}elseif(($intPage == 0) && (pg_numrows($objRec) > (10 * ($intPage+1)))){
$PageBackPrm = "";
$PageNextPrm = $intPage+1;
}else{
$PageBackPrm = "";
$PageNextPrm = "";
}
$o_smarty->assign('PageBackPrm',$PageBackPrm);
$o_smarty->assign('PageNextPrm',$PageNextPrm);
$o_smarty->assign('PhpTitle',$PhpTitle);
$o_smarty->assign('disp_mode',$disp_mode);
$o_smarty->assign('PHP_TITLE_NAME',$PHP_TITLE_NAME[4]);
$o_smarty->display('RPT001.tpl');
?>