141 lines
No EOL
7.6 KiB
PHP
141 lines
No EOL
7.6 KiB
PHP
<?php
|
|
$_SESSION['m1']=8; $_SESSION['m2']=0;
|
|
error_reporting(E_ALL); ini_set('display_errors',0);
|
|
//-----------------------------------------------------------------------------------------------------------------
|
|
//-------------------------------- Kalender Fahrzeuge aktueller Monat + nächster Monat ----------------------------
|
|
//-----------------------------------------------------------------------------------------------------------------
|
|
$jahr = date('Y'); $monat = date('m'); $key=0;
|
|
$jahr1 = $jahr; $monat1 = $monat+1;
|
|
if($monat1==13) { $jahr1++; $monat1=1; }
|
|
//---- aktueller Monat
|
|
$kalender1 = $GLOBALS['mysql']->query("SELECT * FROM fplaner WHERE monat='".$monat."' AND jahr='".$jahr."' ORDER BY tag");
|
|
while($row = $kalender1->fetch_assoc()) {
|
|
$row_fahrerx = $GLOBALS['mysql']->query_single("SELECT * FROM fahrzeuge WHERE id='".$row['fid']."'");
|
|
$maf1[$key]['fahrer']=$row_fahrerx['kz'];
|
|
// $maf1[$key]['time']=$row['timestamp'];
|
|
$maf1[$key]['time']= mktime(0, 0, 0,$row['monat'],$row['tag'],$row['jahr']);
|
|
$row_icon = $GLOBALS['mysql']->query_single("SELECT * FROM fplaner_bez WHERE id='".$row['grund']."'");
|
|
$maf1[$key]['bez']=$row_icon['bez'];
|
|
$maf1[$key]['icon']=$row_icon['icon'];
|
|
$key++;
|
|
}
|
|
//---- nächster Monat
|
|
$kalender1 = $GLOBALS['mysql']->query("SELECT * FROM fplaner WHERE monat='".$monat1."' AND jahr='".$jahr1."' ORDER BY tag");
|
|
while($row = $kalender1->fetch_assoc()) {
|
|
$row_fahrerx = $GLOBALS['mysql']->query_single("SELECT * FROM fahrzeuge WHERE id='".$row['fid']."'");
|
|
$maf2[$key]['fahrer']=$row_fahrerx['kz'];
|
|
// $maf2[$key]['time']=$row['timestamp'];
|
|
$maf2[$key]['time']= mktime(0, 0, 0,$row['monat'],$row['tag'],$row['jahr']);
|
|
$row_icon = $GLOBALS['mysql']->query_single("SELECT * FROM fplaner_bez WHERE id='".$row['grund']."'");
|
|
$maf2[$key]['bez']=$row_icon['bez'];
|
|
$maf2[$key]['icon']=$row_icon['icon'];
|
|
$key++;
|
|
}
|
|
//-------------- hu
|
|
$key=0; $fanz1=0;
|
|
$tempcar1 = $GLOBALS['mysql']->query("SELECT * FROM fahrzeuge WHERE aktiv>0 and besitz<3 and hudate>1 ORDER BY kz");
|
|
while($row = $tempcar1->fetch_assoc()) {
|
|
$temptime=time(); $temptime=$temptime+2678400;
|
|
if($row['hudate']<=time()) {
|
|
$fanz1=1;
|
|
$hudata[$key]['typ']=1;
|
|
$hudata[$key]['kz']=$row['kz'];
|
|
$hudata[$key]['hudate']=$row['hudate'];
|
|
$key++;
|
|
}
|
|
elseif($row['hudate']<=$temptime) {
|
|
$fanz1=1;
|
|
$hudata[$key]['typ']=2;
|
|
$hudata[$key]['kz']=$row['kz'];
|
|
$hudata[$key]['hudate']=$row['hudate'];
|
|
$key++;
|
|
}
|
|
$template->assign('fanz1', $fanz1);
|
|
}
|
|
//------------------ sanikasten
|
|
$key=0; $fanz2=0;
|
|
$tempcar2 = $GLOBALS['mysql']->query("SELECT * FROM fahrzeuge WHERE aktiv>0 and besitz<3 and sanidate>1 ORDER BY kz");
|
|
while($row = $tempcar2->fetch_assoc()) {
|
|
$temptime=time(); $temptime=$temptime+2678400;
|
|
if($row['sanidate']<=time()) {
|
|
$fanz2=1;
|
|
$sanidata[$key]['typ']=1;
|
|
$sanidata[$key]['kz']=$row['kz'];
|
|
$sanidata[$key]['sanidate']=$row['sanidate'];
|
|
$key++;
|
|
}
|
|
elseif($row['sanidate']<=$temptime) {
|
|
$fanz2=1;
|
|
$sanidata[$key]['typ']=2;
|
|
$sanidata[$key]['kz']=$row['kz'];
|
|
$sanidata[$key]['sanidate']=$row['sanidate'];
|
|
$key++;
|
|
}
|
|
$template->assign('fanz2', $fanz2);
|
|
}
|
|
//-------------------------------------------------------------------------------------------------------------
|
|
$test = $GLOBALS['mysql']->query_single("SELECT * FROM fahrzeuge WHERE typ=1 AND aktiv=1"); $aktive1=$test['num_rows'];
|
|
$test = $GLOBALS['mysql']->query_single("SELECT * FROM fahrzeuge WHERE typ=1 AND aktiv=0"); $inaktive1=$test['num_rows'];
|
|
$test = $GLOBALS['mysql']->query_single("SELECT * FROM fahrzeuge WHERE typ=1 AND aktiv>1"); $sonstige1=$test['num_rows'];
|
|
//-------------------------------------------------------------------------------------------------------------
|
|
$test = $GLOBALS['mysql']->query_single("SELECT * FROM fahrzeuge WHERE typ=2 AND aktiv=1"); $aktive2=$test['num_rows'];
|
|
$test = $GLOBALS['mysql']->query_single("SELECT * FROM fahrzeuge WHERE typ=2 AND aktiv=0"); $inaktive2=$test['num_rows'];
|
|
$test = $GLOBALS['mysql']->query_single("SELECT * FROM fahrzeuge WHERE typ=2 AND aktiv>1"); $sonstige2=$test['num_rows'];
|
|
//-------------------------------------------------------------------------------------------------------------
|
|
$test = $GLOBALS['mysql']->query_single("SELECT * FROM fahrzeuge WHERE typ>2 AND aktiv=1"); $aktive3=$test['num_rows'];
|
|
$test = $GLOBALS['mysql']->query_single("SELECT * FROM fahrzeuge WHERE typ>2 AND aktiv=0"); $inaktive3=$test['num_rows'];
|
|
$test = $GLOBALS['mysql']->query_single("SELECT * FROM fahrzeuge WHERE typ>2 AND aktiv>1"); $sonstige3=$test['num_rows'];
|
|
//-------------------------------------------------------------------------
|
|
$test = $GLOBALS['mysql']->query("SELECT * FROM fahrzeuge WHERE besitz<3 AND aktiv>1 ORDER BY kz"); $key=0;
|
|
while($row = $test->fetch_assoc()) {
|
|
$temp=0; $mafehler[$key]['line']=0;
|
|
if (empty($row['hersteller'])) { $mafehler[$key]['name']=$row['kz']; $mafehler[$key]['grund']="Hersteller"; $key++; $temp++; }
|
|
if (empty($row['aktiv'])) { $mafehler[$key]['name']=$row['kz']; $mafehler[$key]['grund']="aktiv ?"; $key++; $temp++; }
|
|
if (empty($row['name'])) { $mafehler[$key]['name']=$row['kz']; $mafehler[$key]['grund']="Bezeichnung"; $key++; $temp++; }
|
|
if (empty($row['kba2'])) { $mafehler[$key]['name']=$row['kz']; $mafehler[$key]['grund']="KBA Daten"; $key++; $temp++; }
|
|
if (empty($row['fin'])) { $mafehler[$key]['name']=$row['kz']; $mafehler[$key]['grund']="Identifizierungsnummer"; $key++; $temp++; }
|
|
if (empty($row['besitz'])) { $mafehler[$key]['name']=$row['kz']; $mafehler[$key]['grund']="Besitzer"; $key++; $temp++; }
|
|
if (empty($row['ezljahr'])) { $mafehler[$key]['name']=$row['kz']; $mafehler[$key]['grund']="Erstzulassung"; $key++; $temp++; }
|
|
if (empty($row['jbjahr'])) { $mafehler[$key]['name']=$row['kz']; $mafehler[$key]['grund']="JB-Zulassung"; $key++; $temp++; }
|
|
if (empty($row['hudate'])) { $mafehler[$key]['name']=$row['kz']; $mafehler[$key]['grund']="HU/AU Prüfung"; $key++; $temp++; }
|
|
if (empty($row['kw'])) { $mafehler[$key]['name']=$row['kz']; $mafehler[$key]['grund']="Leistung"; $key++; $temp++; }
|
|
if (empty($row['ccm'])) { $mafehler[$key]['name']=$row['kz']; $mafehler[$key]['grund']="Hubraum"; $key++; $temp++; }
|
|
if (empty($row['sanij'])) { $mafehler[$key]['name']=$row['kz']; $mafehler[$key]['grund']="Sanikasten"; $key++; $temp++; }
|
|
if (empty($row['typ'])) { $mafehler[$key]['name']=$row['kz']; $mafehler[$key]['grund']="interner Typ"; $key++; $temp++; }
|
|
|
|
if($temp>0) { $mafehler[$key]['line']=$temp; }
|
|
}
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
|
|
|
//-------------------------------------------
|
|
$template->assign('maf1', $maf1);
|
|
$template->assign('maf2', $maf2);
|
|
//--------------------------------------------
|
|
$template->assign('mafehler', $mafehler);
|
|
//--------------------------------------------
|
|
$template->assign('aktive1', $aktive1);
|
|
$template->assign('inaktive1', $inaktive1);
|
|
$template->assign('sonstige1', $sonstige1);
|
|
|
|
$template->assign('aktive2', $aktive2);
|
|
$template->assign('inaktive2', $inaktive2);
|
|
$template->assign('sonstige2', $sonstige2);
|
|
|
|
$template->assign('aktive3', $aktive3);
|
|
$template->assign('inaktive3', $inaktive3);
|
|
$template->assign('sonstige3', $sonstige3);
|
|
|
|
|
|
$template->assign('fanz3', $fanz3);
|
|
// $template->assign('fanz4', $fanz4);
|
|
// $template->assign('fanz5', $fanz5);
|
|
$template->assign('hudata', $hudata);
|
|
$template->assign('sanidata', $sanidata);
|
|
//--------------------------------------------
|
|
$template->assign('content', 'tpl/c_info.tpl');
|
|
?>
|