747 lines
36 KiB
PHP
747 lines
36 KiB
PHP
<?php
|
|
$_SESSION['m1']=3; $_SESSION['m2']=19;
|
|
|
|
error_reporting(E_ALL); error_reporting(1);
|
|
|
|
//--------- jahrauswahl
|
|
|
|
$pjahr=date('W', (mktime(0, 0, 0, 1, 1, $jahr+1) - 4*86400));
|
|
$ijahr=date('W', (mktime(0, 0, 0, 1, 1, $jahr) - 4*86400));
|
|
$mjahr=date('W', (mktime(0, 0, 0, 1, 1, $jahr-1) - 4*86400));
|
|
if($_GET['wahl']==1){ if($_GET['kw']==1) { $kw=$mjahr; $jahr=$_GET['jahr']-1; } else { $kw=$_GET['kw']-1; $jahr=$_GET['jahr']; }}
|
|
elseif($_GET['wahl']==2){ if($_GET['kw']==$ijahr) { $kw=1; $jahr=$_GET['jahr']+1; } else { $kw=$_GET['kw']+1; $jahr=$_GET['jahr']; }}
|
|
//elseif($_GET['wahl']>0) { $temp = strtotime($jahr . 'W' . $kw . '6'); $tag = (int)date('d', $temp); $monat = (int)date('m', $temp); }
|
|
else {
|
|
$temp = strtotime("next Saturday");
|
|
$jahr = (int)date('Y', $temp);
|
|
$kw = (int)date('W', $temp);
|
|
//$tag = (int)date('d', $temp);
|
|
//$monat = (int)date('m', $temp);
|
|
}
|
|
/* $jahr = $jahr; $kw = $kw; */
|
|
//------------------- next sunnday of kw
|
|
// $temp = strtotime("next Sunday");
|
|
// $tag=date('d', $temp); $monat=date('m', $temp); $jahr=date('Y', $temp);
|
|
|
|
|
|
//-------------
|
|
// $jahr = 2021;
|
|
|
|
|
|
|
|
$sasonorm=$GLOBALS['mysql']->query_single("SELECT * FROM sasonorm WHERE kw='".$kw."' AND jahr='".$jahr."'");
|
|
$saso_norm=$sasonorm['norm'];
|
|
|
|
//-------------------- wiederkehrende abfragen -------------------------------------------------
|
|
$a_touren = $GLOBALS['mysql']->query_array("SELECT * FROM touren WHERE typ=19");
|
|
$a_fahrzg = $GLOBALS['a_fahrzg'];
|
|
$a_fahrer = $GLOBALS['a_fahrer'];
|
|
$a_planbz = $GLOBALS['a_planbz'];
|
|
$a_planbf = $GLOBALS['a_planbf'];
|
|
|
|
//------------------------------------------
|
|
if(isset($_POST['tcopy'])) {
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET erl=0 WHERE typ=19 AND kw='".$kw."' AND jahr='".$jahr."'");
|
|
|
|
// echo $row['ablock'];
|
|
}
|
|
//---------------------------------------- Tour add
|
|
//---------------- neue Tour Hinzufügen
|
|
if(isset($_POST['dazu'])) {
|
|
$ptourid=$_POST['plus'];
|
|
$otourid=$ptourid-9;
|
|
$row_tourp = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE tour='".$otourid."' and kw='".$kw."' AND jahr='".$jahr."'");
|
|
//echo "<pre>"; print_r($row_tourp); echo "</pre>";
|
|
$row_tourpp = $GLOBALS['mysql']->query_single("SELECT * FROM touren WHERE id='".$ptourid."'");
|
|
if($row_tourp['Norm']<1) { $success="nur möglich wenn eine Paketnorm festgelegt ist."; $template->assign('error', $success); }
|
|
//elseif($row_tourp['exemplare']<1) { $success="nur möglich wenn Exemplare festgelegt sind."; $template->assign('error', $success); }
|
|
else {
|
|
$gewicht4=$row_tourp['gewicht']/2;
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht4='".$gewicht4."' WHERE id='".$row_tourp['id']."'");
|
|
// $ppakete=$row_tourp['exemplare']/$row_tourp['Norm']; echo "speichern";
|
|
$ppakete=$row_tourp['Pakete']/2;
|
|
$ppakete=ceil($ppakete);
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET pakete2='".$ppakete."' WHERE id='".$row_tourp['id']."'");
|
|
$GLOBALS['mysql']->insert("INSERT INTO tourenliste (tour,gewicht2,gewicht3,gewicht4,gewicht5,zeit,time,rampe,exemplare,pakete2,gewicht,kw,tag,monat,jahr,typ,utyp,infotext,Norm,fahrer,auto,Pakete)
|
|
VALUES(
|
|
'".$_POST['plus']."',
|
|
'".$row_tourp['gewicht2']."',
|
|
'".$row_tourp['gewicht3']."',
|
|
'".$gewicht4."',
|
|
'".$row_tourp['gewicht5']."',
|
|
'".$row_tourp['zeit']."',
|
|
'".$row_tourp['time']."',
|
|
'".$row_tourp['rampe']."',
|
|
'".$row_tourp['exemplare']."',
|
|
'".$ppakete."',
|
|
'".$row_tourp['gewicht']."',
|
|
'".$row_tourp['kw']."',
|
|
'".$row_tourp['tag']."',
|
|
'".$row_tourp['monat']."',
|
|
'".$row_tourp['jahr']."',
|
|
'".$row_tourp['typ']."',
|
|
'".$row_tourp['utyp']."',
|
|
'".$row_tourpp['infotitel']."',
|
|
'".$row_tourp['Norm']."',
|
|
49,
|
|
99,
|
|
'".$row_tourp['Pakete']."')
|
|
");
|
|
$success="Hinweis: SaSo 2.Auto Tour:".$ptourid." gespeichert."; $template->assign('success', $success);
|
|
}
|
|
}
|
|
|
|
|
|
//---------------------------------------- Norm speichern
|
|
if(isset($_POST['sasonorm'])) {
|
|
if($_POST['sasonorm']!=0) {
|
|
$saso_norm = $GLOBALS['mysql']->sql("SELECT * FROM tourenliste WHERE kw='".$kw."' and jahr='".$jahr."' and typ=19");
|
|
while($row = $saso_norm->fetch_assoc()) {
|
|
|
|
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht4='".$row['gewicht']."' WHERE id='".$row['id']."'");
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET Norm='".$_POST['sasonorm']."' WHERE id='".$row['id']."'");
|
|
$pak=$row['exemplare']/$_POST['sasonorm']; $pak2=ceil($pak); // Pakete ausrechnen
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET Pakete='".$pak2."' WHERE id='".$row['id']."'");
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET pakete2='".$pak2."' WHERE id='".$row['id']."'");
|
|
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET pakete2='".$pak2."' WHERE id='".$row['id']."'");
|
|
|
|
$key++;
|
|
}
|
|
}
|
|
$template->assign('success', 'Die Norm wurde angepasst und alle Touren neu berechnet');
|
|
}
|
|
//------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
//------------------------- Paketmenge und Cargewichte berechnen ---------------------------------------------------------------------------------------
|
|
//$saso_fail = $GLOBALS['mysql']->sql("SELECT * FROM tourenliste WHERE kw='".$kw."' and jahr='".$jahr."' and typ=19 AND tour>1000 ORDER BY zeit"); $key=0;
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------------------------- Auslesen Touren
|
|
//-------------------------------------------------------------------------------------- Touren 2020
|
|
//------------------------------------------------------------------------------------------------------
|
|
//-------------------------------------------------------------------------------------- Block 1 -- 11
|
|
$toursumme=0;
|
|
$sa11 = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE kw='".$kw."' and jahr='".$jahr."' and typ=19 AND utyp<=11 ORDER BY tour");
|
|
if($sa11['num_rows'] != 0) {
|
|
$toursumme=$toursumme+$sa11['num_rows'];
|
|
$template->assign('sa11',$sa11['num_rows']);
|
|
$sa1 = $GLOBALS['mysql']->sql("SELECT * FROM tourenliste WHERE kw='".$kw."' and jahr='".$jahr."' and typ=19 AND utyp<=11 ORDER BY tour"); $key=0;
|
|
while($row = $sa1->fetch_assoc()) {
|
|
$tag=$row['tag']; $monat=$row['monat'];
|
|
$s11[$key]['zeit']=$row['zeit'];
|
|
$s11[$key]['id']=$row['id'];
|
|
//---------- Tourarray ----------
|
|
$ta_id= array_search($row['tour'], array_column($a_touren, 'id'));
|
|
$s11[$key]['tname']=$a_touren[$ta_id]['tour'];
|
|
$s11[$key]['aktiv']=$a_touren[$ta_id]['aktiv'];
|
|
$s11[$key]['afirma']=$a_touren[$ta_id]['afirma'];
|
|
$s11[$key]['s_auto']=$a_touren[$ta_id]['s_auto'];
|
|
$s11[$key]['s_fahrer']=$a_touren[$ta_id]['s_fahrer'];
|
|
//-- MA Test
|
|
/*
|
|
$test_ma = $GLOBALS['mysql']->query_single("SELECT * FROM planer WHERE tag='".$tag."' AND monat='".$monat."' AND jahr='".$jahr."' AND mid='".$row['fahrer']."' ");
|
|
if($test_ma['num_rows'] != 0) {
|
|
$pa_id= array_search($test_ma['grund'], array_column($a_planbz, 'id'));
|
|
if($a_planbz[$pa_id]['nichtda']==1 || $a_planbz[$pa_id]['nichtda']==8 || $a_planbz[$pa_id]['nichtda']==19) {
|
|
$s11[$key]['f_nichtda']=1;
|
|
}
|
|
}
|
|
$ma_id= array_search($row['fahrer'], array_column($a_fahrer, 'id'));
|
|
$s11[$key]['name']=$a_fahrer[$ma_id]['name'];
|
|
//-- Car Test
|
|
$test_car = $GLOBALS['mysql']->query_single("SELECT * FROM fplaner WHERE tag='".$tag."' AND monat='".$monat."' AND jahr='".$jahr."' AND fid='".$row['auto']."' ");
|
|
if($test_car['num_rows'] != 0) {
|
|
$pf_id= array_search($test_car['grund'], array_column($a_planbf, 'id'));
|
|
if($a_planbf[$pf_id]['aktiv']==0) {
|
|
$s11[$key]['c_nichtda']=1;
|
|
}
|
|
}
|
|
$aa_id= array_search($row['auto'], array_column($a_fahrzg, 'id'));
|
|
$s11[$key]['kz']=$a_fahrzg[$aa_id]['kz'];
|
|
*/
|
|
$s11[$key]['gewicht']=$row['bereitzeit'];
|
|
$s11[$key]['gewicht']=$row['fertigzeit'];
|
|
|
|
|
|
$s11[$key]['gewicht']=$row['gewicht'];
|
|
$s11[$key]['gewicht9']=$row['gewicht9'];
|
|
$s11[$key]['amtsblatt']=$row['amtsblatt'];
|
|
$s11[$key]['exemplare']=$row['exemplare'];
|
|
|
|
if($row['gewicht3'] <1) {
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht3='".$row['gewicht']."' WHERE id='".$row['id']."'");
|
|
$row['gewicht3']=$row['gewicht'];
|
|
}
|
|
$s11[$key]['gewicht3']=$row['gewicht3'];
|
|
$s11[$key]['gewicht4']=$row['gewicht4'];
|
|
|
|
if($row['Pakete']<1) {
|
|
if($row['Norm']<1) { $row['Norm']=12; }
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET Pakete='".$row['exemplare']/$row['Norm']."' WHERE id='".$row['id']."'");
|
|
} else {
|
|
$s11[$key]['pakete']=$row['Pakete'];
|
|
$s11[$key]['pakete2']=$row['pakete2'];
|
|
}
|
|
//------------------------- Einzelgewicht
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht2='".$row['gewicht']/$row['Pakete']."' WHERE id='".$row['id']."'");
|
|
$s11[$key]['gewicht2']=$row['gewicht2'];
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht5='".$row['gewicht3']/$row['Pakete']."' WHERE id='".$row['id']."'");
|
|
$s11[$key]['gewicht5']=$row['gewicht5'];
|
|
$key++;
|
|
}
|
|
$template->assign('s11',$s11);
|
|
}
|
|
//------------------------------------------------------------------------------------------------------
|
|
//-------------------------------------------------------------------------------------- Block 2a -- 21
|
|
$toursumme=0;
|
|
$sa21 = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE kw='".$kw."' and jahr='".$jahr."' and typ=19 AND utyp=21 ORDER BY tour");
|
|
if($sa21['num_rows'] != 0) {
|
|
$toursumme=$toursumme+$sa21['num_rows'];
|
|
$template->assign('sa21',$sa21['num_rows']);
|
|
$sa21 = $GLOBALS['mysql']->sql("SELECT * FROM tourenliste WHERE kw='".$kw."' and jahr='".$jahr."' and typ=19 AND utyp=21 ORDER BY tour"); $key=0;
|
|
while($row = $sa21->fetch_assoc()) {
|
|
$s21[$key]['zeit']=$row['zeit'];
|
|
$s21[$key]['id']=$row['id'];
|
|
//---------- Tourarray ----------
|
|
$ta_id= array_search($row['tour'], array_column($a_touren, 'id'));
|
|
$s21[$key]['tname']=$a_touren[$ta_id]['tour'];
|
|
$s21[$key]['aktiv']=$a_touren[$ta_id]['aktiv'];
|
|
$s21[$key]['afirma']=$a_touren[$ta_id]['afirma'];
|
|
$s21[$key]['s_auto']=$a_touren[$ta_id]['s_auto'];
|
|
$s21[$key]['s_fahrer']=$a_touren[$ta_id]['s_fahrer'];
|
|
//-- MA Test
|
|
/*
|
|
$test_ma = $GLOBALS['mysql']->query_single("SELECT * FROM planer WHERE tag='".$tag."' AND monat='".$monat."' AND jahr='".$jahr."' AND mid='".$row['fahrer']."' ");
|
|
if($test_ma['num_rows'] != 0) {
|
|
$pa_id= array_search($test_ma['grund'], array_column($a_planbz, 'id'));
|
|
if($a_planbz[$pa_id]['nichtda']==1 || $a_planbz[$pa_id]['nichtda']==8 || $a_planbz[$pa_id]['nichtda']==19) {
|
|
$s21[$key]['f_nichtda']=1;
|
|
}
|
|
}
|
|
$ma_id= array_search($row['fahrer'], array_column($a_fahrer, 'id'));
|
|
$s21[$key]['name']=$a_fahrer[$ma_id]['name'];
|
|
//-- Car Test
|
|
$test_car = $GLOBALS['mysql']->query_single("SELECT * FROM fplaner WHERE tag='".$tag."' AND monat='".$monat."' AND jahr='".$jahr."' AND fid='".$row['auto']."' ");
|
|
if($test_car['num_rows'] != 0) {
|
|
$pf_id= array_search($test_car['grund'], array_column($a_planbf, 'id'));
|
|
if($a_planbf[$pf_id]['aktiv']==0) {
|
|
$s21[$key]['c_nichtda']=1;
|
|
}
|
|
}
|
|
$aa_id= array_search($row['auto'], array_column($a_fahrzg, 'id'));
|
|
$s21[$key]['kz']=$a_fahrzg[$aa_id]['kz'];
|
|
*/
|
|
$s21[$key]['bereitzeit']=$row['bereitzeit'];
|
|
$s21[$key]['fertigzeit']=$row['fertigzeit'];
|
|
|
|
$s21[$key]['gewicht']=$row['gewicht'];
|
|
$s21[$key]['exemplare']=$row['exemplare'];
|
|
if($row['gewicht3'] <1) {
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht3='".$row['gewicht']."' WHERE id='".$row['id']."'");
|
|
$row['gewicht3']=$row['gewicht'];
|
|
}
|
|
$s21[$key]['gewicht3']=$row['gewicht3'];
|
|
$s21[$key]['gewicht9']=$row['gewicht9'];
|
|
$s21[$key]['amtsblatt']=$row['amtsblatt'];
|
|
$s21[$key]['gewicht4']=$row['gewicht4'];
|
|
if($row['Pakete']<1) {
|
|
if($row['Norm']<1) { $row['Norm']=12; }
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET Pakete='".$row['exemplare']/$row['Norm']."' WHERE id='".$row['id']."'");
|
|
} else {
|
|
$s21[$key]['pakete']=$row['Pakete'];
|
|
$s21[$key]['pakete2']=$row['pakete2'];
|
|
}
|
|
//------------------------- Einzelgewicht
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht2='".$row['gewicht']/$row['Pakete']."' WHERE id='".$row['id']."'");
|
|
$s21[$key]['gewicht2']=$row['gewicht2'];
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht5='".$row['gewicht3']/$row['Pakete']."' WHERE id='".$row['id']."'");
|
|
$s21[$key]['gewicht5']=$row['gewicht5'];
|
|
$key++;
|
|
}
|
|
$template->assign('s21',$s21);
|
|
}
|
|
//-------------------------------------------------------------------------------------- Block 2b -- 22
|
|
$toursumme=0;
|
|
$sa22 = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE kw='".$kw."' and jahr='".$jahr."' and typ=19 AND utyp=22 ORDER BY tour");
|
|
if($sa22['num_rows'] != 0) {
|
|
$toursumme=$toursumme+$sa22['num_rows'];
|
|
$template->assign('sa22',$sa22['num_rows']);
|
|
$st22 = $GLOBALS['mysql']->sql("SELECT * FROM tourenliste WHERE kw='".$kw."' and jahr='".$jahr."' and typ=19 AND utyp=22 ORDER BY tour"); $key=0;
|
|
while($row = $st22->fetch_assoc()) {
|
|
$s22[$key]['zeit']=$row['zeit'];
|
|
$s22[$key]['id']=$row['id'];
|
|
//---------- Tourarray ----------
|
|
$ta_id= array_search($row['tour'], array_column($a_touren, 'id'));
|
|
$s22[$key]['tname']=$a_touren[$ta_id]['tour'];
|
|
$s22[$key]['aktiv']=$a_touren[$ta_id]['aktiv'];
|
|
$s22[$key]['afirma']=$a_touren[$ta_id]['afirma'];
|
|
$s22[$key]['s_auto']=$a_touren[$ta_id]['s_auto'];
|
|
$s22[$key]['s_fahrer']=$a_touren[$ta_id]['s_fahrer'];
|
|
//-- MA Test
|
|
$test_ma = $GLOBALS['mysql']->query_single("SELECT * FROM planer WHERE tag='".$tag."' AND monat='".$monat."' AND jahr='".$jahr."' AND mid='".$row['fahrer']."' ");
|
|
if($test_ma['num_rows'] != 0) {
|
|
$pf_id= array_search($test_ma['grund'], array_column($a_planbz, 'id'));
|
|
if($a_planbz[$pf_id]['nichtda']==1 || $a_planbz[$pa_id]['nichtda']==8 || $a_planbz[$pa_id]['nichtda']==19) {
|
|
$s22[$key]['f_nichtda']=1;
|
|
}
|
|
}
|
|
$ma_id= array_search($row['fahrer'], array_column($a_fahrer, 'id'));
|
|
$s22[$key]['name']=$a_fahrer[$ma_id]['name'];
|
|
//-- Car Test
|
|
$test_car = $GLOBALS['mysql']->query_single("SELECT * FROM fplaner WHERE tag='".$tag."' AND monat='".$monat."' AND jahr='".$jahr."' AND fid='".$row['auto']."' ");
|
|
if($test_car['num_rows'] != 0) {
|
|
$pa_id= array_search($test_car['grund'], array_column($a_planbf, 'id'));
|
|
if($a_planbf[$pa_id]['aktiv']==0) {
|
|
$s22[$key]['c_nichtda']=1;
|
|
}
|
|
}
|
|
$aa_id= array_search($row['auto'], array_column($a_fahrzg, 'id'));
|
|
$s22[$key]['kz']=$a_fahrzg[$aa_id]['kz'];
|
|
$s22[$key]['gewicht']=$row['gewicht'];
|
|
$s22[$key]['gewicht9']=$row['gewicht9'];
|
|
$s22[$key]['amtsblatt']=$row['amtsblatt'];
|
|
$s22[$key]['exemplare']=$row['exemplare'];
|
|
if($row['gewicht3'] <1) {
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht3='".$row['gewicht']."' WHERE id='".$row['id']."'");
|
|
$row['gewicht3']=$row['gewicht'];
|
|
}
|
|
$s22[$key]['gewicht3']=$row['gewicht3'];
|
|
$s22[$key]['gewicht4']=$row['gewicht4'];
|
|
if($row['Pakete']<1) {
|
|
if($row['Norm']<1) { $row['Norm']=12; }
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET Pakete='".$row['exemplare']/$row['Norm']."' WHERE id='".$row['id']."'");
|
|
} else {
|
|
$s22[$key]['pakete']=$row['Pakete'];
|
|
$s22[$key]['pakete2']=$row['pakete2'];
|
|
}
|
|
//------------------------- Einzelgewicht
|
|
//------------------------- Einzelgewicht
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht2='".$row['gewicht']/$row['Pakete']."' WHERE id='".$row['id']."'");
|
|
$s22[$key]['gewicht2']=$row['gewicht2'];
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht5='".$row['gewicht3']/$row['Pakete']."' WHERE id='".$row['id']."'");
|
|
$s22[$key]['gewicht5']=$row['gewicht5'];
|
|
$key++;
|
|
}
|
|
$template->assign('s22',$s22);
|
|
}
|
|
//-------------------------------------------------------------------------------------- Block 3a -- 31
|
|
$toursumme=0;
|
|
$sa31 = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE kw='".$kw."' and jahr='".$jahr."' and typ=19 AND utyp=31 ORDER BY tour");
|
|
if($sa31['num_rows'] != 0) {
|
|
$toursumme=$toursumme+$sa31['num_rows'];
|
|
$template->assign('sa31',$sa31['num_rows']);
|
|
$sa31 = $GLOBALS['mysql']->sql("SELECT * FROM tourenliste WHERE kw='".$kw."' and jahr='".$jahr."' and typ=19 AND utyp=31 ORDER BY tour"); $key=0;
|
|
while($row = $sa31->fetch_assoc()) {
|
|
$s31[$key]['zeit']=$row['zeit'];
|
|
$s31[$key]['id']=$row['id'];
|
|
//---------- Tourarray ----------
|
|
$ta_id= array_search($row['tour'], array_column($a_touren, 'id'));
|
|
$s31[$key]['tname']=$a_touren[$ta_id]['tour'];
|
|
$s31[$key]['aktiv']=$a_touren[$ta_id]['aktiv'];
|
|
$s31[$key]['afirma']=$a_touren[$ta_id]['afirma'];
|
|
$s31[$key]['s_auto']=$a_touren[$ta_id]['s_auto'];
|
|
$s31[$key]['s_fahrer']=$a_touren[$ta_id]['s_fahrer'];
|
|
//-- MA Test
|
|
$test_ma = $GLOBALS['mysql']->query_single("SELECT * FROM planer WHERE tag='".$tag."' AND monat='".$monat."' AND jahr='".$jahr."' AND mid='".$row['fahrer']."' ");
|
|
if($test_ma['num_rows'] != 0) {
|
|
$pa_id= array_search($test_ma['grund'], array_column($a_planbz, 'id'));
|
|
if($a_planbz[$pa_id]['nichtda']==1 || $a_planbz[$pa_id]['nichtda']==8 || $a_planbz[$pa_id]['nichtda']==19) {
|
|
$s31[$key]['f_nichtda']=1;
|
|
}
|
|
}
|
|
$ma_id= array_search($row['fahrer'], array_column($a_fahrer, 'id'));
|
|
$s31[$key]['name']=$a_fahrer[$ma_id]['name'];
|
|
//-- Car Test
|
|
$test_car = $GLOBALS['mysql']->query_single("SELECT * FROM fplaner WHERE tag='".$tag."' AND monat='".$monat."' AND jahr='".$jahr."' AND fid='".$row['auto']."' ");
|
|
if($test_car['num_rows'] != 0) {
|
|
$pf_id= array_search($test_car['grund'], array_column($a_planbf, 'id'));
|
|
if($a_planbf[$pf_id]['aktiv']==0) {
|
|
$s31[$key]['c_nichtda']=1;
|
|
}
|
|
}
|
|
$aa_id= array_search($row['auto'], array_column($a_fahrzg, 'id'));
|
|
$s31[$key]['kz']=$a_fahrzg[$aa_id]['kz'];
|
|
$s31[$key]['gewicht']=$row['gewicht'];
|
|
$s31[$key]['gewicht9']=$row['gewicht9'];
|
|
$s31[$key]['amtsblatt']=$row['amtsblatt'];
|
|
$s31[$key]['exemplare']=$row['exemplare'];
|
|
if($row['gewicht3'] <1) {
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht3='".$row['gewicht']."' WHERE id='".$row['id']."'");
|
|
$row['gewicht3']=$row['gewicht'];
|
|
}
|
|
$s31[$key]['gewicht3']=$row['gewicht3'];
|
|
$s31[$key]['gewicht4']=$row['gewicht4'];
|
|
if($row['Pakete']<1) {
|
|
if($row['Norm']<1) { $row['Norm']=12; }
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET Pakete='".$row['exemplare']/$row['Norm']."' WHERE id='".$row['id']."'");
|
|
} else {
|
|
$s31[$key]['pakete']=$row['Pakete'];
|
|
$s31[$key]['pakete2']=$row['pakete2'];
|
|
}
|
|
//------------------------- Einzelgewicht
|
|
//------------------------- Einzelgewicht
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht2='".$row['gewicht']/$row['Pakete']."' WHERE id='".$row['id']."'");
|
|
$s31[$key]['gewicht2']=$row['gewicht2'];
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht5='".$row['gewicht3']/$row['Pakete']."' WHERE id='".$row['id']."'");
|
|
$s31[$key]['gewicht5']=$row['gewicht5'];
|
|
$key++;
|
|
}
|
|
$template->assign('s31',$s31);
|
|
}
|
|
//-------------------------------------------------------------------------------------- Block 3b -- 32
|
|
$toursumme=0;
|
|
$sa32 = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE kw='".$kw."' and jahr='".$jahr."' and typ=19 AND utyp=32 ORDER BY tour");
|
|
if($sa32['num_rows'] != 0) {
|
|
$toursumme=$toursumme+$sa32['num_rows'];
|
|
$template->assign('sa32',$sa32['num_rows']);
|
|
$sa32 = $GLOBALS['mysql']->sql("SELECT * FROM tourenliste WHERE kw='".$kw."' and jahr='".$jahr."' and typ=19 AND utyp=32 ORDER BY tour"); $key=0;
|
|
while($row = $sa32->fetch_assoc()) {
|
|
$s32[$key]['zeit']=$row['zeit'];
|
|
$s32[$key]['id']=$row['id'];
|
|
//---------- Tourarray ----------
|
|
$ta_id= array_search($row['tour'], array_column($a_touren, 'id'));
|
|
$s32[$key]['tname']=$a_touren[$ta_id]['tour'];
|
|
$s32[$key]['aktiv']=$a_touren[$ta_id]['aktiv'];
|
|
$s32[$key]['afirma']=$a_touren[$ta_id]['afirma'];
|
|
$s32[$key]['s_auto']=$a_touren[$ta_id]['s_auto'];
|
|
$s32[$key]['s_fahrer']=$a_touren[$ta_id]['s_fahrer'];
|
|
//-- MA Test
|
|
$test_ma = $GLOBALS['mysql']->query_single("SELECT * FROM planer WHERE tag='".$tag."' AND monat='".$monat."' AND jahr='".$jahr."' AND mid='".$row['fahrer']."' ");
|
|
if($test_ma['num_rows'] != 0) {
|
|
$pa_id= array_search($test_ma['grund'], array_column($a_planbz, 'id'));
|
|
if($a_planbz[$pa_id]['nichtda']==1 || $a_planbz[$pa_id]['nichtda']==8 || $a_planbz[$pa_id]['nichtda']==19) {
|
|
$s32[$key]['f_nichtda']=1;
|
|
}
|
|
}
|
|
$ma_id= array_search($row['fahrer'], array_column($a_fahrer, 'id'));
|
|
$s32[$key]['name']=$a_fahrer[$ma_id]['name'];
|
|
//-- Car Test
|
|
$test_car = $GLOBALS['mysql']->query_single("SELECT * FROM fplaner WHERE tag='".$tag."' AND monat='".$monat."' AND jahr='".$jahr."' AND fid='".$row['auto']."' ");
|
|
if($test_car['num_rows'] != 0) {
|
|
$pf_id= array_search($test_car['grund'], array_column($a_planbf, 'id'));
|
|
if($a_planbf[$pf_id]['aktiv']==0) {
|
|
$s32[$key]['c_nichtda']=1;
|
|
}
|
|
}
|
|
$aa_id= array_search($row['auto'], array_column($a_fahrzg, 'id'));
|
|
$s32[$key]['kz']=$a_fahrzg[$aa_id]['kz'];
|
|
$s32[$key]['gewicht']=$row['gewicht'];
|
|
$s32[$key]['gewicht9']=$row['gewicht9'];
|
|
$s32[$key]['amtsblatt']=$row['amtsblatt'];
|
|
$s32[$key]['exemplare']=$row['exemplare'];
|
|
if($row['gewicht3'] <1) {
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht3='".$row['gewicht']."' WHERE id='".$row['id']."'");
|
|
$row['gewicht3']=$row['gewicht'];
|
|
}
|
|
$s32[$key]['gewicht3']=$row['gewicht3'];
|
|
$s32[$key]['gewicht4']=$row['gewicht4'];
|
|
if($row['Pakete']<1) {
|
|
if($row['Norm']<1) { $row['Norm']=12; }
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET Pakete='".$row['exemplare']/$row['Norm']."' WHERE id='".$row['id']."'");
|
|
} else {
|
|
$s32[$key]['pakete']=$row['Pakete'];
|
|
$s32[$key]['pakete2']=$row['pakete2'];
|
|
}
|
|
//------------------------- Einzelgewicht
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht2='".$row['gewicht']/$row['Pakete']."' WHERE id='".$row['id']."'");
|
|
$s32[$key]['gewicht2']=$row['gewicht2'];
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht5='".$row['gewicht3']/$row['Pakete']."' WHERE id='".$row['id']."'");
|
|
$s32[$key]['gewicht5']=$row['gewicht5'];
|
|
$key++;
|
|
}
|
|
$template->assign('s32',$s32);
|
|
}
|
|
//-------------------------------------------------------------------------------------- Block 4a -41
|
|
$toursumme=0;
|
|
$sa41 = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE kw='".$kw."' and jahr='".$jahr."' and typ=19 AND utyp=41 ORDER BY tour");
|
|
if($sa41['num_rows'] != 0) {
|
|
$toursumme=$toursumme+$sa41['num_rows'];
|
|
$template->assign('sa41',$sa41['num_rows']);
|
|
$sa41 = $GLOBALS['mysql']->sql("SELECT * FROM tourenliste WHERE kw='".$kw."' and jahr='".$jahr."' and typ=19 AND utyp=41 ORDER BY tour"); $key=0;
|
|
while($row = $sa41->fetch_assoc()) {
|
|
$s41[$key]['zeit']=$row['zeit'];
|
|
$s41[$key]['id']=$row['id'];
|
|
//---------- Tourarray ----------
|
|
$ta_id= array_search($row['tour'], array_column($a_touren, 'id'));
|
|
$s41[$key]['tname']=$a_touren[$ta_id]['tour'];
|
|
$s41[$key]['aktiv']=$a_touren[$ta_id]['aktiv'];
|
|
$s41[$key]['afirma']=$a_touren[$ta_id]['afirma'];
|
|
$s41[$key]['s_auto']=$a_touren[$ta_id]['s_auto'];
|
|
$s41[$key]['s_fahrer']=$a_touren[$ta_id]['s_fahrer'];
|
|
//-- MA Test
|
|
$test_ma = $GLOBALS['mysql']->query_single("SELECT * FROM planer WHERE tag='".$tag."' AND monat='".$monat."' AND jahr='".$jahr."' AND mid='".$row['fahrer']."' ");
|
|
if($test_ma['num_rows'] != 0) {
|
|
$pa_id= array_search($test_ma['grund'], array_column($a_planbz, 'id'));
|
|
if($a_planbz[$pa_id]['nichtda']==1 || $a_planbz[$pa_id]['nichtda']==8 || $a_planbz[$pa_id]['nichtda']==19) {
|
|
$s41[$key]['f_nichtda']=1;
|
|
}
|
|
}
|
|
$ma_id= array_search($row['fahrer'], array_column($a_fahrer, 'id'));
|
|
$s41[$key]['name']=$a_fahrer[$ma_id]['name'];
|
|
//-- Car Test
|
|
$test_car = $GLOBALS['mysql']->query_single("SELECT * FROM fplaner WHERE tag='".$tag."' AND monat='".$monat."' AND jahr='".$jahr."' AND fid='".$row['auto']."' ");
|
|
if($test_car['num_rows'] != 0) {
|
|
$pf_id= array_search($test_car['grund'], array_column($a_planbf, 'id'));
|
|
if($a_planbf[$pf_id]['aktiv']==0) {
|
|
$s41[$key]['c_nichtda']=1;
|
|
}
|
|
}
|
|
$aa_id= array_search($row['auto'], array_column($a_fahrzg, 'id'));
|
|
$s41[$key]['kz']=$a_fahrzg[$aa_id]['kz'];
|
|
$s41[$key]['gewicht']=$row['gewicht'];
|
|
$s41[$key]['gewicht9']=$row['gewicht9'];
|
|
$s41[$key]['amtsblatt']=$row['amtsblatt'];
|
|
$s41[$key]['exemplare']=$row['exemplare'];
|
|
if($row['gewicht3'] <1) {
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht3='".$row['gewicht']."' WHERE id='".$row['id']."'");
|
|
$row['gewicht3']=$row['gewicht'];
|
|
}
|
|
$s41[$key]['gewicht3']=$row['gewicht3'];
|
|
$s41[$key]['gewicht4']=$row['gewicht4'];
|
|
if($row['Pakete']<1) {
|
|
if($row['Norm']<1) { $row['Norm']=12; }
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET Pakete='".$row['exemplare']/$row['Norm']."' WHERE id='".$row['id']."'");
|
|
} else {
|
|
$s41[$key]['pakete']=$row['Pakete'];
|
|
$s41[$key]['pakete2']=$row['pakete2'];
|
|
}
|
|
//------------------------- Einzelgewicht
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht2='".$row['gewicht']/$row['Pakete']."' WHERE id='".$row['id']."'");
|
|
$s41[$key]['gewicht2']=$row['gewicht2'];
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht5='".$row['gewicht3']/$row['Pakete']."' WHERE id='".$row['id']."'");
|
|
$s41[$key]['gewicht5']=$row['gewicht5'];
|
|
$key++;
|
|
}
|
|
$template->assign('s41',$s41);
|
|
}
|
|
//-------------------------------------------------------------------------------------- Block 4b - 42
|
|
$toursumme=0;
|
|
$sa42 = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE kw='".$kw."' and jahr='".$jahr."' and typ=19 AND utyp=42 ORDER BY tour");
|
|
if($sa42['num_rows'] != 0) {
|
|
$toursumme=$toursumme+$sa42['num_rows'];
|
|
$template->assign('sa42',$sa42['num_rows']);
|
|
$sa42 = $GLOBALS['mysql']->sql("SELECT * FROM tourenliste WHERE kw='".$kw."' and jahr='".$jahr."' and typ=19 AND utyp=42 ORDER BY tour"); $key=0;
|
|
while($row = $sa42->fetch_assoc()) {
|
|
$s42[$key]['zeit']=$row['zeit'];
|
|
$s42[$key]['id']=$row['id'];
|
|
//---------- Tourarray ----------
|
|
$ta_id= array_search($row['tour'], array_column($a_touren, 'id'));
|
|
$s42[$key]['tname']=$a_touren[$ta_id]['tour'];
|
|
$s42[$key]['aktiv']=$a_touren[$ta_id]['aktiv'];
|
|
$s42[$key]['afirma']=$a_touren[$ta_id]['afirma'];
|
|
$s42[$key]['s_auto']=$a_touren[$ta_id]['s_auto'];
|
|
$s42[$key]['s_fahrer']=$a_touren[$ta_id]['s_fahrer'];
|
|
//-- MA Test
|
|
$test_ma = $GLOBALS['mysql']->query_single("SELECT * FROM planer WHERE tag='".$tag."' AND monat='".$monat."' AND jahr='".$jahr."' AND mid='".$row['fahrer']."' ");
|
|
if($test_ma['num_rows'] != 0) {
|
|
$pa_id= array_search($test_ma['grund'], array_column($a_planbz, 'id'));
|
|
if($a_planbz[$pa_id]['nichtda']==1 || $a_planbz[$pa_id]['nichtda']==8 || $a_planbz[$pa_id]['nichtda']==19) {
|
|
$s42[$key]['f_nichtda']=1;
|
|
}
|
|
}
|
|
$ma_id= array_search($row['fahrer'], array_column($a_fahrer, 'id'));
|
|
$s42[$key]['name']=$a_fahrer[$ma_id]['name'];
|
|
//-- Car Test
|
|
$test_car = $GLOBALS['mysql']->query_single("SELECT * FROM fplaner WHERE tag='".$tag."' AND monat='".$monat."' AND jahr='".$jahr."' AND fid='".$row['auto']."' ");
|
|
if($test_car['num_rows'] != 0) {
|
|
$pf_id= array_search($test_car['grund'], array_column($a_planbf, 'id'));
|
|
if($a_planbf[$pf_id]['aktiv']==0) {
|
|
$s42[$key]['c_nichtda']=1;
|
|
}
|
|
}
|
|
$aa_id= array_search($row['auto'], array_column($a_fahrzg, 'id'));
|
|
$s42[$key]['kz']=$a_fahrzg[$aa_id]['kz'];
|
|
$s42[$key]['gewicht']=$row['gewicht'];
|
|
$s42[$key]['gewicht9']=$row['gewicht9'];
|
|
$s42[$key]['amtsblatt']=$row['amtsblatt'];
|
|
$s42[$key]['exemplare']=$row['exemplare'];
|
|
if($row['gewicht3'] <1) {
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht3='".$row['gewicht']."' WHERE id='".$row['id']."'");
|
|
$row['gewicht3']=$row['gewicht'];
|
|
}
|
|
$s42[$key]['gewicht3']=$row['gewicht3'];
|
|
$s42[$key]['gewicht4']=$row['gewicht4'];
|
|
if($row['Pakete']<1) {
|
|
if($row['Norm']<1) { $row['Norm']=12; }
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET Pakete='".$row['exemplare']/$row['Norm']."' WHERE id='".$row['id']."'");
|
|
} else {
|
|
$s42[$key]['pakete']=$row['Pakete'];
|
|
$s42[$key]['pakete2']=$row['pakete2'];
|
|
}
|
|
//------------------------- Einzelgewicht
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht2='".$row['gewicht']/$row['Pakete']."' WHERE id='".$row['id']."'");
|
|
$s42[$key]['gewicht2']=$row['gewicht2'];
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht5='".$row['gewicht3']/$row['Pakete']."' WHERE id='".$row['id']."'");
|
|
$s42[$key]['gewicht5']=$row['gewicht5'];
|
|
$key++;
|
|
}
|
|
$template->assign('s42',$s42);
|
|
}
|
|
//-------------------------------------------------------------------------------------- Block 5a --- 51
|
|
$toursumme=0;
|
|
$sa51 = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE kw='".$kw."' and jahr='".$jahr."' and typ=19 AND utyp=51 ORDER BY tour");
|
|
if($sa51['num_rows'] != 0) {
|
|
$toursumme=$toursumme+$sa51['num_rows'];
|
|
$template->assign('sa51',$sa51['num_rows']);
|
|
$sa51 = $GLOBALS['mysql']->sql("SELECT * FROM tourenliste WHERE kw='".$kw."' and jahr='".$jahr."' and typ=19 AND utyp=51 ORDER BY tour"); $key=0;
|
|
while($row = $sa51->fetch_assoc()) {
|
|
$s51[$key]['zeit']=$row['zeit'];
|
|
$s51[$key]['id']=$row['id'];
|
|
//---------- Tourarray ----------
|
|
$ta_id= array_search($row['tour'], array_column($a_touren, 'id'));
|
|
$s51[$key]['tname']=$a_touren[$ta_id]['tour'];
|
|
$s51[$key]['aktiv']=$a_touren[$ta_id]['aktiv'];
|
|
$s51[$key]['afirma']=$a_touren[$ta_id]['afirma'];
|
|
$s51[$key]['s_auto']=$a_touren[$ta_id]['s_auto'];
|
|
$s51[$key]['s_fahrer']=$a_touren[$ta_id]['s_fahrer'];
|
|
//-- MA Test
|
|
$test_ma = $GLOBALS['mysql']->query_single("SELECT * FROM planer WHERE tag='".$tag."' AND monat='".$monat."' AND jahr='".$jahr."' AND mid='".$row['fahrer']."' ");
|
|
if($test_ma['num_rows'] != 0) {
|
|
$pa_id= array_search($test_ma['grund'], array_column($a_planbz, 'id'));
|
|
if($a_planbz[$pa_id]['nichtda']==1 || $a_planbz[$pa_id]['nichtda']==8 || $a_planbz[$pa_id]['nichtda']==19) {
|
|
$s51[$key]['f_nichtda']=1;
|
|
}
|
|
}
|
|
$ma_id= array_search($row['fahrer'], array_column($a_fahrer, 'id'));
|
|
$s51[$key]['name']=$a_fahrer[$ma_id]['name'];
|
|
//-- Car Test
|
|
$test_car = $GLOBALS['mysql']->query_single("SELECT * FROM fplaner WHERE tag='".$tag."' AND monat='".$monat."' AND jahr='".$jahr."' AND fid='".$row['auto']."' ");
|
|
if($test_car['num_rows'] != 0) {
|
|
$pf_id= array_search($test_car['grund'], array_column($a_planbf, 'id'));
|
|
if($a_planbf[$pf_id]['aktiv']==0) {
|
|
$s51[$key]['c_nichtda']=1;
|
|
}
|
|
}
|
|
$aa_id= array_search($row['auto'], array_column($a_fahrzg, 'id'));
|
|
$s51[$key]['kz']=$a_fahrzg[$aa_id]['kz'];
|
|
$s51[$key]['gewicht']=$row['gewicht'];
|
|
$s51[$key]['gewicht9']=$row['gewicht9'];
|
|
$s51[$key]['amtsblatt']=$row['amtsblatt'];
|
|
$s51[$key]['exemplare']=$row['exemplare'];
|
|
if($row['gewicht3'] <1) {
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht3='".$row['gewicht']."' WHERE id='".$row['id']."'");
|
|
$row['gewicht3']=$row['gewicht'];
|
|
}
|
|
$s51[$key]['gewicht3']=$row['gewicht3'];
|
|
$s51[$key]['gewicht4']=$row['gewicht4'];
|
|
if($row['Pakete']<1) {
|
|
if($row['Norm']<1) { $row['Norm']=12; }
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET Pakete='".$row['exemplare']/$row['Norm']."' WHERE id='".$row['id']."'");
|
|
} else {
|
|
$s51[$key]['pakete']=$row['Pakete'];
|
|
$s51[$key]['pakete2']=$row['pakete2'];
|
|
}
|
|
//------------------------- Einzelgewicht
|
|
//------------------------- Einzelgewicht
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht2='".$row['gewicht']/$row['Pakete']."' WHERE id='".$row['id']."'");
|
|
$s51[$key]['gewicht2']=$row['gewicht2'];
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht5='".$row['gewicht3']/$row['Pakete']."' WHERE id='".$row['id']."'");
|
|
$s51[$key]['gewicht5']=$row['gewicht5'];
|
|
$key++;
|
|
}
|
|
$template->assign('s51',$s51);
|
|
}
|
|
//-------------------------------------------------------------------------------------- Block 5b --- 52
|
|
$toursumme=0;
|
|
$sa52 = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE kw='".$kw."' and jahr='".$jahr."' and typ=19 AND utyp=52 ORDER BY tour");
|
|
if($sa52['num_rows'] != 0) {
|
|
$toursumme=$toursumme+$sa52['num_rows'];
|
|
$template->assign('sa52',$sa52['num_rows']);
|
|
$st52 = $GLOBALS['mysql']->sql("SELECT * FROM tourenliste WHERE kw='".$kw."' and jahr='".$jahr."' and typ=19 AND utyp=52 ORDER BY tour"); $key=0;
|
|
while($row = $st52->fetch_assoc()) {
|
|
$s52[$key]['zeit']=$row['zeit'];
|
|
$s52[$key]['id']=$row['id'];
|
|
//---------- Tourarray ----------
|
|
$ta_id= array_search($row['tour'], array_column($a_touren, 'id'));
|
|
$s52[$key]['aktiv']=$a_touren[$ta_id]['aktiv'];
|
|
$s52[$key]['tname']=$a_touren[$ta_id]['tour'];
|
|
$s52[$key]['afirma']=$a_touren[$ta_id]['afirma'];
|
|
$s52[$key]['s_auto']=$a_touren[$ta_id]['s_auto'];
|
|
$s52[$key]['s_fahrer']=$a_touren[$ta_id]['s_fahrer'];
|
|
//-- MA Test
|
|
$test_ma = $GLOBALS['mysql']->query_single("SELECT * FROM planer WHERE tag='".$tag."' AND monat='".$monat."' AND jahr='".$jahr."' AND mid='".$row['fahrer']."' ");
|
|
if($test_ma['num_rows'] != 0) {
|
|
$pa_id= array_search($test_ma['grund'], array_column($a_planbz, 'id'));
|
|
if($a_planbz[$pa_id]['nichtda']==1 || $a_planbz[$pa_id]['nichtda']==8 || $a_planbz[$pa_id]['nichtda']==19) {
|
|
$s52[$key]['f_nichtda']=1;
|
|
}
|
|
}
|
|
$ma_id= array_search($row['fahrer'], array_column($a_fahrer, 'id'));
|
|
$s52[$key]['name']=$a_fahrer[$ma_id]['name'];
|
|
//-- Car Test
|
|
$test_car = $GLOBALS['mysql']->query_single("SELECT * FROM fplaner WHERE tag='".$tag."' AND monat='".$monat."' AND jahr='".$jahr."' AND fid='".$row['auto']."' ");
|
|
if($test_car['num_rows'] != 0) {
|
|
$pf_id= array_search($test_car['grund'], array_column($a_planbf, 'id'));
|
|
if($a_planbf[$pf_id]['aktiv']==0) {
|
|
$s52[$key]['c_nichtda']=1;
|
|
}
|
|
}
|
|
$aa_id= array_search($row['auto'], array_column($a_fahrzg, 'id'));
|
|
$s52[$key]['kz']=$a_fahrzg[$aa_id]['kz'];
|
|
$s52[$key]['gewicht']=$row['gewicht'];
|
|
$s52[$key]['gewicht9']=$row['gewicht9'];
|
|
$s52[$key]['amtsblatt']=$row['amtsblatt'];
|
|
$s52[$key]['exemplare']=$row['exemplare'];
|
|
if($row['gewicht3'] <1) {
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht3='".$row['gewicht']."' WHERE id='".$row['id']."'");
|
|
$row['gewicht3']=$row['gewicht'];
|
|
}
|
|
$s52[$key]['gewicht3']=$row['gewicht3'];
|
|
$s52[$key]['gewicht4']=$row['gewicht4'];
|
|
if($row['Pakete']<1) {
|
|
if($row['Norm']<1) { $row['Norm']=12; }
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET Pakete='".$row['exemplare']/$row['Norm']."' WHERE id='".$row['id']."'");
|
|
} else {
|
|
$s52[$key]['pakete']=$row['Pakete'];
|
|
$s52[$key]['pakete2']=$row['pakete2'];
|
|
}
|
|
//------------------------- Einzelgewicht
|
|
//------------------------- Einzelgewicht
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht2='".$row['gewicht']/$row['Pakete']."' WHERE id='".$row['id']."'");
|
|
$s52[$key]['gewicht2']=$row['gewicht2'];
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht5='".$row['gewicht3']/$row['Pakete']."' WHERE id='".$row['id']."'");
|
|
$s52[$key]['gewicht5']=$row['gewicht5'];
|
|
$key++;
|
|
}
|
|
$template->assign('s52',$s52);
|
|
}
|
|
//--------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------
|
|
// echo "<pre>"; print_r($ssz); echo "</pre>";
|
|
//-----------------------------------------------
|
|
//$tourplus = $GLOBALS['mysql']->query_array("SELECT * FROM touren WHERE typ=19 and aktiv=0 ORDER BY id");
|
|
$plus_tour = $GLOBALS['mysql']->sql("SELECT * FROM touren WHERE typ=19 and aktiv=0 ORDER BY id"); $key=0;
|
|
while($row = $plus_tour->fetch_assoc()) {
|
|
$test = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE kw='".$kw."' and jahr='".$jahr."' and tour='".$row['id']."' ");
|
|
if($test['num_rows'] == 0) {
|
|
$tourplus[$key]['id']=$row['id'];
|
|
$tourplus[$key]['tour']=$row['tour'];
|
|
$tourplus[$key]['tour2']=$row['tour2'];
|
|
$tourplus[$key]['tour3']=$row['tour3'];
|
|
$key++;
|
|
}
|
|
|
|
}
|
|
//-----------------------------------------------
|
|
$template->assign('tourplus', $tourplus);
|
|
$template->assign('normtest', $normtest);
|
|
$template->assign('jahr', $jahr);
|
|
$template->assign('kw', $kw);
|
|
$datum=$tag.".".$monat.".".$jahr; $template->assign('datum',$datum);
|
|
$template->assign('saso_tour2', $saso_tour2);
|
|
$template->assign('ssz', $ssz);
|
|
$template->assign('content', 'tpl/iss.tpl');
|
|
?>
|