99 lines
No EOL
4.6 KiB
PHP
99 lines
No EOL
4.6 KiB
PHP
<?php
|
|
|
|
//echo'<pre>'; print_r($row); echo'</pre>';
|
|
//-------------------------- wichtige noch zu bearbeitende Änderungen !!!!!!!!!!! --------- HEUTE
|
|
$tp1 = strtotime("+0 day");
|
|
$tag = date("d",$tp1);
|
|
$monat = date("m",$tp1);
|
|
$jahr = date("Y",$tp1);
|
|
|
|
//-------------------- 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'];
|
|
|
|
//----------------------------------------------------------------------------------------------
|
|
$key=0; $noplan=0; $fertig=0; $summe=0; $tsumme=0; $oksumme=0; $fsumme=0; $aktiv=0; $anzeige=0;
|
|
$db=$GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE tag='".$tag."' and monat='".$monat."' and jahr='".$jahr."' ORDER BY typ,tour");
|
|
while($row = $db->fetch_assoc()) {
|
|
//----------------------------------------------------------------------------------------------
|
|
//----------------------------- fest-array daten
|
|
$ma_id= array_search($row['fahrer'],array_column($a_fahrer, 'id'));
|
|
$ta_id= array_search($row['tour'], array_column($a_touren, 'id'));
|
|
$aa_id= array_search($row['auto'], array_column($a_fahrzg, 'id'));
|
|
$tsumme++;
|
|
//-----------------------------Fehlerhafte SMS
|
|
if($row['smsstatus']>0 && $row['smsstatus']!=2) {
|
|
$tsms[$key]['name'] = $a_fahrer[$ma_id]['name'];
|
|
$tsms[$key]['tour'] = $a_touren[$ta_id]['tour'];
|
|
$tsms[$key]['smsstatus'] = $row['smsstatus']; $summe++;
|
|
if($row['smsstatus']==1) { $tsms[$key]['typ']=1; } // am Senden
|
|
if($row['smsstatus'] >2) { $tsms[$key]['typ']=2; }
|
|
}
|
|
if($row['smsstatus']==2) { $oksumme++; }
|
|
//----------------------------------------------------------------------------------------------
|
|
//----------------------------------------------------------------- Fehler Fahrer
|
|
//----------------------------- kein Fahrer geplant
|
|
if($row['fahrer']==0) {
|
|
$fahrer[$key]['name'] = $a_fahrer[$ma_id]['name'];
|
|
$fahrer[$key]['tour'] = $a_touren[$ta_id]['tour'];
|
|
$fsumme++;
|
|
}
|
|
//----------------------------- Fahrer-Kalender prüfen
|
|
$row_nichtda = $GLOBALS['mysql']->query_single("SELECT * FROM planer WHERE mid='".$row['fahrer']."' AND tag='".$tag."' AND monat='".$monat."' AND jahr='".$jahr."'");
|
|
if($row_nichtda['num_rows'] != 0) {
|
|
$ptemp=$row_nichtda['grund']; $pa_id= array_search($ptemp, array_column($a_planbz, 'id'));
|
|
//------------------------------ komplett nicht da
|
|
if($a_planbz[$pa_id]['nichtda']== 1) {
|
|
$fahrer[$key]['name'] = $a_fahrer[$ma_id]['name'];
|
|
$fahrer[$key]['tour'] = $a_touren[$ta_id]['tour'];
|
|
$fsumme++;
|
|
}
|
|
//------------------------------ einzelne bereiche nicht da / nicht verfügbar
|
|
if($row['typ']==3 || $row['typ']==4 || $row['typ']==5) {
|
|
if($a_planbz[$pa_id]['nichtda']==88) { // ---- keine N8-Tour
|
|
$fahrer[$key]['name'] = $a_fahrer[$ma_id]['name'];
|
|
$fahrer[$key]['tour'] = $a_touren[$ta_id]['tour'];
|
|
$fsumme++;
|
|
}
|
|
}
|
|
//---------------------- Tourentyp nicht verfügbar
|
|
if($a_planbz[$pa_id]['nichtda']==$row['typ']) {
|
|
$fahrer[$key]['name'] = $a_fahrer[$ma_id]['name'];
|
|
$fahrer[$key]['tour'] = $a_touren[$ta_id]['tour'];
|
|
$fsumme++;
|
|
}
|
|
}
|
|
//----------------------------------------------------------------------------------------------
|
|
//----------------------------------------------------------------- Fehler Fahrzeug
|
|
//----------------------------- kein Fahrzeug geplant
|
|
if($row['auto']==0) {
|
|
$auto[$key]['kz'] = $a_touren[$ta_id]['tour']; $fsumme++;
|
|
}
|
|
//------------------------------ Fahrzeug nicht da
|
|
$row_fnichtda = $GLOBALS['mysql']->query_single("SELECT * FROM fplaner WHERE fid='".$row['auto']."' AND tag='".$tag."' AND monat='".$monat."' AND jahr='".$jahr."'");
|
|
if($row_fnichtda['num_rows'] != 0) {
|
|
$ftemp=$row_fnichtda['grund'];
|
|
$fa_id= array_search($ftemp, array_column($a_planbf, 'id'));
|
|
if($a_planbf[$fa_id]['aktiv']<2) {
|
|
$auto[$key]['kz'] = $a_fahrzg[$aa_id]['kz']; $fsumme++;
|
|
}
|
|
}
|
|
$key++;
|
|
}
|
|
$esumme=$tsumme-$oksumme;
|
|
if (isset($summe)) { $template->assign('summe', $summe); }
|
|
if (isset($oksumme)) { $template->assign('oksumme', $oksumme); }
|
|
if (isset($tsumme)) { $template->assign('tsumme', $tsumme); }
|
|
if (isset($esumme)) { $template->assign('esumme', ($esumme)); }
|
|
if (isset($fsumme)) { $template->assign('fsumme', ($fsumme)); }
|
|
if (isset($tsms)) { $template->assign('sms', $tsms); }
|
|
if (isset($auto)) { $template->assign('auto', $auto); }
|
|
if (isset($fahrer)) { $template->assign('fahrer', $fahrer); }
|
|
|
|
//--------------------------------------------
|
|
|
|
$template->assign('content', 'tpl/ajax/ue_info_heute.tpl');
|
|
?>
|