TAK001_m.php
7.06 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
<?php
//*****************************************************************************
//*
//* プログラム名:取引先情報(携帯電話)
//* プログラムID:TAK001_m.php
//* 機能 :一覧画面
//* 作成者 :
//*
//*****************************************************************************
header("Content-type: text/html; charset=Shift_JIS");
//*** 広告 ***//
include("include_m/Advertisement.inc");
//*** 共通処理 ***//
include("include_m/CommonProcess.inc");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<META http-equiv="Content-Style-Type" content="text/css">
<link rel="stylesheet" type="text/css" href="basefont.css">
<TITLE>E-グルPro(取引先情報)</TITLE>
</HEAD>
<BODY>
<form method="GET" action="TAK001_m.php">
<center>
取引先情報一覧<br>
<?php echo $strName; ?>
<HR width="100%">
<?php echo $koukokuTEL; ?>
</center>
<?php
//メニュー表示
include("include_m/CommonMenuReturn.inc");
?>
<HR width="100%">
<?php if ($C==1){ ?>
<a href="TAK003_m.php?<?php echo $PHP_Argument ?>"accesskey="1"><?php echo Get_Num("1"); ?>取引先登録</a><br><br>
<?php } ?>
<?php
if (empty($PG)){
$PG=0;
}
if(empty($S1)){
$S1=99;
}
if ($S1 ==99 && $group_type == ""){
//*****個人設定情報*****//
$strSQLkojin="SELECT * FROM tori_group_tbl Where syain_cd='$PHP_SYAIN_CD'";
$objReckojin = pg_exec($strSQLkojin);
if($objReckojin==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
if(pg_numrows($objReckojin)!=0){
$objkojin = pg_fetch_object($objReckojin, 0);
$S1=$objkojin->tori_group;
}else{
$S1=99;
}
}
//取引先データ取得
//アドレス検索
if ($S2 ==1){
$str_add="ア%/イ%/ウ%/エ%/オ%";
}elseif($S2 ==2){
$str_add="カ%/キ%/ク%/ケ%/コ%/ガ%/ギ%/グ%/ゲ%/ゴ%";
}elseif($S2 ==3){
$str_add="サ%/シ%/ス%/セ%/ソ%/ザ%/ジ%/ズ%/ゼ%/ゾ%";
}elseif($S2 ==4){
$str_add="タ%/チ%/ツ%/テ%/ト%/ダ%/ヂ%/ヅ%/デ%/ド%";
}elseif($S2 ==5){
$str_add="ナ%/ニ%/ヌ%/ネ%/ノ%";
}elseif($S2 ==6){
$str_add="ハ%/ヒ%/フ%/ヘ%/ホ%/バ%/ビ%/ブ%/ベ%/ボ%/パ%/ピ%/プ%/ペ%/ポ%";
}elseif($S2 ==7){
$str_add="マ%/ミ%/ム%/メ%/モ%";
}elseif($S2 ==8){
$str_add="ヤ%/ユ%/ヨ%";
}elseif($S2 ==9){
$str_add="ラ%/リ%/ル%/レ%/ロ%";
}elseif($S2 ==10){
$str_add="ワ%/ヲ%/ン%";
}else{
$str_add="";
}
if ($str_add!=""){
$str_add=mb_convert_encoding(" and ((tori_name_kn Like '".str_replace("/","') or (tori_name_kn Like '",$str_add)."'))", "EUC-JP", "SJIS" );
}
$strSQL = "SELECT * FROM torihiki_tbl WHERE del_flg = true and tori_group=$S1 ".$str_add." ORDER BY tori_name_kn";
$objRec = pg_exec($strSQL);
if($objRec==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
//取引先表示部門
$strSQL_g = "SELECT group_seq,group_name FROM torihiki_group_tbl Order by disp_rank ";
$objRec_g = pg_exec($strSQL_g);
if($objRec_g==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
?>
<?php //*** 取引先表示部門 ***// ?>
<SELECT name="S1">
<option value="99" <?php if ($S1==99){ echo "selected"; } ?>>未設定</option>
<?php
for ($intCnt=0; $intCnt < pg_numrows($objRec_g); $intCnt++){
$objData = pg_fetch_object($objRec_g, $intCnt);
?>
<option value="<?php echo $objData->group_seq ?>" <?php if($S1==$objData->group_seq){ echo "selected"; } ?>>
<?php echo mb_convert_encoding($objData->group_name, "SJIS", "EUC-JP") ?>
</option>;
<?php
}
?>
</SELECT>
<?php //*** カナ検索 ***// ?>
<SELECT name="S2">
<?php
$strDispKeyWord = array("全て","ア","カ(ガ)","サ(ザ)","タ(ダ)","ナ","ハ(バ・パ)","マ","ヤ","ラ","ワ");
for ($search_cnt = 0; $search_cnt < 11; $search_cnt++) {
echo '<option value="'.$search_cnt.'" ';
if($S2 == $search_cnt){
echo "selected";
}
echo '>'.$strDispKeyWord[$search_cnt].'</option>';
}
?>
</SELECT>
<INPUT type="submit" NAME="intsts" VALUE=" 表示 ">
<br>
<?php
if (($PG > 0) && (pg_numrows($objRec) > (5 * ($PG+1)))){
$intPt1=$PG-1;
$intPt2=$PG+1;
echo '<center><a href="TAK001_m.php?'.$PHP_Argument.'">[最新]</a></center>';
echo '<a href="TAK001_m.php?&PG='.$intPt1.'&'.$PHP_Argument.'">[前5件]</a>';
echo '<a href="TAK001_m.php?&PG='.$intPt2.'&'.$PHP_Argument.'">[次5件]</a>';
}elseif(($PG > 0) && (pg_numrows($objRec) <= (5 * ($PG+1)))){
$intPt1=$PG-1;
echo '<center><a href="TAK001_m.php?'.$PHP_Argument.'">[最新]</a></center>';
echo '<a href="TAK001_m.php?&PG='.$intPt1.'&'.$PHP_Argument.'">[前5件]</a>';
echo '[次5件]';
}elseif(($PG == 0) && (pg_numrows($objRec) > (5 * ($PG+1)))){
$intPt2=$PG+1;
echo '<center><a href="TAK001_m.php?'.$PHP_Argument.'">[最新]</a></center>';
echo '[前5件]';
echo '<a href="TAK001_m.php?&PG='.$intPt2.'&'.$PHP_Argument.'">[次5件]</a>';
}else{
echo '<center><a href="TAK001_m.php?'.$PHP_Argument.'">[最新]</a></center>';
echo '[前5件]';
echo '[次5件]';
}
echo "<br><br>";
//終了ページの取得
$intEndCnt=5 * ($PG+1);
if ($intEndCnt>pg_numrows($objRec)){
$intEndCnt=pg_numrows($objRec);
}
//取引先データ表示
if(pg_numrows($objRec)>0){
for ($intCnt=5 * $PG; $intCnt < $intEndCnt; $intCnt++){
$objToriData = pg_fetch_object($objRec, $intCnt);
echo '・<a href="TAK002_m.php?'.$PHP_Argument.'&PG='.$PG.'&SEQ='.$objToriData->seq.'">';
echo mb_convert_encoding($objToriData->tori_name, "SJIS", "EUC-JP")."</A><br>";
//電話番号
if (($objToriData->tel_no!="--") && ($objToriData->tel_no!="")){
echo ' <a href="tel:'.str_replace("-","",mb_convert_encoding($objToriData->tel_no, "SJIS", "EUC-JP" )).'">'.
mb_convert_encoding($objToriData->tel_no, "SJIS", "EUC-JP" )."</a><br>";
}
//メールアドレス
if (($objToriData->tori_email!="@") && ($objToriData->tori_email!="")){
echo ' <a href="mailto:'.mb_convert_encoding($objToriData->tori_email, "SJIS", "EUC-JP" ).'">'.
mb_convert_encoding($objToriData->tori_email, "SJIS", "EUC-JP" )."</a><br>";
}
echo "<br>";
} //for文
} //if文
echo "<br>";
if (pg_numrows($objRec) > 1){
if (($PG > 0) && (pg_numrows($objRec) > (5 * ($PG+1)))){
$intPt1=$PG-1;
$intPt2=$PG+1;
echo '<a href="TAK001_m.php?&PG='.$intPt1.'&'.$PHP_Argument.'">[前5件]</a>';
echo '<a href="TAK001_m.php?&PG='.$intPt2.'&'.$PHP_Argument.'">[次5件]</a>';
echo '<center><a href="TAK001_m.php?'.$PHP_Argument.'">[最新]</a></center>';
}elseif(($PG > 0) && (pg_numrows($objRec) <= (5 * ($PG+1)))){
$intPt1=$PG-1;
echo '<a href="TAK001_m.php?&PG='.$intPt1.'&'.$PHP_Argument.'">[前5件]</a>';
echo '[次5件]';
echo '<center><a href="TAK001_m.php?'.$PHP_Argument.'">[最新]</a></center>';
}elseif(($PG == 0) && (pg_numrows($objRec) > (5 * ($PG+1)))){
$intPt2=$PG+1;
echo '[前5件]';
echo '<a href="TAK001_m.php?&PG='.$intPt2.'&'.$PHP_Argument.'">[次5件]</a>';
echo '<center><a href="TAK001_m.php?'.$PHP_Argument.'">[最新]</a></center>';
}else{
echo '[前5件]';
echo '[次5件]';
echo '<center><a href="TAK001_m.php?'.$PHP_Argument.'">[最新]</a></center>';
}
}
?>
<HR width="100%">
<?php
//メニュー表示
include("include_m/CommonMenuReturn.inc");
//*** 共通変数取得 ***//
include("include_m/CommonHidden.inc");
?>
</form>
</BODY>
</HTML>