CON002.php
7.62 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
<?php
//*****************************************************************************
//*
//* プログラム名:会社情報入力画面
//* プログラムID:CON002
//* 機能 :会社情報を入力する
//* 作成者 :
//*
//*****************************************************************************
header("Content-type: text/html; charset=EUC-JP");
include("include/session_start.inc");
include("include/SessionChk.inc");
include("include/dbcon.inc");
include("inc/header.inc");
include("include/input_chk.inc");
include("inc/CON002.inc");
//メニュー
include("menu_opacity.php");
$strSql = "SELECT company_name,company_name_kn,dai_name_sei_kj,dai_name_mei_kj,dai_name_sei_kn,dai_name_mei_kn,";
$strSql = $strSql."create_date,sihonkin,hp_adr,email FROM mst_company";
$rsRecset = pg_exec($pg_con,$strSql);
$intRsCnt = pg_numrows($rsRecset);
//レコードが無い場合(新規登録)
if ($intRsCnt==0) {
$strCompanyNameKj = ""; //会社名
$strCompanyNameKn = ""; //会社名カナ
$strDaiNameSeiKj = ""; //代表者名姓漢字
$strDaiNameMeiKj = ""; //代表者名名漢字
$strDaiNameSeiKn = ""; //代表者名姓カナ
$strDaiNameMeiKn = ""; //代表者名名カナ
$strSourituDateY = ""; //創立日年
$strSourituDateM = ""; //創立日月
$strSourituDateD = ""; //創立日日
$strSihonkin = ""; //資本金
$strHPUrl = ""; //ホームページURL
$strMailAdr = ""; //代表者メールアドレス
}else{
//レコードが2件以上の場合
if ($intRsCnt >= 2) {
echo "<Script language=\"JavaScript\">\n";
echo "alert('データベースが破損しています。管理者にお問い合わせください')\n";
echo "</Script>\n";
exit;
}
//レコードが1件の場合(設定値取得)
$strCompanyNameKj = pg_result($rsRecset,0,"company_name"); //会社名
$strCompanyNameKn = pg_result($rsRecset,0,"company_name_kn"); //会社名カナ
$strDaiNameSeiKj = pg_result($rsRecset,0,"dai_name_sei_kj"); //代表者名姓漢字
$strDaiNameMeiKj = pg_result($rsRecset,0,"dai_name_mei_kj"); //代表者名名漢字
$strDaiNameSeiKn = pg_result($rsRecset,0,"dai_name_sei_kn"); //代表者名姓カナ
$strDaiNameMeiKn = pg_result($rsRecset,0,"dai_name_mei_kn"); //代表者名名カナ
$strSourituDate = split("/",pg_result($rsRecset,0,"create_date"));
if ($strSourituDate) {
$strSourituDateY = $strSourituDate[0]; //創立日年
$strSourituDateM = $strSourituDate[1]; //創立日月
$strSourituDateD = $strSourituDate[2]; //創立日日
}else{
$strSourituDateY = ""; //創立日年
$strSourituDateM = ""; //創立日月
$strSourituDateD = ""; //創立日日
}
$strSihonkin = pg_result($rsRecset,0,"sihonkin"); //資本金
$strHPUrl = pg_result($rsRecset,0,"hp_adr"); //ホームページURL
$strMailAdr = split("@",pg_result($rsRecset,0,"email"));
if ($strMailAdr) {
$strMailAcount = $strMailAdr[0]; //代表者メールアドレスアカウント
$strMailDomain = $strMailAdr[1]; //代表者メールアドレスドメイン
}else{
$strMailAcount = ""; //代表者メールアドレスアカウント
$strMailDomain = ""; //代表者メールアドレスドメイン
}
}
?>
<form name="e_gru">
<?php if ($PHP_BIT[0]==1){ ?>
<table width="100%" border="0" cellspacing="0">
<tr>
<td class="midashi">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<th width="50%" scope="col"><div align="left"><img src="image/t_kanri.gif" border="0"> 会社基本情報設定</div></th>
<th width="50%" scope="col"><div align="right"><a href='javascript:Disp_Help("CON002HLP.htm")'><img src="image/help.gif" border="0"></a> <a href='javascript:Disp_Help("CON002HLP.htm")'>ヘルプ</a></div></th>
</tr>
</table>
<div align="right"></div>
</td>
</tr>
</table>
<br>
<span class="Chufont">*</span><span class="Normalfont">は入力必須項目です</span>
<table width="90%" border="0" cellspacing="1" cellpadding="1" class="mainColor">
<tr>
<td>
<table cellspacing="1" cellpadding="1" width="100%" border="0">
<tr bgcolor="#ffffff">
<td height="30" noWrap class="toneDown"><span class="Normalfont">会社名</span><span class="Chufont">*</span></td>
<td><input type="text" maxLength="50" size="55" value="<?php echo htmlspecialchars($strCompanyNameKj)?>" name="kaisya_kj"></td>
</tr>
<tr bgcolor="#ffffff">
<td height="30" noWrap class="toneDown"><span class="Normalfont">会社名(フリガナ)</span></td>
<td><input type="text" maxLength="50" size="55" value="<?php echo $strCompanyNameKn?>" name="kaisya_kn"></td>
</tr>
<tr bgcolor="#ffffff">
<td height="30" noWrap class="toneDown"><span class="Normalfont">代表者名(漢字)</span></td>
<td><input type="text" maxlength="10" size="25" value="<?php echo htmlspecialchars($strDaiNameSeiKj)?>" name="dai_sei_kj"> <input maxlength="10" size="25" value="<?php echo htmlspecialchars($strDaiNameMeiKj)?>" name="dai_mei_kj"></td>
</tr>
<tr bgcolor="#ffffff">
<td height="30" noWrap class="toneDown"><span class="Normalfont">代表者名(フリガナ)</span></td>
<td><input type="text" maxlength="10" size="25" value="<?php echo $strDaiNameSeiKn?>" name="dai_sei_kn"> <input maxlength="10" size="25" value="<?php echo $strDaiNameMeiKn?>" name="dai_mei_kn"><span class="Normalfont">(全角カタカナ)</span></td>
</tr>
<tr bgcolor="#ffffff">
<td height="30" noWrap class="toneDown"><span class="Normalfont">創立日</span></td>
<td>
<span class="Normalfont">西暦</span>
<input type="text" maxlength="4" size="6" value="<?php echo $strSourituDateY?>" name="souritu_year">
<span class="Normalfont">年</span>
<select name="souritu_month">
<option value="">--月</option>
<?php
for ($i = 1 ; $i <= 12 ; $i++) {
if ($strSourituDateM == $i) {
echo "<option value=\"".$i."\" selected>".$i."月</option>\n";
}else{
echo "<option value=\"".$i."\">".$i."月</option>\n";
}
}
?>
</select>
<select name="souritu_day">
<option value="">--日</option>
<?php
for ($i = 1 ; $i <= 31 ; $i++) {
if ($strSourituDateD == $i) {
echo "<option value=\"".$i."\" selected>".$i."日</option>\n";
}else{
echo "<option value=\"".$i."\">".$i."日</option>\n";
}
}
?>
</select>
</td>
</tr>
<tr bgcolor="#ffffff">
<td height="30" noWrap class="toneDown"><span class="Normalfont">資本金</span></td>
<td><input type="text" maxLength="9" size="13" style="text-align:right" value="<?php echo $strSihonkin?>" name="sihonkin"><span class="Normalfont">万円</span></td>
</tr>
<tr bgcolor="#ffffff">
<td height="30" noWrap class="toneDown"><span class="Normalfont">ホームページ</span></td>
<td><input type="text" maxLength="300" size="100" value="<?php echo htmlspecialchars($strHPUrl)?>" name="homepage"></td>
</tr>
<tr bgcolor="#ffffff">
<td height="30" noWrap class="toneDown"><span class="Normalfont">代表メールアドレス</span></td>
<td><input type="text" maxlength="20" size="30" value="<?php echo $strMailAcount?>" name="email1">@<input maxlength="20" size="30" value="<?php echo $strMailDomain?>" name="email2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="40" align="left"><input type="button" onclick="return chk();" value=" 設 定 " name="touroku"></td>
<td height="40" align="right"><input type="button" onclick="return back();" value=" 戻 る " name="modoru"></td>
</tr>
</table>
<br>
<?php }else{ ?>
<a href="TOP000.php"><span class="Normalfont">マスタ変更権限がありません</span></a>
<?php } ?>
</form>
<?php
//コピーライト
include("include/copyright.inc");
?>