53 lines
No EOL
1.5 KiB
PHP
53 lines
No EOL
1.5 KiB
PHP
<?php
|
|
//-------------------- 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'];
|
|
|
|
//echo'<pre>'; print_r($row); echo'</pre>';
|
|
|
|
$ist_jahr = (int)date('Y');
|
|
$ma_data = $GLOBALS['mysql']->query_id("SELECT * FROM mitarbeiter WHERE aktiv=1 and typ<9 ORDER BY id");
|
|
|
|
$htour1 = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE tour='".$_POST['tid']."' ORDER BY id"); $key=0; $zahl=0;
|
|
while($trow = $htour1->fetch_assoc()) {
|
|
//echo'<pre>'; print_r($row); echo'</pre>';
|
|
if($ma_data[$trow['fahrer']]['id'] >0) {
|
|
|
|
if($ist_jahr==$trow['jahr']) {$status=1;}
|
|
elseif($ist_jahr-1==$trow['jahr']) {$status=2;}
|
|
else {$status=3;}
|
|
|
|
$fahrer=$trow['fahrer'];
|
|
$temp=$hinfo[$fahrer]['zahl']+1;
|
|
if($temp>20) { $menge=3; }
|
|
elseif($temp>10) { $menge=2; }
|
|
else { $menge=1; }
|
|
|
|
|
|
$hinfo[$fahrer]['menge']=$menge;
|
|
|
|
|
|
|
|
$hinfo[$fahrer]['status']=$status;
|
|
$hinfo[$fahrer]['zahl']=$hinfo[$fahrer]['zahl']+1;
|
|
$hinfo[$fahrer]['name']=$ma_data[$trow['fahrer']]['name'];
|
|
|
|
|
|
$jahr=$trow['jahr']-2000;
|
|
$hinfo[$fahrer]['last']=$trow['tag'].".".$trow['monat'].".".$trow['jahr'];
|
|
$key++;
|
|
}
|
|
}
|
|
|
|
$ta_id= array_search($_POST['tid'], array_column($GLOBALS['a_touren'], 'id'));
|
|
$tanz = $GLOBALS['a_touren'][$ta_id]['tour'];
|
|
|
|
$template->assign('touranz', $tanz);
|
|
$template->assign('data', $hinfo);
|
|
$template->assign('content', 'tpl/ajax/tinfo.tpl');
|
|
|
|
|
|
?>
|