jb-data.de/up_bericht_ss2020.php
2025-08-11 22:23:30 +02:00

81 lines
No EOL
2.6 KiB
PHP

<?php
header("Content-Type: text/html; charset=utf-8");
error_reporting(E_ALL);
ini_set('display_errors', 1);
$kw = (int)date('W');
$tag = (int)date('d');
$monat = (int)date('m');
$jahr = (int)date('Y');
$kw = $_POST['sasokw'];
$jahr = $_POST['sasojahr'];
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');
$dateityp = GetImageSize($_FILES['datei']['tmp_name']);
//echo $_FILES['datei']['name'];
//echo $_FILES['datei']['tmp_name'];
//echo $_FILES['datei']['size'];
//echo $_FILES['datei']['type'];
//
// move_uploaded_file($_FILES['datei']['tmp_name'],'uploads/'.$_FILES['datei']['name']);
if($_FILES['datei']['type'] == 'application/vnd.ms-excel') {
move_uploaded_file($_FILES['datei']['tmp_name'], $_FILES['datei']['name']);
//echo $_FILES['datei']['name'];
$ok=1;
//------------------------------------ saso round
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
require_once dirname(__FILE__) . '/lib/PHPExcel.php';
$objPHPExcel = PHPExcel_IOFactory::load($_FILES['datei']['name']);
$sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);
$auslese = $sheetData;
//---------------------------- end gewicht lesen und speichern
$lasttour=0; $key=0; $tmp_data=''; $ltour=0;
foreach ($sheetData as $index => $row) {
$tempt=substr($row['B'],-10,10);
echo $tempt."<br>";
$i_tour = $GLOBALS['mysql']->query_single("SELECT * FROM touren WHERE typ=19 AND tour2='".$tempt."'");
if($i_tour['num_rows'] != 0) {
/*
$test = substr($row['F'], 0, 10);
$teile = explode(".", $test);
$tag =$teile[0];
$monat =$teile[1];
$jahr =$teile[2];
$kw_str1 = $jahr."-".$monat."-".$tag;
$kw_str2 = strtotime($kw_str1);
$kw= date("W", $kw_str2);
echo "KW: ".$kw;
*/
$test_tour = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE kw='".$kw."' AND jahr='".$jahr."' and tour='".$i_tour['id']."'");
if($test_tour['num_rows'] != 0) {
$gewicht9 = str_replace(",","",$row['D']);
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht9='".$gewicht9."' WHERE id='".$test_tour['id']."'");
}
}
//--------------------------------------------------------------------------------------------------------------
$key++;
}
}
header('Location: https://edv.jb-transport.de/index.php?s=iss');
?>