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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
administrator/enquete.php
administrator/enquete.php
View file @
5bbcf0a
...
...
@@ -9,16 +9,16 @@ $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
){
$page_id
=
$data
->
page_id
;
$html_hyo
.=
'<tr><td>'
;
if
(
$page_id
){
...
...
@@ -34,9 +34,9 @@ while( $data = $row->fetch_object()){
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