ADR050.php
5.8 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
<?php
//*****************************************************************************
//*
//* プログラム名:取引先情報
//* プログラムID:ADR0050.php
//* 機能 :会社情報入力
//* 作成者 :
//*
//*****************************************************************************
header("Content-type: text/html; charset=EUC-JP");
//***************************
//* インクルードファイル
//***************************
include("./include/session_start.inc");
include("./include/SessionChk.inc");
include('./include/smarty.conf');
include("./inc/mtc_comfunc.inc");
//**** DB接続 ****//
include("./include/dbcon.inc");
$cmp_name = "";
$cmp_name_kana = "";
$dai_name_sei = "";
$dai_name_mei = "";
$dai_name_sei_kana = "";
$dai_name_mei_kana = "";
$sihon = "";
$hp_adr = "";
$email = "";
$mail1 = "";
$mail2 = "";
$memo = "";
$post = "";
$pref = "";
$city = "";
$banti = "";
$apart = "";
$tel_no = "";
$fax_no = "";
if($seq != 0){
$sql = "SELECT * FROM torihiki_tbl WHERE seq = $seq";
$rtn = pg_exec($pg_con, $sql);
if ($rtn == false){
echo "データの取得に失敗しました。";
exit;
}
$cmp_name = htmlspecialchars(mtc_rtrim(pg_result($rtn, 0, "tori_name")));
$cmp_name_kana = htmlspecialchars(mtc_rtrim(pg_result($rtn, 0, "tori_name_kn")));
$dai_name_sei = htmlspecialchars(mtc_rtrim(pg_result($rtn, 0, "toridai_name__kj_sei")));
$dai_name_mei = htmlspecialchars(mtc_rtrim(pg_result($rtn, 0, "toridai_name__kj_mei")));
$dai_name_sei_kana = htmlspecialchars(mtc_rtrim(pg_result($rtn, 0, "toridai_name__kn_sei")));
$dai_name_mei_kana = htmlspecialchars(mtc_rtrim(pg_result($rtn, 0, "toridai_name__kn_mei")));
$sihon = htmlspecialchars(pg_result($rtn, 0, "tori_sihonkin"));
$hp_adr = htmlspecialchars(pg_result($rtn, 0, "tori_hp_adr"));
$email = split("@", pg_result($rtn, 0, "tori_email"));
$mail1 = $email[0];
$mail2 = $email[1];
$memo = pg_result($rtn, 0, "tori_memo");
$post = split("-", pg_result($rtn, 0, "tori_yubin_no"));
$post1 = $post[0];
$post2 = $post[1];
$post3 = $post[2];
$strAddres = pg_result($rtn, 0, "addr_pref");
$city = htmlspecialchars(mtc_rtrim(pg_result($rtn, 0, "addr_city")));
$banti = htmlspecialchars(mtc_rtrim(pg_result($rtn, 0, "addr_banti")));
$apart = htmlspecialchars(mtc_rtrim(pg_result($rtn, 0, "addr_apart")));
$tel_no = split("-", pg_result($rtn, 0, "tel_no"));
$tel1 = $tel_no[0];
$tel2 = $tel_no[1];
$tel3 = $tel_no[2];
$fax_no = split("-", pg_result($rtn, 0, "fax_no"));
$fax1 = $fax_no[0];
$fax2 = $fax_no[1];
$fax3 = $fax_no[2];
$tori_group = pg_result($rtn, 0, "tori_group");
}
$strSql = "SELECT group_seq,group_name FROM torihiki_group_tbl Order by disp_rank " ;
$objRec = pg_exec($strSql);
if($objRec==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
for ($intCnt=0; $intCnt < pg_numrows($objRec); $intCnt++){
$objData = pg_fetch_object($objRec, $intCnt);
// <option value="<?php echo $objData->group_seq " if($group==$objData->group_seq){ echo "selected"; } > echo $objData->group_name </option>;
}
if($seq != 0){
if ($hp_adr==""){
$hp_adr="http://";
}
}
if($seq == ""){
$str = " 登録する ";
}else{
$str = " 変更する ";
}
//*** 所在地県 ***
$pref="";
$pref_Data=array("------","北海道" ,"青森県" ,"岩手県" ,"宮城県" ,"秋田県" ,"山形県" ,"福島県" ,"茨城県" ,"栃木県" ,"群馬県" ,"埼玉県" ,"千葉県" ,"東京都" ,"神奈川県","山梨県" ,"長野県" ,"新潟県" ,"富山県" ,"石川県" ,"福井県" ,"岐阜県" ,"静岡県" ,"愛知県" ,"三重県" ,"滋賀県" ,"京都府" ,"大阪府" ,"兵庫県" ,"奈良県" ,"和歌山県","鳥取県" ,"島根県" ,"岡山県" ,"広島県" ,"山口県" ,"徳島県" ,"香川県" ,"愛媛県" ,"高知県" ,"福岡県" ,"佐賀県" ,"長崎県" ,"熊本県" ,"大分県" ,"宮崎県" ,"鹿児島県","沖縄県");
for ($intCnt=0; $intCnt < count($pref_Data); $intCnt++){
if ($intCnt==0){
$pref.='<option value="" ';
}else{
$pref.='<option value="'.$pref_Data[$intCnt].'" ';
}
if ($strAddres==$pref_Data[$intCnt]){
$pref.="selected";
}
$pref.='>'.$pref_Data[$intCnt].'</option>';
}
//*** 取引先グループ ***
$strSql = "SELECT group_seq,group_name FROM torihiki_group_tbl Order by disp_rank " ;
$objRec = pg_exec($strSql);
if($objRec==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
$group="";
$group.='<option value="99" ';
if ($tori_group==99){
$group.="selected";
}
$group.='>未設定</option>';
for ($intCnt=0; $intCnt < pg_numrows($objRec); $intCnt++){
$objData = pg_fetch_object($objRec, $intCnt);
$group.='<option value="'.$objData->group_seq.'" ';
if ($tori_group==$objData->group_seq){
$group.="selected";
}
$group.='>'.$objData->group_name.'</option>';
}
$o_smarty->assign('cmp_name',$cmp_name);
$o_smarty->assign('cmp_name_kana',$cmp_name_kana);
$o_smarty->assign('dai_name_sei',$dai_name_sei);
$o_smarty->assign('dai_name_mei',$dai_name_mei);
$o_smarty->assign('dai_name_sei_kana',$dai_name_sei_kana);
$o_smarty->assign('dai_name_mei_kana',$dai_name_mei_kana);
$o_smarty->assign('sihon',$sihon);
$o_smarty->assign('hp_adr',$hp_adr);
$o_smarty->assign('mail1',$mail1);
$o_smarty->assign('mail2',$mail2);
$o_smarty->assign('memo',mtc_rtrim($memo));
$o_smarty->assign('post1',$post1);
$o_smarty->assign('post2',$post2);
$o_smarty->assign('post3',$post3);
$o_smarty->assign('pref',$pref);
$o_smarty->assign('city',$city);
$o_smarty->assign('banti',$banti);
$o_smarty->assign('apart',$apart);
$o_smarty->assign('tel1',$tel1);
$o_smarty->assign('tel2',$tel2);
$o_smarty->assign('tel3',$tel3);
$o_smarty->assign('fax1',$fax1);
$o_smarty->assign('fax2',$fax2);
$o_smarty->assign('fax3',$fax3);
$o_smarty->assign('group',$group);
$o_smarty->assign('ToriSeq',$seq);
$o_smarty->display('ADR050.tpl');
?>