Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Yokihito Oki
/
kanoya-univercity-prod
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
5bbcf0ad
authored
2021-03-03 12:11:38 +0900
by
Yokihito Oki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
csvエクスポート処理修正
1 parent
e157d5f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
21 deletions
administrator/enquete.php
administrator/enquete.php
View file @
5bbcf0a
...
...
@@ -9,34 +9,34 @@ $total_count = 0;
$db
=
new
mysqli
(
"127.0.0.1"
,
"root"
,
"KanoyaMbc1124"
,
"ad1216tnc7_kanoya"
,
"3306"
);
$db
->
set_charset
(
'utf8'
);
$sql
=
'SELECT * FROM d_feedback WHERE id > 9 ORDER BY id DESC'
;
$limit
=
$_POST
[
'csv_export'
]
?
NULL
:
100
;
$limit_query
=
$limit
?
' LIMIT '
.
$limit
:
''
;
$sql
=
'SELECT * FROM d_feedback WHERE id > 9 ORDER BY id DESC'
.
$limit_query
;
$row
=
$db
->
query
(
$sql
);
//mysqli_query($db, $sql);
while
(
$data
=
$row
->
fetch_object
()){
$q1_ans
=
$data
->
q1
;
$q2_ans
=
$data
->
q2
;
$page_id
=
$data
->
page_id
;
if
(
$total_count
<
100
){
$html_hyo
.=
'<tr><td>'
;
if
(
$page_id
){
$sql_p
=
'SELECT * FROM v4vfh_menu WHERE id = '
.
$page_id
.
' LIMIT 1'
;
$row_p
=
$db
->
query
(
$sql_p
);
$data_p
=
$row_p
->
fetch_object
();
$html_hyo
.=
$data_p
->
title
;
}
$page_id
=
$data
->
page_id
;
$html_hyo
.=
'<tr><td>'
;
$html_hyo
.=
'</td><td>'
.
$q1_ask
[
$q1_ans
]
.
'</td><td>'
.
$q2_ask
[
$q2_ans
]
.
'</td><td>'
.
$data
->
input_date
.
'</td>'
;
$total_count
++
;
if
(
$q1_ans
==
1
)
{
$q1_count_g
++
;
}
elseif
(
$q1_ans
==
2
)
{
$q1_count_b
++
;
}
if
(
$q2_ans
==
1
)
{
$q2_count_g
++
;
}
elseif
(
$q2_ans
==
2
)
{
$q2_count_b
++
;
}
$html_hyo
.=
'</tr>'
;
if
(
$page_id
){
$sql_p
=
'SELECT * FROM v4vfh_menu WHERE id = '
.
$page_id
.
' LIMIT 1'
;
$row_p
=
$db
->
query
(
$sql_p
);
$data_p
=
$row_p
->
fetch_object
();
$html_hyo
.=
$data_p
->
title
;
}
$html_hyo
.=
'</td><td>'
.
$q1_ask
[
$q1_ans
]
.
'</td><td>'
.
$q2_ask
[
$q2_ans
]
.
'</td><td>'
.
$data
->
input_date
.
'</td>'
;
$total_count
++
;
if
(
$q1_ans
==
1
)
{
$q1_count_g
++
;
}
elseif
(
$q1_ans
==
2
)
{
$q1_count_b
++
;
}
if
(
$q2_ans
==
1
)
{
$q2_count_g
++
;
}
elseif
(
$q2_ans
==
2
)
{
$q2_count_b
++
;
}
$html_hyo
.=
'</tr>'
;
//CSV書出用
$csv_page
[]
=
$
data_p
->
title
;
$csv_page
[]
=
$
page_id
?
$data_p
->
title
:
''
;
$csv_q1
[]
=
$q1_ask
[
$q1_ans
];
$csv_q2
[]
=
$q2_ask
[
$q2_ans
];
$csv_input
[]
=
$data
->
input_date
;
...
...
@@ -54,7 +54,7 @@ if($_POST['csv_export']) {
$csv_c
=
0
;
$csv_array
=
[];
while
(
$csv_page
[
$csv_c
]
){
while
(
isset
(
$csv_page
[
$csv_c
])
){
$csv_array
[
$csv_c
][]
=
mb_convert_encoding
(
$csv_page
[
$csv_c
],
'SJIS-win'
,
'UTF-8'
);
$csv_array
[
$csv_c
][]
=
mb_convert_encoding
(
$csv_q1
[
$csv_c
],
'SJIS-win'
,
'UTF-8'
);
$csv_array
[
$csv_c
][]
=
mb_convert_encoding
(
$csv_q2
[
$csv_c
],
'SJIS-win'
,
'UTF-8'
);
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment