50 lines
No EOL
1.5 KiB
PHP
50 lines
No EOL
1.5 KiB
PHP
<?php
|
|
header("Content-Type: text/html; charset=utf-8");
|
|
// echo "<pre>"; print_r($row['A']); echo "</pre>";
|
|
error_reporting(E_ALL);
|
|
ini_set('display_errors', 1);
|
|
|
|
$kw_aktuell = (int)date('W');
|
|
$a_jahr = (int)date('Y');
|
|
require('lib/config.php');
|
|
session_name(CONFIG_SESSION);
|
|
session_start(); require('lib/mysql.class.php');
|
|
$GLOBALS['mysql'] = new mysql(CONFIG_MYSQL_HOST,CONFIG_MYSQL_USER,CONFIG_MYSQL_PW,CONFIG_MYSQL_DB);
|
|
//$GLOBALS['mysql']->mysql_query("SET NAMES 'utf8'");
|
|
//$GLOBALS['mysql']->mysql_query("SET CHARACTER SET 'utf8'");
|
|
// date_default_timezone_set('Europe/London');
|
|
date_default_timezone_set('Europe/Berlin');
|
|
|
|
require_once dirname(__FILE__) . '/lib/PhpSpreadsheet/Spreadsheet.php';
|
|
|
|
if($_FILES["select_excel"]["name"] != '')
|
|
{
|
|
$allowed_extension = array('xls', 'xlsx');
|
|
$file_array = explode(".", $_FILES['select_excel']['name']);
|
|
$file_extension = end($file_array);
|
|
if(in_array($file_extension, $allowed_extension))
|
|
{
|
|
$reader = IOFactory::createReader('Xlsx');
|
|
$spreadsheet = $reader->load($_FILES['select_excel']['tmp_name']);
|
|
$writer = IOFactory::createWriter($spreadsheet, 'Html');
|
|
$message = $writer->save('php://output');
|
|
}
|
|
else
|
|
{
|
|
$message = '<div class="alert alert-danger">Only .xls or .xlsx file allowed</div>';
|
|
}
|
|
}
|
|
else
|
|
{
|
|
$message = '<div class="alert alert-danger">Please Select File</div>';
|
|
}
|
|
|
|
echo $message;
|
|
|
|
|
|
//------------------------------------------------------------
|
|
// echo "<pre>"; print_r($row['A']); echo "</pre>";
|
|
//------------------------------------------------------------
|
|
|
|
|
|
?>
|