327 lines
No EOL
14 KiB
PHP
327 lines
No EOL
14 KiB
PHP
<?php
|
|
if(isset($_GET['a']))
|
|
$action=$_GET['a'];
|
|
else
|
|
$action='load_minfo';
|
|
switch($action):
|
|
|
|
case 'abk_save';
|
|
$tour = $GLOBALS['mysql']->query_single("SELECT * FROM fazs WHERE id='".$_POST['fazID']."'");
|
|
$GLOBALS['mysql']->insert("UPDATE fazs SET meldung='ABK' WHERE id='".$_POST['fazID']."'");
|
|
|
|
|
|
$back['htmlresult']=' <td nowrap style="color:black;width:330px;font-size:10pt" align="left" id="meldung'.$_POST['fazID'].'">
|
|
|
|
<input type="checkbox" value="'.$_POST['fazID'].'" onChange="abk_save('.$_POST['fazID'].')" data-toggle="tooltip" title="ABK" checked="checked">
|
|
<input type="checkbox" value="'.$_POST['fazID'].'" onChange="ibk_save('.$_POST['fazID'].')" data-toggle="tooltip" title="IBK">
|
|
<input type="checkbox" value="'.$_POST['fazID'].'" onChange="bk_save('.$_POST['fazID'].')" data-toggle="tooltip" title="BK">
|
|
|
|
<input type="checkbox" value="'.$_POST['fazID'].'" onChange="tuer_save('.$_POST['fazID'].')" data-toggle="tooltip" title="tuer">
|
|
|
|
|
|
|
|
<input type="text" value="ABK" id="info"
|
|
style="width:210px;border-color:#dcdcdc;border:none;border-bottom: 1px solid #dcdcdc;" name="infotext['.$_POST['fazID'].']"
|
|
onChange="save_info('.$_POST['fazID'].')">
|
|
</td>';
|
|
|
|
$back['tour'] = $tour;
|
|
$back['lastnote']="Information Außenbriefkasten für ".$tour['name2']." ".$tour['name']." gespeichert.";
|
|
$back['success'] = true;
|
|
$back['zeile'] = $_POST['fazID'];
|
|
echo json_encode($back);
|
|
break;
|
|
|
|
case 'ibk_save';
|
|
$tour = $GLOBALS['mysql']->query_single("SELECT * FROM fazs WHERE id='".$_POST['fazID']."'");
|
|
$GLOBALS['mysql']->insert("UPDATE fazs SET meldung='IBK' WHERE id='".$_POST['fazID']."'");
|
|
$back['htmlresult']=' <td nowrap style="color:black;width:330px;font-size:10pt" align="left" id="meldung'.$_POST['fazID'].'">
|
|
|
|
<input type="checkbox" value="'.$_POST['fazID'].'" onChange="abk_save('.$_POST['fazID'].')" data-toggle="tooltip" title="ABK">
|
|
|
|
<input type="checkbox" value="'.$_POST['fazID'].'" onChange="ibk_save('.$_POST['fazID'].')" data-toggle="tooltip" title="IBK" checked="checked">
|
|
|
|
<input type="checkbox" value="'.$_POST['fazID'].'" onChange="bk_save('.$_POST['fazID'].')" data-toggle="tooltip" title="BK">
|
|
|
|
<input type="checkbox" value="'.$_POST['fazID'].'" onChange="tuer_save('.$_POST['fazID'].')" data-toggle="tooltip" title="tuer">
|
|
|
|
|
|
|
|
<input type="text" value="IBK" id="info"
|
|
style="width:210px;border-color:#dcdcdc;border:none;border-bottom: 1px solid #dcdcdc;" name="infotext['.$tour['plz'].']"
|
|
onChange="save_info('.$_POST['fazID'].')">
|
|
</td>';
|
|
|
|
$back['tour'] = $tour;
|
|
$back['lastnote']="Information Innenbriefkasten für ".$tour['name2']." ".$tour['name']." gespeichert.";
|
|
$back['success'] = true;
|
|
$back['zeile'] = $_POST['fazID'];
|
|
echo json_encode($back);
|
|
break;
|
|
|
|
case 'bk_save';
|
|
$tour = $GLOBALS['mysql']->query_single("SELECT * FROM fazs WHERE id='".$_POST['fazID']."'");
|
|
$GLOBALS['mysql']->insert("UPDATE fazs SET meldung='BK' WHERE id='".$_POST['fazID']."'");
|
|
$back['htmlresult']=' <td nowrap style="color:black;width:330px;font-size:10pt" align="left" id="meldung'.$_POST['fazID'].'">
|
|
|
|
<input type="checkbox" value="'.$_POST['fazID'].'" onChange="abk_save('.$_POST['fazID'].')" data-toggle="tooltip" title="ABK">
|
|
|
|
<input type="checkbox" value="'.$_POST['fazID'].'" onChange="ibk_save('.$_POST['fazID'].')" data-toggle="tooltip" title="IBK">
|
|
<input type="checkbox" value="'.$_POST['fazID'].'" onChange="bk_save('.$_POST['fazID'].')" data-toggle="tooltip" title="BK" checked="checked">
|
|
<input type="checkbox" value="'.$_POST['fazID'].'" onChange="tuer_save('.$_POST['fazID'].')" data-toggle="tooltip" title="tuer">
|
|
|
|
|
|
|
|
<input type="text" value="BK" id="info"
|
|
style="width:210px;border-color:#dcdcdc;border:none;border-bottom: 1px solid #dcdcdc;" name="infotext['.$tour['plz'].']"
|
|
onChange="save_info('.$_POST['fazID'].')">
|
|
</td>';
|
|
|
|
$back['tour'] = $tour;
|
|
$back['lastnote']="Information Briefkasten für ".$tour['name2']." ".$tour['name']." gespeichert.";
|
|
$back['success'] = true;
|
|
$back['zeile'] = $_POST['fazID'];
|
|
echo json_encode($back);
|
|
break;
|
|
|
|
case 'tuer_save';
|
|
$tour = $GLOBALS['mysql']->query_single("SELECT * FROM fazs WHERE id='".$_POST['fazID']."'");
|
|
$GLOBALS['mysql']->insert("UPDATE fazs SET meldung='TÜR' WHERE id='".$_POST['fazID']."'");
|
|
$back['htmlresult']=' <td nowrap style="color:black;width:330px;font-size:10pt" align="left" id="meldung'.$_POST['fazID'].'">
|
|
|
|
<input type="checkbox" value="'.$_POST['fazID'].'" onChange="abk_save('.$_POST['fazID'].')" data-toggle="tooltip" title="ABK">
|
|
|
|
<input type="checkbox" value="'.$_POST['fazID'].'" onChange="ibk_save('.$_POST['fazID'].')" data-toggle="tooltip" title="IBK">
|
|
<input type="checkbox" value="'.$_POST['fazID'].'" onChange="bk_save('.$_POST['fazID'].')" data-toggle="tooltip" title="BK">
|
|
|
|
<input type="checkbox" value="'.$_POST['fazID'].'" onChange="tuer_save('.$_POST['fazID'].')" data-toggle="tooltip" title="tuer" checked="checked">
|
|
|
|
|
|
|
|
<input type="text" value="Tür" id="info"
|
|
style="width:210px;border-color:#dcdcdc;border:none;border-bottom: 1px solid #dcdcdc;" name="infotext['.$tour['plz'].']"
|
|
onChange="save_info('.$_POST['fazID'].')">
|
|
</td>';
|
|
|
|
$back['tour'] = $tour;
|
|
$back['lastnote']="Information TÜR für ".$tour['name2']." ".$tour['name']." gespeichert.";
|
|
$back['success'] = true;
|
|
$back['zeile'] = $_POST['fazID'];
|
|
echo json_encode($back);
|
|
break;
|
|
|
|
case 'info_save';
|
|
$tour = $GLOBALS['mysql']->query_single("SELECT * FROM fazs WHERE id='".$_POST['fazID']."'");
|
|
$GLOBALS['mysql']->insert("UPDATE fazs SET meldung='".$_POST['texti']."' WHERE id='".$_POST['fazID']."'");
|
|
$back['htmlresult']=' <td nowrap style="color:black;width:330px;font-size:10pt" align="left" id="meldung'.$_POST['fazID'].'">
|
|
|
|
<input type="checkbox" value="'.$_POST['fazID'].'" onChange="abk_save('.$_POST['fazID'].')" data-toggle="tooltip" title="ABK">
|
|
|
|
<input type="checkbox" value="'.$_POST['fazID'].'" onChange="ibk_save('.$_POST['fazID'].')" data-toggle="tooltip" title="IBK">
|
|
<input type="checkbox" value="'.$_POST['fazID'].'" onChange="bk_save('.$_POST['fazID'].')" data-toggle="tooltip" title="BK">
|
|
|
|
<input type="checkbox" value="'.$_POST['fazID'].'" onChange="tuer_save('.$_POST['fazID'].')" data-toggle="tooltip" title="tuer">
|
|
|
|
<input type="text" value='.$_POST['texti'].' id="info"
|
|
style="width:210px;border-color:#dcdcdc;border:none;border-bottom: 1px solid #dcdcdc;" name="infotext['.$_POST['fazID'].']"
|
|
onChange="save_info('.$_POST['fazID'].')">
|
|
</td>';
|
|
|
|
$back['tour'] = $tour;
|
|
$back['lastnote']="Information ".$_POST['texti']." für ".$tour['name2']." ".$tour['name']." gespeichert.";
|
|
$back['success'] = true;
|
|
$back['zeile'] = $_POST['fazID'];
|
|
echo json_encode($back);
|
|
break;
|
|
case 'rekla_save';
|
|
$rekla=0;
|
|
$tour = $GLOBALS['mysql']->query_single("SELECT * FROM fazs WHERE id='".$_POST['fazID']."'");
|
|
|
|
|
|
if($tour['rekla']==1) {
|
|
$rekla=0;
|
|
} else {
|
|
$rekla=1;
|
|
}
|
|
$GLOBALS['mysql']->insert("UPDATE fazs SET rekla=".$rekla." WHERE id='".$_POST['fazID']."'");
|
|
$back['abonr'] = $_POST['fazID'];
|
|
$back['lastnote']="Reklamation für Abonummer: ".$_POST['abonr']." gespeichert.";
|
|
$back['success'] = true;
|
|
$back['zeile'] = $_POST['fazID'];
|
|
echo json_encode($back);
|
|
|
|
case 'ubk_save';
|
|
$ubk=1;
|
|
$infotest = $GLOBALS['mysql']->query_single("SELECT * FROM fazinfo WHERE abonr='".$_POST['fazID']."'");
|
|
if($infotest['num_rows']==0) {
|
|
$GLOBALS['mysql']->insert("INSERT INTO fazinfo (abonr,unbekannt)
|
|
VALUES(
|
|
'".$_POST['fazID']."',
|
|
'".$ubk."')
|
|
");
|
|
|
|
} else {
|
|
if($infotest['unbekannt']==1) { $ubk=0; }
|
|
$GLOBALS['mysql']->insert("UPDATE fazinfo SET unbekannt='".$ubk."' WHERE abonr='".$_POST['fazID']."'");
|
|
}
|
|
|
|
$back['abonr'] = $_POST['fazID'];
|
|
$back['lastnote']="Information UNBEKANNT für Abonummer: ".$_POST['fazID']." gespeichert.";
|
|
$back['success'] = true;
|
|
$back['zeile'] = $_POST['fazID'];
|
|
echo json_encode($back);
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 'user_save';
|
|
// $ttemp=$row['tour']; $ta_id= array_search($ttemp, array_column($a_touren, 'id'));
|
|
// $atemp=$row['auto']; $aa_id= array_search($atemp, array_column($a_fahrzg, 'id'));
|
|
// $mtemp=$row['fahrer']; $ma_id= array_search($mtemp, array_column($a_fahrer, 'id'));
|
|
|
|
$GLOBALS['mysql']->insert("UPDATE tourenliste SET fahrer='".$_POST['user']."' WHERE id='".$_POST['tourID']."'");
|
|
$row_tourl = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE id='".$_POST['tourID']."'");
|
|
$ttemp=$row_tourl['tour']; $ta_id= array_search($ttemp, array_column($a_touren, 'id'));
|
|
$atemp=$_POST['car']; $aa_id= array_search($atemp, array_column($a_fahrzg, 'id'));
|
|
|
|
$back['lastnote']="Fahrer ".$a_fahrer[$ma_id]['name']." für Tour ".$row_tourx['tour']." gespeichert.";
|
|
$back['success'] = true;
|
|
$back['zeile'] = $_POST['tourID'];
|
|
$back['alt'] = 5;
|
|
echo json_encode($back);
|
|
break;
|
|
|
|
case 'load_car_icon';
|
|
//echo $_POST['tourID'];
|
|
$touri = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE id='".$_POST['tourID']."'");
|
|
//$unixdate=mktime(0,0,0, $touri['monat'],$touri['tag'],$touri['jahr']);
|
|
if($touri['auto']==0) { $anzeige=1;
|
|
} else {
|
|
$cari = $GLOBALS['mysql']->query_single("SELECT * FROM fahrzeuge WHERE id='".$touri['auto']."'");
|
|
if($cari['aktiv']==0) { $anzeige=1;
|
|
} else {
|
|
//$plani = $GLOBALS['mysql']->query_single("SELECT * FROM fplaner WHERE timestamp LIKE '".$unixdate." %' and fid='".$touri['auto']."'");
|
|
$plani = $GLOBALS['mysql']->query_single("SELECT * FROM fplaner WHERE
|
|
tag='".$touri['tag']."' and
|
|
monat='".$touri['monat']."' and
|
|
jahr='".$touri['jahr']."' and
|
|
fid='".$touri['auto']."'");
|
|
if($plani['num_rows']== 0) {
|
|
if($cari['besitz']<3) { $anzeige=3; } else { $anzeige=5; } // auswahl fremdes Fahrzeug
|
|
} else {
|
|
$fplani = $GLOBALS['mysql']->query_single("SELECT * FROM fplaner_bez WHERE id='".$plani['grund']."'");
|
|
if($fplani['aktiv']== 0) { $anzeige=1; }
|
|
if($fplani['aktiv']== 1) { $anzeige=2; }
|
|
if($fplani['aktiv']== 2) { $anzeige=4; }
|
|
}
|
|
}
|
|
}
|
|
if($anzeige==0) {
|
|
$back['htmlresult']='<td nowrap id="caricon" style="width:20px;font-size:11pt;text-align:right;color:gray">
|
|
<i class="fa fa-truck" id="caricon"></i></td>';
|
|
}
|
|
if($anzeige==1) {
|
|
$back['htmlresult']='<td nowrap id="caricon" style="width:20px;font-size:11pt;text-align:right;color:red">
|
|
<i class="fa fa-truck" id="caricon"></i></td>';
|
|
}
|
|
if($anzeige==2) {
|
|
$back['htmlresult']='<td nowrap id="caricon" style="width:20px;font-size:11pt;text-align:right;color:orange">
|
|
<i class="fa fa-truck" id="caricon"></i></td>';
|
|
}
|
|
if($anzeige==3) {
|
|
$back['htmlresult']='<td nowrap id="caricon" style="width:20px;font-size:11pt;text-align:right;color:green">
|
|
<i class="fa fa-truck" id="caricon"></i></td>';
|
|
}
|
|
if($anzeige==4) {
|
|
$back['htmlresult']='<td nowrap id="caricon" style="width:20px;font-size:11pt;text-align:right;color:#045FB4">
|
|
<i class="fa fa-truck" id="caricon"></i></td>';
|
|
}
|
|
if($anzeige==5) {
|
|
$back['htmlresult']='<td nowrap id="caricon" style="width:20px;font-size:11pt;text-align:right;color:#A5DF00">
|
|
<i class="fa fa-truck" id="caricon"></i></td>';
|
|
}
|
|
|
|
$back['zeile'] = $_POST['tourID'];
|
|
$back['alt'] = 5;
|
|
echo json_encode($back);
|
|
break;
|
|
//--------------------- user icon nachladen
|
|
case 'load_user_icon';
|
|
//echo $_POST['tourID'];
|
|
$touri2 = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE id='".$_POST['tourID']."'");
|
|
if($touri2['fahrer']==0) { $anzeige=1;
|
|
} else {
|
|
$useri2 = $GLOBALS['mysql']->query_single("SELECT * FROM mitarbeiter WHERE id='".$touri2['fahrer']."'");
|
|
if($useri2['aktiv']==0) { $anzeige=1; //Fahrer nicht aktiv / ausgeschieden
|
|
} else {
|
|
$plani = $GLOBALS['mysql']->query_single("SELECT * FROM planer WHERE
|
|
tag='".$touri2['tag']."' and
|
|
monat='".$touri2['monat']."' and
|
|
jahr='".$touri2['jahr']."' and
|
|
mid='".$touri2['fahrer']."'");
|
|
if($plani['num_rows']== 0) {
|
|
if($useri2['saso']>0) { $anzeige=3; } else { $anzeige=2; } // auswahl fremdes Fahrzeug
|
|
} else {
|
|
$plani = $GLOBALS['mysql']->query_single("SELECT * FROM planer_bez WHERE id='".$plani['grund']."'");
|
|
if($plani['nichtda']== 1) { $anzeige=1; }
|
|
elseif($plani['nichtda']== 8) { $anzeige=1; }
|
|
elseif($plani['nichtda']==19) { $anzeige=1; }
|
|
else { $anzeige=2; }
|
|
}
|
|
}
|
|
}
|
|
if($anzeige==0) {
|
|
$back['htmlresult']='<td nowrap id="caricon" style="width:20px;font-size:11pt;text-align:right;color:gray">
|
|
<i class="fa fa-user" id="caricon"></i></td>';
|
|
}
|
|
if($anzeige==1) {
|
|
$back['htmlresult']='<td nowrap id="caricon" style="width:20px;font-size:11pt;text-align:right;color:red">
|
|
<i class="fa fa-user" id="caricon"></i></td>';
|
|
}
|
|
if($anzeige==2) {
|
|
$back['htmlresult']='<td nowrap id="caricon" style="width:20px;font-size:11pt;text-align:right;color:orange">
|
|
<i class="fa fa-user" id="caricon"></i></td>';
|
|
}
|
|
if($anzeige==3) {
|
|
$back['htmlresult']='<td nowrap id="caricon" style="width:20px;font-size:11pt;text-align:right;color:green">
|
|
<i class="fa fa-user" id="caricon"></i></td>';
|
|
}
|
|
|
|
$back['zeile'] = $_POST['tourID'];
|
|
$back['alt'] = 5;
|
|
echo json_encode($back);
|
|
break;
|
|
|
|
case 'load_free_cars';
|
|
default:
|
|
|
|
//--------------------- freie Fahrzeuge Nachts
|
|
$key=0;
|
|
//-- trp nachts
|
|
|
|
$tempcar = $GLOBALS['mysql']->query("SELECT * FROM fahrzeuge WHERE aktiv=1 and besitz<3 and typ>2 ORDER BY id");
|
|
while($row = $tempcar->fetch_assoc()) {
|
|
$istabfrage = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE timestamp LIKE '".$_POST['date']." %' AND auto='".$row['id']."' and typ>5 and typ!=18");
|
|
$pauto = $GLOBALS['mysql']->query_single("SELECT * FROM fplaner WHERE timestamp LIKE '".$_POST['date']." %' and fid='".$row['id']."'");
|
|
if($istabfrage['num_rows']== 0) {
|
|
if($pauto['num_rows']== 0) {
|
|
$seite['trp'][$key]=$row['kz']." (".$row['hersteller']." ".$row['name'].")"; $key++;
|
|
}
|
|
}
|
|
}
|
|
echo json_encode($seite);
|
|
|
|
|
|
endswitch;
|
|
|
|
|
|
|
|
?>
|