init
This commit is contained in:
commit
72a26edcff
22092 changed files with 2101903 additions and 0 deletions
172
up_round.php
Normal file
172
up_round.php
Normal file
|
|
@ -0,0 +1,172 @@
|
|||
<?php
|
||||
header("Content-Type: text/html; charset=utf-8");
|
||||
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 1);
|
||||
|
||||
$kw_aktuell = (int)date('W');
|
||||
$a_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; $dat=substr($_FILES['datei']['name'], 0,6);
|
||||
//------------------------------------ saso round
|
||||
if ($dat=='SaSo_R') {
|
||||
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) {
|
||||
$test = substr($row['E'], 0, 10);
|
||||
Echo"test: ".$test;
|
||||
|
||||
$teile = explode(".", $test);
|
||||
$tag =$teile[0];
|
||||
$monat =$teile[1];
|
||||
$jahr =$teile[2];
|
||||
$zl = mktime(0, 0, 0, $monat, $tag, $jahr);
|
||||
$kw= sprintf("%d", date("W", $zl), date("j.n.Y", strtotime("last Sunday", $zl)), date("j.n.Y", strtotime("+6 day", $zl)));
|
||||
|
||||
echo"kw: ".$kw." jahr: ".$jahr;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
if($row['A']=='Datum') { continue; }
|
||||
if($key==0) {
|
||||
$teile = explode("-",$row['A']);
|
||||
$monat=((int)$teile[0]) ;
|
||||
$tag =((int)$teile[1]) ;
|
||||
$jahr =((int)$teile[2]) ;
|
||||
$jahr = $jahr+2000;
|
||||
$kw= date("W", strtotime($jahr."-".$monat."-".$tag));
|
||||
}
|
||||
*/
|
||||
|
||||
/* echo "A: ".$row['A'];
|
||||
echo "B: ".$row['B'];
|
||||
echo "C: ".$row['C'];
|
||||
echo "D: ".$row['D'];
|
||||
echo "E: ".$row['E'];
|
||||
echo "---</br>";
|
||||
*/
|
||||
|
||||
|
||||
$i_tour = $GLOBALS['mysql']->query_single("SELECT * FROM touren WHERE typ=19 AND tour2='".$row['B']."'");
|
||||
if($i_tour['num_rows'] != 0) {
|
||||
$test_tour = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE kw='".$kw."' AND jahr='".$a_jahr."' and tour='".$i_tour['id']."'");
|
||||
if($test_tour['num_rows'] != 0) {
|
||||
$gewicht = str_replace(",","",$row['D']);
|
||||
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht='".$gewicht."' WHERE id='".$test_tour['id']."'");
|
||||
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht3='".$gewicht."' WHERE id='".$test_tour['id']."'");
|
||||
$exemplare = str_replace(",","",$row['C']);
|
||||
$GLOBALS['mysql']->insert("UPDATE tourenliste SET exemplare='".$exemplare."' WHERE id='".$test_tour['id']."'");
|
||||
echo "Tour: ".$i_tour['tour']."-> neues Gewicht: ".round($gewicht,2)." kg<br>";
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------
|
||||
|
||||
$auslese_test = $GLOBALS['mysql']->query_single("SELECT * FROM tliste WHERE kw='".$kw."' AND jahr='".$jahr."' AND tour='".$row['B']."'");
|
||||
if($auslese_test['num_rows'] == 0) {
|
||||
$GLOBALS['mysql']->insert("INSERT INTO tliste (tag,monat,jahr,kw,gewicht,tour)
|
||||
VALUES(
|
||||
'".$tag."',
|
||||
'".$monat."',
|
||||
'".$jahr."',
|
||||
'".$kw."',
|
||||
'".$row['D']."',
|
||||
'".$row['B']."')
|
||||
");
|
||||
} else {
|
||||
$GLOBALS['mysql']->insert("UPDATE tliste SET tag='".$tag."' WHERE id='".$auslese_test['id']."'");
|
||||
$GLOBALS['mysql']->insert("UPDATE tliste SET monat='".$monat."' WHERE id='".$auslese_test['id']."'");
|
||||
$GLOBALS['mysql']->insert("UPDATE tliste SET jahr='".$jahr."' WHERE id='".$auslese_test['id']."'");
|
||||
$GLOBALS['mysql']->insert("UPDATE tliste SET kw='".$kw."' WHERE id='".$auslese_test['id']."'");
|
||||
$GLOBALS['mysql']->insert("UPDATE tliste SET gewicht='".$row['B']."' WHERE id='".$auslese_test['id']."'");
|
||||
}
|
||||
$key++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------ rs roun
|
||||
if ($dat=='RUND_R') {
|
||||
echo "RS-Start"."<br>"; ;
|
||||
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
|
||||
//echo "<pre>"; print_r($sheetData); echo "</pre>";
|
||||
|
||||
$lasttour=0; $key=0; $tmp_data=''; $ltour=0;
|
||||
|
||||
foreach ($sheetData as $index => $row) {
|
||||
|
||||
// echo "<pre>"; print_r($row); echo "</pre>";
|
||||
|
||||
// echo "B: ".$row['B']."<br>";
|
||||
$i_tour = $GLOBALS['mysql']->query_single("SELECT * FROM touren WHERE typ=7 AND tour2='".$row['B']."'");
|
||||
if($i_tour['num_rows'] != 0) {
|
||||
$test_tour = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' AND jahr='".$a_jahr."' and tour='".$i_tour['id']."'");
|
||||
if($test_tour['num_rows'] != 0) {
|
||||
$test = substr($row['E'], 0, 10);
|
||||
$teile = explode(".", $test);
|
||||
//echo $teile[0].".".$teile[1].".".$teile[2];
|
||||
$GLOBALS['mysql']->insert("UPDATE tourenliste SET tag='".$teile[0]."' WHERE id='".$test_tour['id']."'");
|
||||
$GLOBALS['mysql']->insert("UPDATE tourenliste SET monat='".$teile[1]."' WHERE id='".$test_tour['id']."'");
|
||||
$GLOBALS['mysql']->insert("UPDATE tourenliste SET jahr='".$teile[2]."' WHERE id='".$test_tour['id']."'");
|
||||
$gewicht = str_replace(",","",$row['D']);
|
||||
$exemplare = str_replace(",","",$row['C']);
|
||||
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht='".$gewicht."' WHERE id='".$test_tour['id']."'");
|
||||
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht3='".$gewicht."' WHERE id='".$test_tour['id']."'");
|
||||
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht4='".$gewicht."' WHERE id='".$test_tour['id']."'");
|
||||
$GLOBALS['mysql']->insert("UPDATE tourenliste SET exemplare='".$exemplare."' WHERE id='".$test_tour['id']."'");
|
||||
$zeit=substr($row['E'],14, 5);
|
||||
//$zeit2=substr($row['E'],15, 2);
|
||||
//echo $zeit=$zeit1+$zeit2;
|
||||
$GLOBALS['mysql']->insert("UPDATE tourenliste SET zeit='".$zeit."' WHERE id='".$test_tour['id']."'");
|
||||
|
||||
echo "Tour: ".$i_tour['tour']."-> neues Gewicht: ".round($gewicht,2)." kg - Zeit".$zeit."<br>";
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------------------------
|
||||
$key++;
|
||||
}
|
||||
}
|
||||
|
||||
//header('Location: https://edv.jb-transport.de/index.php?s=iss');
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue