쪼갠 여분필드 게시판 엑셀 다운로드시 엑셀파일에 입력값이 안나옵니다.
본문
write_update.skin.php
$wr_1 = "$wr1epd0|$wr1epd1|$wr1epd2|$wr1epd3|$wr1epd4|$wr1epd5|$wr1epd6|$wr1epd7|$wr1epd8|$wr1epd9";
$updatewr1 = " update $write_table set wr_1 = '$wr_1' where wr_id = '$wr_id' ";
sql_query($updatewr1);
write.skin.php
$wr1epd = explode("|",$write[wr_1]);
$wr1epd0 = $wr1epd[0];
$wr1epd1 = $wr1epd[1];
$wr1epd2 = $wr1epd[2];
$wr1epd3 = $wr1epd[3];
$wr1epd4 = $wr1epd[4];
$wr1epd5 = $wr1epd[5];
$wr1epd6 = $wr1epd[6];
$wr1epd7 = $wr1epd[7];
$wr1epd8 = $wr1epd[8];
$wr1epd9 = $wr1epd[9];
작성시 input
<input type=text name=wr1epd0 id=wr1epd0 required value='<?=$wr1epd[0]?>'>
view.skin.php
//업체정보&담당자
$wr1epd = explode("|",$view[wr_1]);
$wr1epd0 = $wr1epd[0];
$wr1epd1 = $wr1epd[1];
$wr1epd2 = $wr1epd[2];
$wr1epd3 = $wr1epd[3];
$wr1epd4 = $wr1epd[4];
$wr1epd5 = $wr1epd[5];
$wr1epd6 = $wr1epd[6];
$wr1epd7 = $wr1epd[7];
$wr1epd8 = $wr1epd[8];
$wr1epd9 = $wr1epd[9];
뷰 페이지에서 입력값 부를때
<td><?=$wr1epd[0]?></td>
list.skin.php
for ($i=0; $i<count($list); $i++) {
$wr1epd = explode('|',$list[$i]['wr_1']);
$wr1epd0 = $wr1epd[0];
$wr1epd1 = $wr1epd[1];
$wr1epd2 = $wr1epd[2];
$wr1epd3 = $wr1epd[3];
$wr1epd4 = $wr1epd[4];
$wr1epd5 = $wr1epd[5];
$wr1epd6 = $wr1epd[6];
$wr1epd7 = $wr1epd[7];
$wr1epd8 = $wr1epd[8];
$wr1epd9 = $wr1epd[9];
리스트에서 입력값 부를때
<td><?php echo $wr1epd0; ?></td>
--------------------------------------------------------
이렇게 만들고 게시판에서 입력하고 값 불러오는데에 있어서는 문제가 없습니다.
다만 리스트 페이지를 엑셀로 다운받고 싶은데 엑셀에 값이 안나옵니다;;
고수님들 확인 부탁드립니다 ㅠㅠ
--------------------------------------------------------
_common.php
<?php
include_once('../../../../../common.php');
?>
list.skin.php (엑셀 다운로드 버튼)
<?php if ($admin_href) { ?><li><a href='<?php echo $board_skin_url; ?>/excel.php?bo_table=<?php echo $bo_table; ?>' class="btn_admin btn2" target='_blank'><i class="fa fa-user-circle" aria-hidden="true"></i> Excel</a></li><?php } ?>
excel.php (엑셀값 ※ 이게 문제입니다 ㅠㅠ ※)
그냥 {$data['wr_1']} 할때는 10개 쪼개 값 전부 다 나오는데
쪼갠 값 그대로 하나씩 적용하여 엑셀에 뽑으려면 어떻게 해야하나요 ㅠ
<?php
while($data=sql_fetch_array($result)) {
$wr1epd = explode("|",$data[wr_1]);
$wr1epd0 = $wr1epd[0];
$wr1epd1 = $wr1epd[1];
$wr1epd2 = $wr1epd[2];
$wr1epd3 = $wr1epd[3];
$wr1epd4 = $wr1epd[4];
$wr1epd5 = $wr1epd[5];
$wr1epd6 = $wr1epd[6];
$wr1epd7 = $wr1epd[7];
$wr1epd8 = $wr1epd[8];
$wr1epd9 = $wr1epd[9];
echo "
<tr>
<td>{$data['wr1epd0']}</td>
<td>{$data['wr1epd1']}</td>
<td>{$data['wr1epd2']}</td>
<td>{$data['wr1epd3']}</td>
<td>{$data['wr_subject']}</td>
<td>{$data['mb_id']}</td>
<td>{$data['wr_name']}</td>
<td class='txt'>{$data['wr_datetime']}</td>
<td class='txt'>".get_text(strip_tags($data['wr_content']))."</td>
<td class='txt'>{$data['wr_1']}</td>
<td class='txt'>{$data['wr_2']}</td>
<td class='txt'>{$data['wr_3']}</td>
<td class='txt'>{$data['wr_4']}</td>
<td class='txt'>{$data['wr_5']}</td>
<td class='txt'>{$data['wr_6']}</td>
<td class='txt'>{$data['wr_7']}</td>
<td class='txt'>{$data['wr_8']}</td>
<td class='txt'>{$data['wr_9']}</td>
<td class='txt'>{$data['wr_10']}</td>
</tr>
";
$number--;
}
?>
답변 1
<?php
while($data=sql_fetch_array($result)) {
$wr1epd = explode("|",$data['wr_1']);
echo "
<tr>
<td>{$wr1epd[0]}</td>
<td>{$wr1epd[1]}</td>
<td>{$wr1epd[2]}</td>
<td>{$wr1epd[3]}</td>
<td>{$data['wr_subject']}</td>
<td>{$data['mb_id']}</td>
<td>{$data['wr_name']}</td>
<td class='txt'>{$data['wr_datetime']}</td>
<td class='txt'>".get_text(strip_tags($data['wr_content']))."</td>
<td class='txt'>{$data['wr_1']}</td>
<td class='txt'>{$data['wr_2']}</td>
<td class='txt'>{$data['wr_3']}</td>
<td class='txt'>{$data['wr_4']}</td>
<td class='txt'>{$data['wr_5']}</td>
<td class='txt'>{$data['wr_6']}</td>
<td class='txt'>{$data['wr_7']}</td>
<td class='txt'>{$data['wr_8']}</td>
<td class='txt'>{$data['wr_9']}</td>
<td class='txt'>{$data['wr_10']}</td>
</tr>
";
$number--;
}
?>