'; print_r($row_nichtda); echo''; error_reporting(E_ALL); ini_set('display_errors',0); header('Content-Type: text/html; charset=utf-8'); //----------------------------------------------------- $wochentag=date('w'); $jahr = (int)date('Y'); $kw_aktuell = (int)date('W'); //----------------------------------------------------- //----------------------------------------------------- //-------------------- wiederkehrende abfragen ------------------------------------------------- $a_touren = $GLOBALS['a_touren']; $a_fahrzg = $GLOBALS['a_fahrzg']; $a_fahrer = $GLOBALS['a_fahrer']; $a_planbz = $GLOBALS['a_planbz']; $a_planbf = $GLOBALS['a_planbf']; //----------------------------------------------------- //----------------------------------------------------- //----------------------------------------------------- $anlage = $GLOBALS['mysql']->query_single("SELECT * FROM kartenlog ORDER BY logID DESC LIMIT 1"); $anz=0; if(time()-$anlage['zeit']<90) { //80 //------------------------------------------------------------------------------------------------------------- } else { //-------- Sachsen-Sonntag 2019 neu ----------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------- if($wochentag==4 || $wochentag==5 || $wochentag==6 || $wochentag==0) { //------------------------- donnerstag bis Sonntag Saso laden //-------------------------------------------------------------------------------------------------------------------------------------- //---------------------------------------- Halle Block $key=0; $saso_tour = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr."' and typ=19 AND utyp=9 ORDER BY tour"); while($row = $saso_tour->fetch_assoc()) { $saso_tour1[$key]['binfo']='Block: '.$row['utyp'].' geplant: '.$row['zeit']." Uhr"; $wechsel=$row['utyp']; $ta_id= array_search($row['tour'], array_column($a_touren, 'id')); $aa_id= array_search($row['auto'], array_column($a_fahrzg, 'id')); $ma_id= array_search($row['fahrer'], array_column($a_fahrer, 'id')); $saso_tour1[$key]['start']=$key; $saso_tour1[$key]['aktiv']=$a_touren[$ta_id]['aktiv']; $saso_tour1[$key]['tour']=$a_touren[$ta_id]['tour3']; $saso_tour1[$key]['auto']=$a_fahrzg[$aa_id]['kz']; $saso_tour1[$key]['status']=$row['status']; $saso_tour1[$key]['fahrerid']=$row['fahrer']; $saso_tour1[$key]['autoid']=$row['auto']; $saso_tour1[$key]['fahrer']=$a_fahrer[$ma_id]['name']; $saso_tour1[$key]['look']=$row['fertig']; $saso_tour1[$key]['gewicht']=$row['gewicht']; $saso_tour1[$key]['gewicht4']=$row['gewicht4']; $sasonorm=$row['Norm']; $key++; } $template->assign('saso_tour9',$saso_tour1); $template->assign('sasoanzeige',$key); $template->assign('sasonorm',$sasonorm); //----------------------------------------------------------- //--------------------------------------- Block 1 - 4 ------- //----------------------------------------------------------- $wechsel=0; $key=0; unset($saso_tour1); $saso_tour = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr."' and typ=19 AND utyp in (1,2,3,4) ORDER BY utyp,tour"); while($row = $saso_tour->fetch_assoc()) { if ($key==0) { $wechsel=$row['utyp']; } $saso_tour1[$key]['binfo']='Block: '.$row['utyp'].' geplant: '.$row['zeit']." Uhr"; if ($wechsel==$row['utyp']) { $saso_tour1[$key]['wechsel']=0; } else { $saso_tour1[$key]['wechsel']=1; } $wechsel=$row['utyp']; $ta_id= array_search($row['tour'], array_column($a_touren, 'id')); $aa_id= array_search($row['auto'], array_column($a_fahrzg, 'id')); $ma_id= array_search($row['fahrer'], array_column($a_fahrer, 'id')); $saso_tour1[$key]['start']=$key; $saso_tour1[$key]['status']=$row['status']; $saso_tour1[$key]['aktiv']=$a_touren[$ta_id]['aktiv']; $saso_tour1[$key]['tour']=$a_touren[$ta_id]['tour3']; $saso_tour1[$key]['auto']=$a_fahrzg[$aa_id]['kz']; $saso_tour1[$key]['fahrerid']=$row['fahrer']; $saso_tour1[$key]['autoid']=$row['auto']; $saso_tour1[$key]['fahrer']=$a_fahrer[$ma_id]['name']; $saso_tour1[$key]['look']=$row['fertig']; $saso_tour1[$key]['gewicht']=$row['gewicht']; $saso_tour1[$key]['gewicht4']=$row['gewicht4']; $sasonorm=$row['Norm']; $key++; } $template->assign('saso_tour1',$saso_tour1); $template->assign('sasoanzeige',$key); $template->assign('sasonorm',$sasonorm); //----------------------------------------------------------- //--------------------------------------- Block 5 - 8 ------- //----------------------------------------------------------- $wechsel=0; $key=0; unset($saso_tour1); $saso_tour = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr."' and typ=19 AND utyp in (5,6,7,8,99) ORDER BY utyp,tour"); while($row = $saso_tour->fetch_assoc()) { if ($key==0) { $wechsel=$row['utyp']; } $saso_tour1[$key]['binfo']='Block: '.$row['utyp'].' geplant: '.$row['zeit']." Uhr"; if ($wechsel==$row['utyp']) { $saso_tour1[$key]['wechsel']=0; } else { $saso_tour1[$key]['wechsel']=1; } $wechsel=$row['utyp']; $ta_id= array_search($row['tour'], array_column($a_touren, 'id')); $aa_id= array_search($row['auto'], array_column($a_fahrzg, 'id')); $ma_id= array_search($row['fahrer'], array_column($a_fahrer, 'id')); $saso_tour1[$key]['start']=$key; $saso_tour1[$key]['status']=$row['status']; $saso_tour1[$key]['aktiv']=$a_touren[$ta_id]['aktiv']; $saso_tour1[$key]['tour']=$a_touren[$ta_id]['tour3']; $saso_tour1[$key]['auto']=$a_fahrzg[$aa_id]['kz']; $saso_tour1[$key]['fahrerid']=$row['fahrer']; $saso_tour1[$key]['autoid']=$row['auto']; $saso_tour1[$key]['fahrer']=$a_fahrer[$ma_id]['name']; $saso_tour1[$key]['look']=$row['fertig']; $saso_tour1[$key]['gewicht']=$row['gewicht']; $saso_tour1[$key]['gewicht4']=$row['gewicht4']; $sasodate=$row['tag'].".".$row['monat'].".".$row['jahr']; $sasonorm=$row['Norm']; $key++; } $template->assign('saso_tour2',$saso_tour1); $template->assign('sasoanzeige',$key); $template->assign('sasodate',$sasodate); $template->assign('sasonorm',$sasonorm); } //------------------------------------------------------------------------------------------------------------- if($wochentag==1 || $wochentag==2 || $wochentag==3) {//------------------------- Dienstag und Mittwoch Kaufland laden $rs = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr."' and typ=13 AND utyp=1 ORDER BY zeit"); if($rs['num_rows'] > 0) { $key=0; $pl2 = $GLOBALS['mysql']->query("SELECT * FROM planer WHERE tag='".$rs['tag']."' AND monat='".$rs['monat']."' AND jahr='".$rs['jahr']."'"); $fpl2= $GLOBALS['mysql']->query("SELECT * FROM fplaner WHERE tag='".$rs['tag']."' AND monat='".$rs['monat']."' AND jahr='".$rs['jahr']."'"); $rs1 = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr."' and typ=13 AND utyp=1 ORDER BY zeit"); while($row = $rs1->fetch_assoc()) { $ta_id= array_search($row['tour'], array_column($a_touren, 'id')); $aa_id= array_search($row['auto'], array_column($a_fahrzg, 'id')); $ma_id= array_search($row['fahrer'], array_column($a_fahrer, 'id')); $rs_tour1[$key]['aktiv']=$a_touren[$ta_id]['aktiv']; $saso_tour1[$key]['start']=$key; $rs_tour1[$key]['tour']=$a_touren[$ta_id]['tour']; $rs_tour1[$key]['auto']=$a_fahrzg[$aa_id]['kz']; $rs_tour1[$key]['fahrer']=$a_fahrer[$ma_id]['name']; $rs_tour1[$key]['info']=$a_touren[$ta_id]['infotitel']; $rs_tour1[$key]['time']=$row['time']; $rs_tour1[$key]['fahrer_id']=$row['fahrer']; $rs_tour1[$key]['look']=$row['fertig']; $rs_tour1[$key]['gewicht']=$row['gewicht']; $feintrag=0; $autonichtda=0; //--------------------------------- Personalabfrage while($a_pl2 = $pl2->fetch_assoc()) { if($a_pl2['mid']==$row['fahrer']) { $pa_id= array_search($a_pl2['grund'], array_column($a_planbz, 'id')); if($a_planbz['nichtda']==1) { $feintrag=1; } else { if($a_planbz['nichtda']==$row['typ']) { $feintrag=1; } } } } if($feintrag==0) { if($row['fahrer']!=$a_touren[$ta_id]['s_fahrer']) { $feintrag=2; }} if($row['fahrer']==0) { $feintrag=1; } //-- fahrer nicht ausgewaehlt //----------- auto while($a_fpl2 = $fpl2->fetch_assoc()) { if($a_fpl2['fid']==$row['auto']) { $autonichtda=1; } else { if($row['auto']!=$a_touren[$ta_id]['s_auto']) { $autonichtda=2; } } } if($row['auto']==0) { $autonichtda=1; } //-- Auto nicht ausgewaehlt //---------- $rs_tour1[$key]['smsstatus']=$row['smsstatus']; $rsinfo1=$row['tag'].".".$row['monat'].".".$row['jahr']; $rs_tour1[$key]['fahrernichtda']=$feintrag; $rs_tour1[$key]['autonichtda']=$autonichtda; $key++; if ($row['tour']<880) { $rsnorm1=$row['Norm']; } } $template->assign('rs_tour1',$rs_tour1); $template->assign('rsanzeige1',1); $template->assign('rsinfo1',$rsinfo1); $template->assign('rsnorm1',$rsnorm1); } //------------------------------------------------------------------------------------------------------------- $rs = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr."' and typ=13 AND utyp=2 ORDER BY zeit"); if($rs['num_rows'] > 0) { $key=0; $pl2 = $GLOBALS['mysql']->query("SELECT * FROM planer WHERE tag='".$rs['tag']."' AND monat='".$rs['monat']."' AND jahr='".$rs['jahr']."'"); $fpl2= $GLOBALS['mysql']->query("SELECT * FROM fplaner WHERE tag='".$rs['tag']."' AND monat='".$rs['monat']."' AND jahr='".$rs['jahr']."'"); $rs2 = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr."' and typ=13 AND utyp=2 ORDER BY zeit"); while($row = $rs2->fetch_assoc()) { $ta_id= array_search($row['tour'], array_column($a_touren, 'id')); $aa_id= array_search($row['auto'], array_column($a_fahrzg, 'id')); $ma_id= array_search($row['fahrer'], array_column($a_fahrer, 'id')); $rs_tour2[$key]['aktiv']=$a_touren[$ta_id]['aktiv']; $rs_tour2[$key]['tour']=$a_touren[$ta_id]['tour']; $rs_tour2[$key]['auto']=$a_fahrzg[$aa_id]['kz']; $rs_tour2[$key]['fahrer']=$a_fahrer[$ma_id]['name']; $rs_tour2[$key]['info']=$a_touren[$ta_id]['infotitel']; $rs_tour2[$key]['time']=$row['time']; $rs_tour2[$key]['fahrer_id']=$row['fahrer']; $rs_tour2[$key]['look']=$row['fertig']; $rs_tour2[$key]['gewicht']=$row['gewicht']; $feintrag=0; $autonichtda=0; //--------------------------------- Personalabfrage while($a_pl2 = $pl2->fetch_assoc()) { if($a_pl2['mid']==$row['fahrer']) { $pa_id= array_search($a_pl2['grund'], array_column($a_planbz, 'id')); if($a_planbz['nichtda']==1) { $feintrag=1; } else { if($a_planbz['nichtda']==$row['typ']) { $feintrag=1; } } } } if($feintrag==0) { if($row['fahrer']!=$a_touren[$ta_id]['s_fahrer']) { $feintrag=2; }} if($row['fahrer']==0) { $feintrag=1; } //-- fahrer nicht ausgewaehlt //----------- auto while($a_fpl2 = $fpl2->fetch_assoc()) { if($a_fpl2['fid']==$row['auto']) { $autonichtda=1; } else { if($row['auto']!=$a_touren[$ta_id]['s_auto']) { $autonichtda=2; } } } if($row['auto']==0) { $autonichtda=1; } //-- Auto nicht ausgewaehlt //---------- $rs_tour2[$key]['smsstatus']=$row['smsstatus']; $rsinfo2=$row['tag'].".".$row['monat'].".".$row['jahr']; $rs_tour2[$key]['fahrernichtda']=$feintrag; $rs_tour2[$key]['autonichtda']=$autonichtda; $key++; $rsnorm2=$row['Norm']; } $template->assign('rs_tour2',$rs_tour2); $template->assign('rsanzeige2',1); $template->assign('rsinfo2',$rsinfo2); $template->assign('rsnorm2',$rsnorm2); } //------------------------------------------------------------------------------------------------------------- $rs = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr."' and typ=13 AND utyp=3 ORDER BY zeit"); if($rs['num_rows'] > 0) { $key=0; $pl2 = $GLOBALS['mysql']->query("SELECT * FROM planer WHERE tag='".$rs['tag']."' AND monat='".$rs['monat']."' AND jahr='".$rs['jahr']."'"); $fpl2= $GLOBALS['mysql']->query("SELECT * FROM fplaner WHERE tag='".$rs['tag']."' AND monat='".$rs['monat']."' AND jahr='".$rs['jahr']."'"); $rs = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr."' and typ=13 AND utyp=3 ORDER BY zeit"); while($row = $rs->fetch_assoc()) { $ta_id= array_search($row['tour'], array_column($a_touren, 'id')); $aa_id= array_search($row['auto'], array_column($a_fahrzg, 'id')); $ma_id= array_search($row['fahrer'], array_column($a_fahrer, 'id')); $rs_tour3[$key]['aktiv']=$a_touren[$ta_id]['aktiv']; $rs_tour3[$key]['tour']=$a_touren[$ta_id]['tour']; $rs_tour3[$key]['auto']=$a_fahrzg[$aa_id]['kz']; $rs_tour3[$key]['fahrer']=$a_fahrer[$ma_id]['name']; $rs_tour3[$key]['info']=$a_touren[$ta_id]['infotitel']; $rs_tour3[$key]['time']=$row['time']; $rs_tour3[$key]['fahrer_id']=$row['fahrer']; $rs_tour3[$key]['look']=$row['fertig']; $rs_tour3[$key]['gewicht']=$row['gewicht']; $feintrag=0; $autonichtda=0; //--------------------------------- Personalabfrage while($a_pl2 = $pl2->fetch_assoc()) { if($a_pl2['mid']==$row['fahrer']) { $pa_id= array_search($a_pl2['grund'], array_column($a_planbz, 'id')); if($a_planbz['nichtda']==1) { $feintrag=1; } else { if($a_planbz['nichtda']==$row['typ']) { $feintrag=1; } } } } if($feintrag==0) { if($row['fahrer']!=$a_touren[$ta_id]['s_fahrer']) { $feintrag=2; }} if($row['fahrer']==0) { $feintrag=1; } //-- fahrer nicht ausgewaehlt //----------- auto while($a_fpl2 = $fpl2->fetch_assoc()) { if($a_fpl2['fid']==$row['auto']) { $autonichtda=1; } else { if($row['auto']!=$a_touren[$ta_id]['s_auto']) { $autonichtda=2; } } } if($row['auto']==0) { $autonichtda=1; } //-- Auto nicht ausgewaehlt //---------- $rs_tour3[$key]['smsstatus']=$row['smsstatus']; $rsinfo3=$row['tag'].".".$row['monat'].".".$row['jahr']; $rs_tour3[$key]['fahrernichtda']=$feintrag; $rs_tour3[$key]['autonichtda']=$autonichtda; $key++; $rsnorm3=$row['Norm']; } $template->assign('rs_tour3',$rs_tour3); $template->assign('rsanzeige3',1); $template->assign('rsinfo3',$rsinfo3); $template->assign('rsnorm3',$rsnorm3); } //------------------------------------------------------------------------------------------------------------- $rs = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr."' and typ=13 AND utyp=4 ORDER BY zeit"); if($rs['num_rows'] > 0) { $key=0; $pl2 = $GLOBALS['mysql']->query("SELECT * FROM planer WHERE tag='".$rs['tag']."' AND monat='".$rs['monat']."' AND jahr='".$rs['jahr']."'"); $fpl2= $GLOBALS['mysql']->query("SELECT * FROM fplaner WHERE tag='".$rs['tag']."' AND monat='".$rs['monat']."' AND jahr='".$rs['jahr']."'"); $rs = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr."' and typ=13 AND utyp=4 ORDER BY zeit"); while($row = $rs->fetch_assoc()) { $ta_id= array_search($row['tour'], array_column($a_touren, 'id')); $aa_id= array_search($row['auto'], array_column($a_fahrzg, 'id')); $ma_id= array_search($row['fahrer'], array_column($a_fahrer, 'id')); $rs_tour4[$key]['aktiv']=$a_touren[$ta_id]['aktiv']; $rs_tour4[$key]['tour']=$a_touren[$ta_id]['tour']; $rs_tour4[$key]['auto']=$a_fahrzg[$aa_id]['kz']; $rs_tour4[$key]['fahrer']=$a_fahrer[$ma_id]['name']; $rs_tour4[$key]['info']=$a_touren[$ta_id]['infotitel']; $rs_tour4[$key]['time']=$row['time']; $rs_tour4[$key]['fahrer_id']=$row['fahrer']; $rs_tour4[$key]['look']=$row['fertig']; $rs_tour4[$key]['gewicht']=$row['gewicht']; $rs_tour4[$key]['gewicht4']=$row['gewicht4']; $rs_tour4[$key]['gewicht3']=ceil($row['gewicht2']*$row['pakete2']); $feintrag=0; $autonichtda=0; //--------------------------------- Personalabfrage while($a_pl2 = $pl2->fetch_assoc()) { if($a_pl2['mid']==$row['fahrer']) { $pa_id= array_search($a_pl2['grund'], array_column($a_planbz, 'id')); if($a_planbz['nichtda']==1) { $feintrag=1; } else { if($a_planbz['nichtda']==$row['typ']) { $feintrag=1; } } } } if($feintrag==0) { if($row['fahrer']!=$a_touren[$ta_id]['s_fahrer']) { $feintrag=2; }} if($row['fahrer']==0) { $feintrag=1; } //-- fahrer nicht ausgewaehlt //----------- auto while($a_fpl2 = $fpl2->fetch_assoc()) { if($a_fpl2['fid']==$row['auto']) { $autonichtda=1; } else { if($row['auto']!=$a_touren[$ta_id]['s_auto']) { $autonichtda=2; } } } if($row['auto']==0) { $autonichtda=1; } //-- Auto nicht ausgewaehlt //---------- $rs_tour4[$key]['smsstatus']=$row['smsstatus']; $rsinfo4=$row['tag'].".".$row['monat'].".".$row['jahr']; $rs_tour4[$key]['fahrernichtda']=$feintrag; $rs_tour4[$key]['autonichtda']=$autonichtda; $key++; $rsnorm4=$row['Norm']; } $template->assign('rs_tour4',$rs_tour4); $template->assign('rsanzeige4',1); $template->assign('rsinfo4',$rsinfo4); $template->assign('rsnorm4',$rsnorm4); } //----------------------------------------------------- //----------------------------------------------------- //------------- ende rundschau ---------------------- } //----------------------------------------------------- } $template->assign('kw', $kw_aktuell); $template->assign('content', 'tpl/ajax/pi_werbung3.tpl'); ?>