최신글 첨부파일 불러오기
본문
<?php
$sql = "select * from g5_write_career where wr_is_comment = '0' and ca_name = '직원채용' order by wr_id desc limit 15";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
$wr_href = get_pretty_url('career', $row['wr_id']);
$end_date = date($row['wr_link2']); //디데이 날짜
$d_day = floor((strtotime($end_date) - $_SERVER['REQUEST_TIME']) / 86400 + 1);
?>
현재 최신글을 불러와 디데이까지 잘 나오는데 여기에 첨부파일 첫번째를 노출시켜주고 싶은데 팁을 주시면 감사드리겠습니다
!-->답변 3
$file = get_file('career', $row['wr_id']);
echo $file[0]['path'] . $file[0]['file'];
다운로드까지 해야 된다면..
<a href="<?php echo $file[0]['href'] ?>">down</a>
$sql_file= "SELECT * FROM `g5_board_file` WHERE bo_table='career' and wr_id=".$row['wr_id']." and bf_no=0";
<!-- 최신글 { -->
<?php
$sql = "select * from g5_write_career where wr_is_comment = '0' and ca_name = '직원채용' order by wr_id desc limit 15";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
$wr_href = get_pretty_url('career', $row['wr_id']);
$end_date = date($row['wr_link2']); //디데이 날짜
$d_day = floor((strtotime($end_date) - $_SERVER['REQUEST_TIME']) / 86400 + 1);
?>
<li>
<div class="career-title">
<h1 class="left-title"><?php echo $row['wr_subject']; ?></h1>
<div class="right">
<div class="day">
<h1>D-<?php echo $d_day ?></h1>
<p><?php echo $row['wr_link1']?> ~ <?php echo $row['wr_link2']?></p>
</div>
<div class="open-btn"></div>
</div>
</div>
<div class="career-content">
<div class="career-content-inner">
<?php echo $row['wr_content']; ?>
<?php if ($row['wr_1'] == "") {?>
<a href="<?php echo $row['wr_1']?>" class="submit-link btn-black large">지원서 제출</a>
<?php }?>
</div>
</div>
</li>
<?php } ?>
답변을 작성하시기 전에 로그인 해주세요.