質問編集履歴

3

コードを追記

2019/03/17 03:03

投稿

redkick
redkick

スコア17

test CHANGED
File without changes
test CHANGED
@@ -1,3 +1,61 @@
1
+ 親画面
2
+
3
+ ```js
4
+
5
+ <script type="text/javascript">
6
+
7
+ function disp(url,windowname,width,height) {
8
+
9
+ var features="location=no, menubar=no, status=yes, scrollbars=yes, resizable=yes, toolbar=no";
10
+
11
+ if (width) {
12
+
13
+ if (window.screen.width > width)
14
+
15
+ features+=", left="+(window.screen.width-width)/8;
16
+
17
+ else width=window.screen.width;
18
+
19
+ features+=", width="+width;
20
+
21
+ }
22
+
23
+ if (height) {
24
+
25
+ if (window.screen.height > height)
26
+
27
+ features+=", top="+(window.screen.height-height)/8;
28
+
29
+ else height=window.screen.height;
30
+
31
+ features+=", height="+height;
32
+
33
+ }
34
+
35
+ window.open(url, "サブ検索画面", "width=600,height=600");
36
+
37
+ }
38
+
39
+ </script>
40
+
41
+ ```
42
+
43
+ ```html
44
+
45
+ <input name="SearchScreen" type="button" value="検索" onClick='disp("/SubScreen1.php")' />
46
+
47
+ <input id="code1" type="text" size="20" value="" />
48
+
49
+ <input id="code2" type="text" size="15" vallue="" />
50
+
51
+ <input id="code3" type="text" value="" />
52
+
53
+ ```
54
+
55
+
56
+
57
+ 以下、子画面
58
+
1
59
  ```php
2
60
 
3
61
  <?php

2

修正追記

2019/03/17 03:03

投稿

redkick
redkick

スコア17

test CHANGED
File without changes
test CHANGED
@@ -76,7 +76,9 @@
76
76
 
77
77
 
78
78
 
79
+ ```
80
+
79
- ``````js
81
+ ```js
80
82
 
81
83
  <!-- ポップアップスクリプト  -->
82
84
 

1

修正追記

2019/03/17 02:43

投稿

redkick
redkick

スコア17

test CHANGED
File without changes
test CHANGED
@@ -1,4 +1,82 @@
1
+ ```php
2
+
3
+ <?php
4
+
5
+
6
+
7
+ //データベース接続・・省略
8
+
9
+
10
+
11
+ if ($mysqli->connect_error){
12
+
13
+ echo $mysqli->connect_error;
14
+
15
+ exit();
16
+
17
+ }else{
18
+
19
+ $mysqli->set_charset("utf-8");
20
+
21
+ }
22
+
23
+
24
+
25
+ //FROMの後にDB名
26
+
27
+ $sql = "SELECT * FROM `management` ORDER BY `management`.`manage_kana` ASC";
28
+
29
+
30
+
31
+ $result = $mysqli -> query($sql);
32
+
33
+
34
+
35
+ //クエリー失敗
36
+
37
+ if(!$result) {
38
+
39
+ echo $mysqli->error;
40
+
41
+ exit();
42
+
43
+ }
44
+
45
+
46
+
47
+ //レコード件数
48
+
49
+ $row_count = $result->num_rows;
50
+
51
+
52
+
53
+ //連想配列で取得
54
+
55
+ while($row = $result->fetch_array(MYSQLI_ASSOC)){
56
+
57
+ $rows[] = $row;
58
+
59
+ }
60
+
61
+
62
+
63
+ //結果セットを解放
64
+
65
+ $result->free();
66
+
67
+
68
+
69
+ // データベース切断
70
+
71
+ $mysqli->close();
72
+
73
+
74
+
75
+ ?>
76
+
77
+
78
+
1
- ```js
79
+ ``````js
2
80
 
3
81
  <!-- ポップアップスクリプト  -->
4
82
 
@@ -94,23 +172,23 @@
94
172
 
95
173
  echo '<tr>';
96
174
 
97
- echo '<td>■</td>';
175
+ echo '<td><center>■</center></td>';
98
-
176
+
99
- echo '<input id="searchCode1" type="hidden" value="aaa001">';
177
+ echo '<input id="searchCode1" type="hidden" value="',$row['aaa001'],'">';
100
178
 
101
179
  echo '<td><input type="submit" name="select" value="選択" onClick="clickFire()"/></td>';
102
180
 
103
- echo '<td>', 'aaa001', '</td>';
181
+ echo '<td>', $row['aaa001'], '</td>';
104
-
182
+
105
- echo '<input id="searchCode2" type="hidden" value="aaa_tel1">';
183
+ echo '<input id="searchCode2" type="hidden" value="',$row['aaa_tel1'],'-',$row['aaa_tel2'],'-',$row['aaa_tel3'],'">';
106
-
184
+
107
- echo '<td>', 'aaa_tel1', '</td>';
185
+ echo '<td>', $row['aaa_tel1'], '-', $row['aaa_tel2'], '-', $row['aaa_tel3'], '</td>';
108
-
186
+
109
- echo '<input id="searchCode3" type="hidden" value="aaa_fax1">';
187
+ echo '<input id="searchCode3" type="hidden" value="',$row['aaa_fax1'],'-',$row['aaa_fax2'],'-',$row['aaa_fax3'],'">';
110
-
188
+
111
- echo '<td>', 'aaa_fax1', '</td>';
189
+ echo '<td>', $row['aaa_fax1'], '-', $row['aaa_fax2'], '-', $row['aaa_fax3'], '</td>';
112
-
190
+
113
- echo '<input id="aaa_id" type="hidden" value="aaa_id">';
191
+ echo '<input id="mb_id" type="hidden" value="',$row['aaa_id'],'">';
114
192
 
115
193
  echo '</tr>';
116
194