42 lines
No EOL
1.7 KiB
PHP
42 lines
No EOL
1.7 KiB
PHP
<?php
|
|
|
|
//error_reporting(E_ALL); ini_set('display_errors',0);
|
|
$datum=$_POST['tag'].".".$_POST['monat'].".".$_POST['jahr'];
|
|
$mon=(int)$_POST['monat'];
|
|
//--------------------
|
|
$p_auto = $GLOBALS['mysql']->query_array("SELECT * FROM fplaner WHERE tag='".$_POST['tag']."' AND monat='".$mon."'AND jahr='".$_POST['jahr']."'");
|
|
//--------------------- freie Fahrzeuge Nachts
|
|
$key=0;
|
|
// nachts
|
|
$tempcar = $GLOBALS['mysql']->query("SELECT * FROM fahrzeuge WHERE aktiv=1 and besitz<3 ORDER BY typ,kz");
|
|
while($row = $tempcar->fetch_assoc()) {
|
|
$tliste = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE tag='".$_POST['tag']."' AND monat='".$_POST['monat']."'AND jahr='".$_POST['jahr']."' and auto='".$row['id']."' and typ in (3,4,5,17)");
|
|
|
|
if($tliste['num_rows'] == 0) {
|
|
//$ta_id= array_search($row['id'], array_column($tliste, 'auto'));
|
|
//if (!is_numeric($ta_id)) {
|
|
$pa_id= array_search($row['id'], array_column($p_auto, 'fid'));
|
|
if (!is_numeric($pa_id)) {
|
|
$seite[$key]['car']= $row['kz'];
|
|
$seite[$key]['info']= $row['hersteller']." ".$row['name'];
|
|
$seite[$key]['typ']= $row['typ'];
|
|
$seite[$key]['n_a']= 0;
|
|
//echo $seite['info'][$key];
|
|
$key++;
|
|
} else {
|
|
$seite[$key]['car']= $row['kz'];
|
|
$p_grund = $GLOBALS['mysql']->query_single("SELECT * FROM fplaner_bez WHERE id='".$p_auto[$pa_id]['grund']."'");
|
|
$seite[$key]['info']= $p_grund['bez'];
|
|
$seite[$key]['typ']= $row['typ'];
|
|
$seite[$key]['n_a']= 1;
|
|
}
|
|
}
|
|
}
|
|
//------------------------------------------------------------------------------------------------------------------
|
|
|
|
$template->assign('datum', $datum);
|
|
$template->assign('data',$seite);
|
|
$template->assign('content', 'tpl/ajax/p_night_free_car.tpl');
|
|
|
|
|
|
?>
|