ÿØÿà JFIF  ` ` ÿþš 403 WEBHELL REBORN
403 WEBHELL REBORN
Server : Apache
System : Linux ruga7-004.fmcity.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : tkt_travelbus ( 1137)
PHP Version : 7.0.0p1
Disable Function : mysql_pconnect
Directory :  /tkt_travelbus/www/toadmin/erp/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

Buat Folder Baru:
Buat File Baru:

Current File : /tkt_travelbus/www/toadmin/erp/bus_excel.php
<?
include "../include/top_proc.html";


// 엑셀 파일명 설정
$FileName = "버스정산목록";
$FileName = $FileName."_".Date("Ymd").".xls";
$FileName = urlencode($FileName); // UTF-8

// 엑셀 파일로 변환 헤더
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=$FileName");
header("Content-Description: PHP4 Generated Data" );

// 파라메터
$sql_where = stripslashes($sql_where);
$sql_order = stripslashes($sql_order);

//취소된 데이터가 나오지 않게 처리. 취소값은 res_stat_cd = 'D'
//2023.06.29
//kim taeyoung
$sql_where .= " AND (res_stat_cd IS NULL OR res_stat_cd = '' OR res_stat_cd = 'R') ";

$sql = "select * from TB_ERP_BUS where 1 {$sql_where} order by {$sql_order}";
$rs = db_query($sql);

?>

<html xmlns:o="urn:schemas-microsoft-com:office:office"
      xmlns:x="urn:schemas-microsoft-com:office:excel"
      xmlns="http://www.w3.org/TR/REC-html40">
<head>
    <meta http-equiv=Content-Type content="text/html; charset=utf-8">
    <meta name=ProgId content=Excel.Sheet>
    <meta name=Generator content="Microsoft Excel 10">
    <style>
        <!--
        table
        {mso-displayed-decimal-separator:"\.";
            mso-displayed-thousand-separator:"\,";}
        @page
        {margin:1.0in .75in 1.0in .75in;
            mso-header-margin:.5in;
            mso-footer-margin:.5in;}
        -->
    </style>
    <!--[if gte mso 9]><xml>
        <x:ExcelWorkbook>
            <x:ExcelWorksheets>
                <x:ExcelWorksheet>
                    <x:Name>Sheet1</x:Name>
                    <x:WorksheetOptions>
                        <x:Print>
                            <x:ValidPrinterInfo/>
                        </x:Print>
                        <x:Selected/>
                    </x:WorksheetOptions>
                </x:ExcelWorksheet>
            </x:ExcelWorksheets>
        </x:ExcelWorkbook>
    </xml><![endif]-->
    <meta http-equiv=Content-Language content=ko>
</head>

<body>

<table cellspacing="0" cellpadding="2" bordercolor="#999999" bordercolordark="#FFFFFF" border="1">
    <tr height="35">
        <th align="center" bgcolor="#E7E7E7">No.</th>
        <th align="center" bgcolor="#E7E7E7">상태</th>
        <th align="center" bgcolor="#E7E7E7">예약접수일</th>
        <th align="center" bgcolor="#E7E7E7">운행날짜</th>
        <th align="center" bgcolor="#E7E7E7">고객명</th>
        <th align="center" bgcolor="#E7E7E7">국적</th>
        <th align="center" bgcolor="#E7E7E7">연락처</th>
        <th align="center" bgcolor="#E7E7E7">항공편명</th>
        <th align="center" bgcolor="#E7E7E7">미팅시간</th>
        <th align="center" bgcolor="#E7E7E7">출발지</th>
        <th align="center" bgcolor="#E7E7E7">도착지</th>
        <th align="center" bgcolor="#E7E7E7">인원</th>
        <th align="center" bgcolor="#E7E7E7">짐개수</th>
        <th align="center" bgcolor="#E7E7E7">차량번호</th>
        <th align="center" bgcolor="#E7E7E7">기사명</th>
        <th align="center" bgcolor="#E7E7E7">기사연락처</th>
        <th align="center" bgcolor="#E7E7E7">공급가</th>
        <th align="center" bgcolor="#E7E7E7">스케줄(특이사항)</th>
    </tr>
    <?
    $j = 1;
    for($i=0 ; $i < $row = db_fetch_array($rs) ; $i++){
        $bus_corp = db_fetch("SELECT * FROM TB_ERP_BUS_CORP where bc_idx='{$row[bc_idx]}' ");

        $start_date = substr($row['start_date'], 0, 10);
        $end_date = substr($row['end_date'], 0, 10);
        if($start_date == $end_date) {
            $bus_date = $start_date;
        } else {
            $bus_date = $start_date . " ~<br>" . $end_date;
        }


        //휴대폰 번호 하이픈 없을시 처리
        if($row['driver_phone']){
            $row['driver_phone'] = str_replace(" ","",$row['driver_phone']);

            if(strpos($row['driver_phone'], '-') !== false){

            }else{
                $phone = $row['driver_phone'];
                if(strlen($phone) == 11){
                    $no1 = substr($phone, 0,3);
                    $no2 = substr($phone, 3,4);
                    $no3 = substr($phone, 7,4);

                    $row['driver_phone'] = $no1.'-'.$no2.'-'.$no3;
                }elseif(strlen($phone) == 10){
                    $no1 = substr($phone, 0,3);
                    $no2 = substr($phone, 3,3);
                    $no3 = substr($phone, 6,4);

                    $row['driver_phone'] = $no1.'-'.$no2.'-'.$no3;
                }
            }
        }

        ?>
        <tr>
            <td align="center"><?=$j?></td>
            <td align="center"><?=(($row['esti_state'] == 'Y') ? '정산완료' : '미정산')?></td>
            <td align="center"><?=$row['ins_dt']?></td>
            <td align="center"><?=$bus_date?></td>
            <td align="center"><?=$row['cus_name']?></td>
            <td align="center"><?=$row['cus_nation']?></td>
            <td align="center"><?=$row['cus_phone']?></td>
            <td align="center"><?=$row['cus_flight']?></td>
            <td align="center"><?=$row['cus_meeting_time']?></td>
            <td align="center"><?=$row['cus_depature_place']?></td>
            <td align="center"><?=$row['cus_destination']?></td>
            <td align="center"><?=$row['cus_people_cnt']?></td>
            <td align="center"><?=$row['cus_luggage_bag']?></td>
            <td align="center"><?=(($row['bus_number']) ? $row['bus_number'] : '미정')?></td>
            <td align="center"><?=(($row['driver_name']) ? $row['driver_name'] : '미정')?></td>
            <td align="center"><?=(($row['driver_phone']) ? $row['driver_phone'] : '미정')?></td>
            <td align="center"><?=number_format($row['bus_price'])?></td>
            <td align="center"><?=$row['schedule']?></td>
        </tr>
        <?
        $j++;
    }
    ?>
</table>

</body>
</html>

Anon7 - 2021