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

474 lines
No EOL
22 KiB
PHP

<?php
// echo'<pre>'; print_r($row_nichtda); echo'</pre>';
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
//-------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------- Baustellen
} else {
//-------------------------------------------------------------------------------------------------------------
if($wochentag==4 || $wochentag==5 || $wochentag==6 || $wochentag==0) {//------------------------- donnerstag bis Sonntag Saso laden
//---------------------------------------- 1, teil bis 0 Uhr
$ss = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr."' and typ=19");
$pl2 = $GLOBALS['mysql']->query("SELECT * FROM planer WHERE tag='".$ss['tag']."' AND monat='".$ss['monat']."' AND jahr='".$ss['jahr']."'");
$fpl2= $GLOBALS['mysql']->query("SELECT * FROM fplaner WHERE tag='".$ss['tag']."' AND monat='".$ss['monat']."' AND jahr='".$ss['jahr']."'");
$saso_tour = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr."' and typ=19 ORDER BY zeit");
while($row = $saso_tour->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'));
$feintrag=0; $autonichtda=0;
$saso_tour1[$key]['aktiv']=$a_touren[$ta_id]['aktiv'];
$saso_tour1[$key]['tour']=$a_touren[$ta_id]['tour'];
$saso_tour1[$key]['auto']=$a_fahrzg[$aa_id]['kz'];
$saso_tour1[$key]['fahrer']=$a_fahrer[$ma_id]['name'];
$saso_tour1[$key]['time']=$row['time'];
$saso_tour1[$key]['info']=$a_touren[$ta_id]['infotitel'];
$saso_tour1[$key]['lock']=$row['fertig'];
$saso_tour1[$key]['gewicht']=$row['gewicht'];
$saso_tour1[$key]['gewicht3']=$row['gewicht3'];
$saso_tour1[$key]['gewicht4']=$row['gewicht4'];
//$saso_tour1[$key]['gewicht3']=ceil($row['gewicht2']*$row['pakete2']);
//$saso_tour1[$key]['rampe']=$row['rampe'];
$saso_tour1[$key]['smsstatus']=$row['smsstatus'];
//--------------------------------------------------------------------------
//--------------------------------- 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
//----------
$saso_tour1[$key]['fahrernichtda']=$feintrag;
$saso_tour1[$key]['autonichtda']=$autonichtda;
if ($row['tour']<20000) { $sasonorm=$row['Norm']; }
$sasoinfo=$row['tag'].".".$row['monat'].".".$row['jahr'];
$key++;
}
$sasoanzeige=1;
$template->assign('saso_tour1',$saso_tour1);
$template->assign('sasoanzeige',$sasoanzeige);
$template->assign('sasoinfo',$sasoinfo);
$template->assign('sasonorm',$sasonorm);
//-----------------------------------------------------------
//----------- Saso Zusatz -----------------------------------
//-----------------------------------------------------------
}
//-------------------------------------------------------------------------------------------------------------
if($wochentag==1 || $wochentag==2 || $wochentag==3) {//------------------------- Dienstag und Mittwoch rundschau laden
$rs = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr."' and typ=7 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=7 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'];
$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]['lock']=$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=7 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=7 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]['lock']=$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++;
if ($row['tour']<880) { $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=7 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=7 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]['lock']=$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++;
if ($row['tour']<880) { $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=7 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=7 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]['lock']=$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++;
if ($row['tour']<880) { $rsnorm4=$row['Norm']; }
}
$template->assign('rs_tour4',$rs_tour4);
$template->assign('rsanzeige4',1);
$template->assign('rsinfo4',$rsinfo4);
$template->assign('rsnorm4',$rsnorm4);
}
//-----------------------------------------------------
//-----------------------------------------------------
//------------- ende rundschau ----------------------
}
//-----------------------------------------------------
if($wochentag==5 && date('G')<20 || $wochentag==4) {// 4 ------------------------- Donnerstag bis Freitag laden -
//-------------------------------- Werbung land
$wb2 = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr."' and typ=14 ORDER BY zeit");
if($wb2['num_rows'] > 0) {
$pl2 = $GLOBALS['mysql']->query("SELECT * FROM planer WHERE tag='".$wb2['tag']."' AND monat='".$wb2['monat']."' AND jahr='".$wb2['jahr']."'");
$fpl2= $GLOBALS['mysql']->query("SELECT * FROM fplaner WHERE tag='".$wb2['tag']."' AND monat='".$wb2['monat']."' AND jahr='".$wb2['jahr']."'");
$rs = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr."' and typ=14 ORDER BY zeit"); $key=0;
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'));
$werb2[$key]['aktiv']=$a_touren[$ta_id]['aktiv'];
$werb2[$key]['tour']=$a_touren[$ta_id]['tour'];
$werb2[$key]['auto']=$a_fahrzg[$aa_id]['kz'];
$werb2[$key]['fahrer']=$a_fahrer[$ma_id]['name'];
$werb2[$key]['info']=$a_touren[$ta_id]['infotitel'];
$werb2[$key]['time']=$row['time'];
$werb2[$key]['fahrer_id']=$row['fahrer'];
$werb2[$key]['lock']=$row['fertig'];
$werb2[$key]['gewicht']=$row['gewicht'];
$werb2[$key]['gewicht4']=$row['gewicht4'];
$werb2[$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
//----------
$werb2[$key]['smsstatus']=$row['smsstatus'];
$rsinfo4=$row['tag'].".".$row['monat'].".".$row['jahr'];
$werb2[$key]['fahrernichtda']=$feintrag;
$werb2[$key]['autonichtda']=$autonichtda;
$exxtrainfo=$row['tag'].".".$row['monat'].".".$row['jahr'];
$key++;
$rsnorm=$row['Norm'];
}
$template->assign('werb2',$werb2);
$template->assign('exxtraanzeige2',1);
}
//-------------------------------- Werbung stadt
$wb3 = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr."' and typ=11 ORDER BY zeit");
if($wb3['num_rows'] > 0) {
$pl2 = $GLOBALS['mysql']->query("SELECT * FROM planer WHERE tag='".$wb3['tag']."' AND monat='".$wb3['monat']."' AND jahr='".$wb3['jahr']."'");
$fpl2= $GLOBALS['mysql']->query("SELECT * FROM fplaner WHERE tag='".$wb3['tag']."' AND monat='".$wb3['monat']."' AND jahr='".$wb3['jahr']."'");
$rs = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr."' and typ=11 ORDER BY zeit"); $key=0;
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'));
$werb3[$key]['aktiv']=$a_touren[$ta_id]['aktiv'];
$werb3[$key]['tour']=$a_touren[$ta_id]['tour'];
$werb3[$key]['auto']=$a_fahrzg[$aa_id]['kz'];
$werb3[$key]['fahrer']=$a_fahrer[$ma_id]['name'];
$werb3[$key]['info']=$a_touren[$ta_id]['infotitel'];
$werb3[$key]['time']=$row['time'];
$werb3[$key]['fahrer_id']=$row['fahrer'];
$werb3[$key]['lock']=$row['fertig'];
$werb3[$key]['gewicht']=$row['gewicht'];
$werb3[$key]['gewicht4']=$row['gewicht4'];
$werb3[$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
//----------
$werb3[$key]['smsstatus']=$row['smsstatus'];
$rsinfo4=$row['tag'].".".$row['monat'].".".$row['jahr'];
$werb3[$key]['fahrernichtda']=$feintrag;
$werb3[$key]['autonichtda']=$autonichtda;
$exxtrainfo=$row['tag'].".".$row['monat'].".".$row['jahr'];
$key++;
$rsnorm=$row['Norm'];
}
$template->assign('werb3',$werb3);
$template->assign('exxtraanzeige3',1);
$template->assign('exxtrainfo',$exxtrainfo);
// $template->assign('rsnorm1',$rsnorm1);
}
}
}
$template->assign('kw', $kw_aktuell);
$template->assign('content', 'tpl/ajax/pi_werbung4.tpl');
?>