답변 2개
4년 전
</strong></p>
<pre>
<code>$bo_table = "g5_write_booking";</code></pre>
<p> </p>
<pre>
<code>$sql = " select * from {$bo_table}";</code></pre>
<p><strong>
으로 수정까지 맞췄습니다만 안됩니다 ㅠㅠ
로그인 후 평가할 수 있습니다
답변에 대한 댓글 1개
�
4년 전
댓글을 작성하려면 로그인이 필요합니다.
4년 전
안 되는 증상이 무엇일까요?
그리고 소스는 텍스트로 올려 주셔야 검토해 보기 좋습니다.
로그인 후 평가할 수 있습니다
답변에 대한 댓글 2개
�
4년 전
booking_down.php
[code]
<?php
include_once('./_common.php');
function column_char($i) { return chr( 65 + $i ); }
include_once(G5_LIB_PATH.'/PHPExcel.php');
// $bo_table = $_GET["bo_table"];
$bo_table = "g5_write_booking";
// $wr_id = $_GET["wr_id"];
$headers = array('이름', 'ID', '작성일시','댓글');
$widths = array(20, 20, 20, 40);
$header_bgcolor = 'FFABCDEF';
$last_char = column_char(count($headers) - 1);
$sql = " select * from g5_write_{$bo_table}";
$result = sql_query($sql);
for($i=1; $row=sql_fetch_array($result); $i++) {
$rows[] =
array($row['wr_name'],
$row['mb_id'],
$row['wr_datetime'],
$row['wr_content']);
}
$data = array_merge(array($headers), $rows);
$excel = new PHPExcel();
$excel->setActiveSheetIndex(0)->getStyle( "A1:${last_char}1" )->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID)->getStartColor()->setARGB($header_bgcolor);
$excel->setActiveSheetIndex(0)->getStyle( "A:$last_char" )->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER)->setWrapText(true);
foreach($widths as $i => $w) $excel->setActiveSheetIndex(0)->getColumnDimension( column_char($i) )->setWidth($w);
$excel->getActiveSheet()->fromArray($data,NULL,'A1');
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"commentlist-".date("ymd", time()).".xls\"");
header("Cache-Control: max-age=0");
$writer = PHPExcel_IOFactory::createWriter($excel, 'Excel5');
$writer->save('php://output');
?>
[/code]
[code]
<?php
include_once('./_common.php');
function column_char($i) { return chr( 65 + $i ); }
include_once(G5_LIB_PATH.'/PHPExcel.php');
// $bo_table = $_GET["bo_table"];
$bo_table = "g5_write_booking";
// $wr_id = $_GET["wr_id"];
$headers = array('이름', 'ID', '작성일시','댓글');
$widths = array(20, 20, 20, 40);
$header_bgcolor = 'FFABCDEF';
$last_char = column_char(count($headers) - 1);
$sql = " select * from g5_write_{$bo_table}";
$result = sql_query($sql);
for($i=1; $row=sql_fetch_array($result); $i++) {
$rows[] =
array($row['wr_name'],
$row['mb_id'],
$row['wr_datetime'],
$row['wr_content']);
}
$data = array_merge(array($headers), $rows);
$excel = new PHPExcel();
$excel->setActiveSheetIndex(0)->getStyle( "A1:${last_char}1" )->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID)->getStartColor()->setARGB($header_bgcolor);
$excel->setActiveSheetIndex(0)->getStyle( "A:$last_char" )->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER)->setWrapText(true);
foreach($widths as $i => $w) $excel->setActiveSheetIndex(0)->getColumnDimension( column_char($i) )->setWidth($w);
$excel->getActiveSheet()->fromArray($data,NULL,'A1');
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"commentlist-".date("ymd", time()).".xls\"");
header("Cache-Control: max-age=0");
$writer = PHPExcel_IOFactory::createWriter($excel, 'Excel5');
$writer->save('php://output');
?>
[/code]
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인전체 질문 목록
채택
채택
답변대기
답변대기
채택
채택
답변대기
채택
답변대기
채택
채택
채택
답변대기
채택
채택
답변대기
답변대기
채택
채택
버튼은 만들었습니다.


말씀드렸듯이 안 된다는 증상 무엇인지 말씀해 주세요.