Folder reorganize 1
This commit is contained in:
30
newbigsheet.php
Normal file
30
newbigsheet.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php // phpcs:ignoreFile
|
||||
require "vendor/autoload.php";
|
||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||
|
||||
ob_start();
|
||||
include __DIR__ . '/includes/cropday.php';
|
||||
$cropDayRaw = trim(ob_get_clean());
|
||||
|
||||
if ($cropDayRaw === '' || !ctype_digit($cropDayRaw)) {
|
||||
error_log('Invalid crop day value: ' . $cropDayRaw);
|
||||
die('Unable to determine crop day.');
|
||||
}
|
||||
|
||||
$cropDay = (int) $cropDayRaw;
|
||||
$path = sprintf('\\\\192.168.0.2\\xampp\\htdocs\\lasuca\\controls\\milllab\\2025 MILLLABREPORT\\2025 CROP YEAR\\CROP DAY %d\\cropday%dmilllab.xlsx', $cropDay, $cropDay);
|
||||
|
||||
if (!is_readable($path)) {
|
||||
error_log('Mill lab file inaccessible: ' . $path);
|
||||
die('Server account cannot reach the network file.');
|
||||
}
|
||||
|
||||
$reader=IOFactory::createReader("Xlsx");
|
||||
$spreadsheet=$reader->load($path);
|
||||
$writer=IOFactory::createWriter($spreadsheet, "Html");
|
||||
|
||||
header("Refresh: 120");
|
||||
|
||||
echo $writer->save("php://output");
|
||||
?>
|
||||
Reference in New Issue
Block a user