✏️ 正在编辑: export.php
路径:
/home/llpreacharge/public_html/user/export.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php session_start(); if($_SESSION['rid']) { $userid=$_SESSION['rid']; } else { header('location:../login.php'); } ?> <?php include'connection.php'; $date=$_POST['date']; $output = ''; if(isset($_POST["export"])) { $query = "SELECT * FROM recharge where Userid='$userid' and Rechargedate='$date'"; $result = mysqli_query($con, $query); if(mysqli_num_rows($result) > 0) { $output .= '<table class="table" Borders="All Borders" cellpadding="10"> <tr> <th>Date</th> <th>Time</th> <th>Recharge Id</th> <th>API Partner Id</th> <th>Mobile No.</th> <th>Operator</th> <th>Amount</th> <th>Credit Used</th> <th>Status</th> <th>Operator Id</th> </tr>'; while($row = mysqli_fetch_array($result)) { $output .= ' <tr> <td>'.$row["Rechargedate"].'</td> <td>'.$row["Time"].'</td> <td>'.$row["Id"].'</td> <td>'.$row["Partnerid"].'</td> <td>'.$row["Mobile"].'</td> <td>'.$row["Companyname"].'</td> <td>'.$row["Amount"].'</td> <td>'.$row["Debitamount"].'</td> <td>'.$row["Status"].'</td> <td>'.$row["Operatorid"].'</td> </tr>'; } $output .= '</table>'; header('Content-Type: application/xls'); header('Content-Disposition: attachment; filename=download.xls'); echo $output; } else { echo "<h2 style='color:red;'>Data Not Found !</h2>"; } } ?>
💾 保存文件
← 返回文件管理器