246 lines
No EOL
7.7 KiB
PHP
246 lines
No EOL
7.7 KiB
PHP
<?php
|
|
if(isset($_POST['liste'])) {
|
|
echo $_POST['dasdatum'];
|
|
$datum_arr = explode('.',$_POST['dasdatum']);
|
|
$timestamp1 = mktime(0,0,0, $datum_arr[1] , $datum_arr[0] ,$datum_arr[2]);
|
|
header("Location:?s=planer&list=".$_POST['liste'].'&time='.$timestamp1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
if(isset($_POST['Tour'])) {
|
|
|
|
if(!isset($_GET['db'])) {
|
|
$GLOBALS['mysql']->insert("INSERT INTO tourengeplant (time) VALUES('".$_GET['time']."')");
|
|
$ptid=$GLOBALS['mysql']->get_last_id();
|
|
} else {
|
|
$GLOBALS['mysql']->query("DELETE FROM tourengeplant2 WHERE plan='".$_GET['list']."'");
|
|
$ptid=$_GET['list'];
|
|
}
|
|
|
|
if(isset($_POST['add'])) {
|
|
$x=$_POST['add'];
|
|
$GLOBALS['mysql']->insert("INSERT INTO tourengeplant2 (
|
|
Tour,
|
|
Auflage,
|
|
Pakete,
|
|
Ladung,
|
|
Paket,
|
|
Stellzeit,
|
|
StartRampe,
|
|
EndeRampe,
|
|
Fahrer,
|
|
Fahrzeug,
|
|
Short,
|
|
time,
|
|
plan
|
|
)
|
|
VALUES
|
|
('".$_POST['Tour'][$x]."'
|
|
,'".$_POST['Auflage'][$x]."'
|
|
,'".$_POST['Pakete'][$x]."'
|
|
,'".$_POST['Ladung'][$x]."'
|
|
,'".$_POST['Paket'][$x]."'
|
|
,'".$_POST['Stellzeit'][$x]."'
|
|
,'".$_POST['StartRampe'][$x]."'
|
|
,'".$_POST['EndeRampe'][$x]."'
|
|
,'".$_POST['Fahrer'][$x]."'
|
|
,'".$_POST['Fahrzeug'][$x]."'
|
|
,'".$_POST['Short'][$x]."'
|
|
,'".$_POST['time'][$x]."'
|
|
,'".$ptid."'
|
|
)");
|
|
}
|
|
|
|
for ($x = 0; $x < sizeof($_POST['Tour']); ++$x)
|
|
{
|
|
$GLOBALS['mysql']->insert("INSERT INTO tourengeplant2 (
|
|
Tour,
|
|
Auflage,
|
|
Pakete,
|
|
Ladung,
|
|
Paket,
|
|
Stellzeit,
|
|
StartRampe,
|
|
EndeRampe,
|
|
Fahrer,
|
|
Fahrzeug,
|
|
Short,
|
|
time,
|
|
plan
|
|
)
|
|
VALUES
|
|
('".$_POST['Tour'][$x]."'
|
|
,'".$_POST['Auflage'][$x]."'
|
|
,'".$_POST['Pakete'][$x]."'
|
|
,'".$_POST['Ladung'][$x]."'
|
|
,'".$_POST['Paket'][$x]."'
|
|
,'".$_POST['Stellzeit'][$x]."'
|
|
,'".$_POST['StartRampe'][$x]."'
|
|
,'".$_POST['EndeRampe'][$x]."'
|
|
,'".$_POST['Fahrer'][$x]."'
|
|
,'".$_POST['Fahrzeug'][$x]."'
|
|
,'".$_POST['Short'][$x]."'
|
|
,'".$_POST['time'][$x]."'
|
|
,'".$ptid."'
|
|
)");
|
|
|
|
}
|
|
header("Location:?s=planer&list=".$ptid."&db&save");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if($_GET['list'] != '') {
|
|
|
|
if(isset($_GET['db'])) {
|
|
if(isset($_GET['save'])) { $success[]='Daten wurden gespeichert.'; $template->assign('success', $success); }
|
|
/*
|
|
$tourenrow = $GLOBALS['mysql']->query("SELECT * FROM tourengeplant2 WHERE plan='".$_GET['list']."' ORDER BY Short");
|
|
$key=0;
|
|
while($toureninfo = $tourenrow->fetch_assoc()){
|
|
|
|
$tour[$key]['Tour']=$toureninfo['Tour'];
|
|
$tour[$key]['Auflage']=$toureninfo['Auflage'];
|
|
$tour[$key]['Pakete']=$toureninfo['Pakete'];
|
|
$tour[$key]['Ladung']=$toureninfo['Ladung'];
|
|
$tour[$key]['Paket']=$toureninfo['Paket'];
|
|
$tour[$key]['Stellzeit']=$toureninfo['Stellzeit'];
|
|
$tour[$key]['StartRampe']=$toureninfo['StartRampe'];
|
|
$tour[$key]['EndeRampe']=$toureninfo['EndeRampe'];
|
|
$tour[$key]['Fahrer']=$toureninfo['Fahrer'];
|
|
$tour[$key]['Fahrzeug']=$toureninfo['Fahrzeug'];
|
|
$tour[$key]['Short']=$toureninfo['Short'];
|
|
$tour[$key]['time']=$toureninfo['time'];
|
|
$tour[$key]['idx']=$key;
|
|
$key++;
|
|
}
|
|
*/
|
|
$inforow = $GLOBALS['mysql']->query_single("SELECT * FROM tourengeplant WHERE pid='".$_GET['list']."'");
|
|
|
|
$dasdatum=date('d.m.Y',$inforow['time']);
|
|
$datum_arr = explode('.',$dasdatum);
|
|
$timestamp1 = mktime(20,0,0, $datum_arr[1] , $datum_arr[0] ,$datum_arr[2]);
|
|
$tourenrow = $GLOBALS['mysql']->query("SELECT * FROM tourengeplant2 WHERE plan='".$_GET['list']."' AND time >= $timestamp1 ORDER BY time");
|
|
$key=0;
|
|
while($toureninfo = $tourenrow->fetch_assoc()){
|
|
|
|
$tour[$key]['Tour']=$toureninfo['Tour'];
|
|
$tour[$key]['Auflage']=$toureninfo['Auflage'];
|
|
$tour[$key]['Pakete']=$toureninfo['Pakete'];
|
|
$tour[$key]['Ladung']=$toureninfo['Ladung'];
|
|
$tour[$key]['Paket']=$toureninfo['Paket'];
|
|
$tour[$key]['Stellzeit']=$toureninfo['Stellzeit'];
|
|
$tour[$key]['StartRampe']=$toureninfo['StartRampe'];
|
|
$tour[$key]['EndeRampe']=$toureninfo['EndeRampe'];
|
|
$tour[$key]['Fahrer']=$toureninfo['Fahrer'];
|
|
$tour[$key]['Fahrzeug']=$toureninfo['Fahrzeug'];
|
|
$tour[$key]['Short']=$toureninfo['Short'];
|
|
$tour[$key]['time']=$toureninfo['time'];
|
|
$tour[$key]['idx']=$key;
|
|
$key++;
|
|
}
|
|
$dasdatum=date('d.m.Y',$inforow['time']);
|
|
$datum_arr = explode('.',$dasdatum);
|
|
$timestamp2 = mktime(0,0,0, $datum_arr[1] , $datum_arr[0] ,$datum_arr[2]);
|
|
$tourenrow = $GLOBALS['mysql']->query("SELECT * FROM tourengeplant2 WHERE plan='".$_GET['list']."' AND time >= $timestamp2 AND time <= $timestamp1 ORDER BY time");
|
|
while($toureninfo = $tourenrow->fetch_assoc()){
|
|
|
|
$tour[$key]['Tour']=$toureninfo['Tour'];
|
|
$tour[$key]['Auflage']=$toureninfo['Auflage'];
|
|
$tour[$key]['Pakete']=$toureninfo['Pakete'];
|
|
$tour[$key]['Ladung']=$toureninfo['Ladung'];
|
|
$tour[$key]['Paket']=$toureninfo['Paket'];
|
|
$tour[$key]['Stellzeit']=$toureninfo['Stellzeit'];
|
|
$tour[$key]['StartRampe']=$toureninfo['StartRampe'];
|
|
$tour[$key]['EndeRampe']=$toureninfo['EndeRampe'];
|
|
$tour[$key]['Fahrer']=$toureninfo['Fahrer'];
|
|
$tour[$key]['Fahrzeug']=$toureninfo['Fahrzeug'];
|
|
$tour[$key]['Short']=$toureninfo['Short'];
|
|
$tour[$key]['time']=$toureninfo['time'];
|
|
$tour[$key]['idx']=$key;
|
|
$key++;
|
|
}
|
|
|
|
|
|
$template->assign('tour', $tour);
|
|
$mitarbeiterrow = $GLOBALS['mysql']->query("SELECT * FROM mitarbeiter");
|
|
while($mitarbeiterinfo = $mitarbeiterrow->fetch_assoc()){
|
|
$option1.='<option value="'.$mitarbeiterinfo['name'].'" >'.$mitarbeiterinfo['name'].'</option>';
|
|
|
|
}
|
|
$Fahrzeugrow = $GLOBALS['mysql']->query("SELECT * FROM fahrzeuge");
|
|
while($Fahrzeuginfo = $Fahrzeugrow->fetch_assoc()){
|
|
$option2.='<option value="'.$Fahrzeuginfo['kz'].'" >'.$Fahrzeuginfo['kz'].'</option>';
|
|
|
|
}
|
|
$template->assign('dbid',$_GET['db']);
|
|
$template->assign('option1', $option1);
|
|
$template->assign('option2', $option2);
|
|
|
|
|
|
} else {
|
|
$tourenrow = $GLOBALS['mysql']->query("SELECT * FROM touren");
|
|
$key=0;
|
|
while($toureninfo = $tourenrow->fetch_assoc()){
|
|
$tourinfomation = $GLOBALS['mysql']->query_single("SELECT * FROM ".$_GET['list']." WHERE B='".$toureninfo['tour']."'");
|
|
|
|
$tour[$key]['Tour']=$tourinfomation['B'];
|
|
$tour[$key]['Auflage']=$tourinfomation['C'];
|
|
$tour[$key]['Pakete']=$tourinfomation['D'];
|
|
$tour[$key]['Ladung']=$tourinfomation['E'];
|
|
$tour[$key]['Paket']=$tourinfomation['F'];
|
|
$tour[$key]['Stellzeit']=$tourinfomation['G'];
|
|
$tour[$key]['StartRampe']=$tourinfomation['H'];
|
|
$tour[$key]['EndeRampe']=$tourinfomation['J'];
|
|
$tour[$key]['Short']=$key;
|
|
|
|
$dasdatum=date('d.m.Y',$_GET['time']);
|
|
$datum_arr = explode('.',$dasdatum);
|
|
$zeit_arr = explode(':',$tourinfomation['G']);
|
|
$timestamp1 = mktime($zeit_arr[0],$zeit_arr[1],0, $datum_arr[1] , $datum_arr[0] ,$datum_arr[2]);
|
|
|
|
$tour[$key]['time']=$timestamp1;
|
|
$tour[$key]['idx']=$key;
|
|
$key++;
|
|
}
|
|
$mitarbeiterrow = $GLOBALS['mysql']->query("SELECT * FROM mitarbeiter");
|
|
while($mitarbeiterinfo = $mitarbeiterrow->fetch_assoc()){
|
|
$option1.='<option value="'.$mitarbeiterinfo['name'].'" >'.$mitarbeiterinfo['name'].'</option>';
|
|
|
|
}
|
|
$Fahrzeugrow = $GLOBALS['mysql']->query("SELECT * FROM fahrzeuge");
|
|
while($Fahrzeuginfo = $Fahrzeugrow->fetch_assoc()){
|
|
$option2.='<option value="'.$Fahrzeuginfo['kz'].'" >'.$Fahrzeuginfo['kz'].'</option>';
|
|
|
|
}
|
|
$warning[]='ACHTUNG BITTE ERSTMALS SPEICHERN VOR ÄNDERUNGEN!'; $template->assign('warning', $warning);
|
|
$template->assign('tour', $tour);
|
|
$template->assign('option1', $option1);
|
|
$template->assign('option2', $option2);
|
|
}
|
|
$template->assign('content', 'tpl/plane_touren.tpl');
|
|
|
|
|
|
} else {
|
|
$TABLESINF = $GLOBALS['mysql']->query("SHOW TABLES");
|
|
$key=0;
|
|
while($inf = $TABLESINF->fetch_assoc()){
|
|
$ok = substr_count($inf['Tables_in_steinmacher'],'list_');
|
|
if($ok == 1) {
|
|
$table[]=$inf['Tables_in_steinmacher'];
|
|
}
|
|
}
|
|
$template->assign('time', time());
|
|
$template->assign('table', $table);
|
|
$template->assign('content', 'tpl/select_plan.tpl');
|
|
}
|
|
|
|
?>
|