ADR005.php
3.21 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
<?php
//*****************************************************************************
//*
//* プログラム名:アドレス帳
//* プログラムID:ADR005.php
//* 機能 :個人アドレス帳画面
//* 作成者 :
//*
//*****************************************************************************
header("Content-type: text/html; charset=EUC-JP");
//***************************
//* インクルードファイル
//***************************
include("./include/session_start.inc");
include("./include/SessionChk.inc");
include('./include/smarty.conf');
include("./inc/header.inc");
include("./inc/STRING.inc");
//**** DB接続 ****//
include("./include/dbcon.inc");
//アドレス帳カナ検索
if ($add_search ==1){
$str_add="ア%/イ%/ウ%/エ%/オ%";
}elseif($add_search ==2){
$str_add="カ%/キ%/ク%/ケ%/コ%/ガ%/ギ%/グ%/ゲ%/ゴ%";
}elseif($add_search ==3){
$str_add="サ%/シ%/ス%/セ%/ソ%/ザ%/ジ%/ズ%/ゼ%/ゾ%";
}elseif($add_search ==4){
$str_add="タ%/チ%/ツ%/テ%/ト%/ダ%/ヂ%/ヅ%/デ%/ド%";
}elseif($add_search ==5){
$str_add="ナ%/ニ%/ヌ%/ネ%/ノ%";
}elseif($add_search ==6){
$str_add="ハ%/ヒ%/フ%/ヘ%/ホ%/バ%/ビ%/ブ%/ベ%/ボ%/パ%/ピ%/プ%/ペ%/ポ%";
}elseif($add_search ==7){
$str_add="マ%/ミ%/ム%/メ%/モ%";
}elseif($add_search ==8){
$str_add="ヤ%/ユ%/ヨ%";
}elseif($add_search ==9){
$str_add="ラ%/リ%/ル%/レ%/ロ%";
}elseif($add_search ==10){
$str_add="ワ%/ヲ%/ン%";
}else{
$str_add="";
}
if ($str_add!="")
{
$str_add=" and ((view_name_kana Like '".str_replace("/","') or (view_name_kana Like '",$str_add)."'))";
}
//取引先情報取得
$strSQL="Select seq,syain_cd,view_name,view_name_kana,mail_address From mail_address_tbl Where syain_cd='$PHP_SYAIN_CD' ".$str_add." Order By seq ";
$objRecSet = pg_exec($strSQL);
if($objRecSet==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
$strDispKeyWord = array("全て","ア","カ(ガ)","サ(ザ)","タ(ダ)","ナ","ハ(バ・パ)","マ","ヤ","ラ","ワ");
for ($search_cnt = 0; $search_cnt < 11; $search_cnt++){
if($add_search == $search_cnt){
$PhpSearch = $PhpSearch . $strDispKeyWord[$search_cnt]."/";
}else{
$PhpSearch = $PhpSearch . "<a href=javascript:kojin_info($search_cnt);>$strDispKeyWord[$search_cnt]</a>/";
}
}
if (pg_numrows($objRecSet) > 0){
$intsts=pg_numrows($objRecSet);
}
for ($intCnt = 0; $intCnt < pg_numrows($objRecSet) ; $intCnt++){
$objRecData = pg_fetch_object($objRecSet, $intCnt);
$PhpName[$intCnt] = $objRecData->view_name;
$PhpNameKana[$intCnt] = $objRecData->view_name_kana;
$PhpAddr[$intCnt] = $objRecData->mail_address;
$PhpSeq[$intCnt] = $objRecData->seq;
}
// ボタン
if ( $intsts == 0){
$PhpBtnChk = "<INPUT type=button value=\"チェック\" onclick=\"All_chk();\" disabled=true><br /><INPUT type=button value=\"削除\" onclick=\"del_chk();\" disabled=true>";
}else{
$PhpBtnChk = '<INPUT type=button value="チェック" onclick="All_chk();" '.$PHP_DISABLED.'><br /><INPUT type=button value="削除" onclick="del_chk();" '.$PHP_DISABLED.'>';
}
$o_smarty->assign('PhpBtnChk',$PhpBtnChk);
$o_smarty->assign('PhpSearch',$PhpSearch);
$o_smarty->assign('PhpAddS',$add_search);
$o_smarty->assign('PhpName',$PhpName);
$o_smarty->assign('PhpNameKana',$PhpNameKana);
$o_smarty->assign('PhpAddr',$PhpAddr);
$o_smarty->assign('intGmSts',$intGmSts);
$o_smarty->assign('PhpSeq',$PhpSeq);
$o_smarty->display('ADR005.tpl');
?>