質問するログイン新規登録

質問編集履歴

1

処理Cのコードを追記いたしました。

2017/03/16 09:41

投稿

pegy
pegy

スコア245

title CHANGED
File without changes
body CHANGED
@@ -15,6 +15,8 @@
15
15
 
16
16
 
17
17
  ```PHP
18
+
19
+
18
20
  <!DOCTYPE html>
19
21
  <html>
20
22
  <head>
@@ -37,4 +39,66 @@
37
39
  <a href="a_input_all.php" class="button">戻る</a>
38
40
  </body>
39
41
  </html>
42
+ ```
43
+
44
+ ```PHP
45
+ 処理_Cの詳細
46
+ <?php else:?>
47
+ <?php
48
+ for ($i=$start; $i <$end ; $i++) {
49
+ $counting=count($resultAlter[$secid[$i]]);
50
+ echo "<b><u>結果レポート:".$secid[$i]."</u></b><br>";
51
+ echo '<div style=" width:500px; border:1px solid #000000; padding:10px">';
52
+ echo "登録が完了しました。".$counting."事業年度分の内訳は下記の通りです"."<br>";
53
+ for ($r=0; $r <$counting ; $r++) {
54
+ $counting1=count($resultAlter[$secid[$i]][$r]);
55
+ $ttl[]=$counting1;
56
+ echo "■".$scan[$r+2].":".$counting1."件"."<br>";
57
+
58
+ try
59
+ {
60
+ $stmt_A = $pdo->prepare("INSERT IGNORE INTO all_fsdb
61
+ (entityName,entityCode,taxonomyNameEng,taxonomyNameJpn,amout,amtDecimals,fsCategory,taxonomySource,accumName,yearEnd,period,unq)
62
+ VALUES (:entityName,:entityCode,:taxonomyNameEng,:taxonomyNameJpn,:amout,:amtDecimals,:fsCategory,:taxonomySource,:accumName,:yearEnd,:period,:unq)");
63
+ for ($u=0; $u <$counting1 ; $u++) {
64
+ $stmt_A->BindValue(':entityName',$result[$secid[$i]][$r][$u][11],PDO::PARAM_STR);
65
+ $stmt_A->BindParam(':entityCode',$result[$secid[$i]][$r][$u][12],PDO::PARAM_INT);
66
+ $stmt_A->BindValue(':taxonomyNameEng',$result[$secid[$i]][$r][$u][1],PDO::PARAM_STR);
67
+ $stmt_A->BindValue(':taxonomyNameJpn',$result[$secid[$i]][$r][$u][5],PDO::PARAM_STR);
68
+ $stmt_A->BindParam(':amout',$result[$secid[$i]][$r][$u][2],PDO::PARAM_INT);
69
+ $stmt_A->BindParam(':amtDecimals',$result[$secid[$i]][$r][$u][3],PDO::PARAM_INT);
70
+ $stmt_A->BindValue(':fsCategory',$result[$secid[$i]][$r][$u][4],PDO::PARAM_STR);
71
+ $stmt_A->BindValue(':taxonomySource',$result[$secid[$i]][$r][$u][6],PDO::PARAM_STR);
72
+ $stmt_A->BindValue(':accumName',$result[$secid[$i]][$r][$u][7],PDO::PARAM_STR);
73
+ $stmt_A->BindParam(':yearEnd',$result[$secid[$i]][$r][$u][8],PDO::PARAM_INT);
74
+ $stmt_A->BindParam(':period',$result[$secid[$i]][$r][$u][9],PDO::PARAM_INT);
75
+ $stmt_A->BindValue(':unq',$result[$secid[$i]][$r][$u][10],PDO::PARAM_STR);
76
+ $stmt_A->execute();
77
+ }
78
+ }
79
+ catch (PDOException $e)
80
+ {
81
+ var_dump($e->getMessage());
82
+ }
83
+
84
+ }
85
+ echo ("<br>合計で".array_sum($ttl)."件のレコードが登録されました"."<br>");
86
+ $ttl=array();
87
+ if (empty($resultError[$secid[$i]])) {
88
+ }else{
89
+ echo '<p style="color:#ff0000;">(注)以下の'.count($resultError[$secid[$i]]).'件のレコードを除外して 登録いたしました<p><br>';
90
+ prep($resultError[$secid[$i]]);
91
+ }
92
+ echo '</div>';
93
+ }
94
+ ?>
95
+ <br>
96
+ <a href="a_input_all.php" class="button">戻る</a>
97
+ <?php
98
+ $_SESSION = array();
99
+ if (isset($_COOKIE[session_name()])) {
100
+ setcookie(session_name(), '', time()-42000, '/');}
101
+ session_destroy();
102
+ ?>
103
+ <?php endif;?>
40
104
  ```