135 lines
4.6 KiB
PHP
135 lines
4.6 KiB
PHP
<?php
|
|
$_SESSION['m1']=1; $_SESSION['m2']=1;
|
|
// Melde alle PHP Fehler (siehe Changelog)
|
|
// error_reporting(E_ALL);
|
|
ini_set('display_errors', 0);
|
|
|
|
if($_SESSION['benutzer']==12) { $planer="T. Muerbe"; }
|
|
else if($_SESSION['benutzer']==13) { $planer="Anett"; }
|
|
else if($_SESSION['benutzer']==18) { $planer="Joerg Basse"; }
|
|
else if($_SESSION['benutzer']==44) { $planer="I. Steinmacher"; }
|
|
else $planer="Frank";
|
|
|
|
$jahr = (int)date('Y');
|
|
$monat = (int)date('m');
|
|
$kw_aktuell = (int)date('W');
|
|
|
|
if(isset($_GET['wahl'])) {
|
|
if($_GET['wahl']==1){
|
|
if($_GET['monat']==1) {
|
|
$monat=12; $jahr=$_GET['jahr']-1;
|
|
} else {
|
|
$monat=$_GET['monat']-1; $jahr=$_GET['jahr'];
|
|
}
|
|
}
|
|
elseif($_GET['wahl']==2) {
|
|
if($_GET['monat']==12) {
|
|
$monat=1; $jahr=$_GET['jahr']+1;
|
|
} else {
|
|
$monat=$_GET['monat']+1; $jahr=$_GET['jahr'];
|
|
}
|
|
}
|
|
} else {
|
|
if(isset($_GET['id'])) {
|
|
$monat=$_GET['monat']; $jahr=$_GET['jahr'];
|
|
}
|
|
}
|
|
//echo $monat."-".$jahr;
|
|
|
|
//------------------------------------ komplette tabelel speichern
|
|
|
|
|
|
|
|
|
|
//------------------ Tour auslesen
|
|
if(isset($_GET['id'])) {
|
|
$key=0; $anz=0; $ers=0;
|
|
$pin_tour = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE monat='".$monat."' and jahr='".$jahr."' and tour='".$_GET['id']."' ORDER BY tag");
|
|
while($row = $pin_tour->fetch_assoc()) {
|
|
$row_tour3 = $GLOBALS['mysql']->query_single("SELECT * FROM touren WHERE id='".$row['tour']."'");
|
|
$s_auto=$row_tour3['s_auto']; $s_fahrer=$row_tour3['s_fahrer'];
|
|
$tourname=$row_tour3['tour'];
|
|
$tour_edit[$key]['id']=$row['id'];
|
|
$tour_edit[$key]['tid']=$key;
|
|
$tour_edit[$key]['kw']=$row['kw'];
|
|
$tour_edit[$key]['tag']=$row['tag'];
|
|
$tour_edit[$key]['monat']=$row['monat'];
|
|
$tour_edit[$key]['jahr']=$row['jahr'];
|
|
$date1= mktime(0,0,0,$row['monat'],$row['tag'],$row['jahr']); //// ???????????????????
|
|
$tour_edit[$key]['date']=$date1;
|
|
$tour_edit[$key]['tagnr']=(int)date('w', $date1);
|
|
$tour_edit[$key]['fahrer_id']=$row['fahrer'];
|
|
$tour_edit[$key]['auto_id']=$row['auto'];
|
|
$tour_edit[$key]['infotext']=$row['infotext'];
|
|
$fahrerxx = $GLOBALS['mysql']->query_single("SELECT * FROM mitarbeiter WHERE id='".$row['fahrer']."'");
|
|
$tour_edit[$key]['fahrer_name']=$fahrerxx['name'];
|
|
$autoxx = $GLOBALS['mysql']->query_single("SELECT * FROM fahrzeuge WHERE id='".$row['auto']."'");
|
|
$tour_edit[$key]['auto_kz']=$autoxx['kz'];
|
|
|
|
$key++;
|
|
}
|
|
}
|
|
|
|
$key=0; $wert=0;
|
|
$tmp0 = $GLOBALS['mysql']->query("SELECT * FROM tourentyp ORDER BY tid");
|
|
while($row = $tmp0->fetch_assoc()) {
|
|
$tmpx = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE monat='".$monat."' and jahr='".$jahr."' and typ='".$row['tid']."'"); //abfrage touren pro typ
|
|
$tmenge= $tmpx['num_rows'];
|
|
$tag_tour[$key]['menge']=$tmenge;
|
|
if($tmenge>0) {
|
|
$tag_tour[$key]['typ']=$row['tid'];
|
|
$tag_tour[$key]['aktiv']=$row['aktiv'];
|
|
$tag_tour[$key]['raute']="#".$row['tid'];
|
|
$tag_tour[$key]['name1']=$row['tname'];
|
|
$tag_tour[$key]['name2']=$row['tinfotitel'];
|
|
unset ($tmp8);unset ($row0); unset ($tdata);
|
|
$tmp8 = $GLOBALS['mysql']->query("SELECT * FROM touren WHERE typ='".$row['tid']."' order by id"); $wert=0;
|
|
while($row0= $tmp8->fetch_assoc()) {
|
|
unset ($tmp9);
|
|
// $tmp9 = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE monat='".$monat."' and jahr='".$jahr."' and tour='".$row0['id']."'"); //abfrage touren pro typ
|
|
// if($tmp9['num_rows']>0) {
|
|
$tdata[$wert]['id']=$row0['id'];
|
|
$tdata[$wert]['aktiv']=$row0['aktiv'];
|
|
$tdata[$wert]['tour']=$row0['tour'];
|
|
$tdata[$wert]['infotitel']=$row0['infotitel'];
|
|
$wert++;
|
|
// }
|
|
|
|
if(isset($tdata)) {
|
|
$tag_tour[$key]['tdata']=$tdata;
|
|
}
|
|
if(isset($_GET['id'])) {
|
|
$tmpa = $GLOBALS['mysql']->query_single("SELECT * FROM touren WHERE id='".$_GET['id']."'"); //abfrage touren typ anzeige
|
|
$tag_tour[$key]['col']=$tmpa['typ'];
|
|
}
|
|
}
|
|
}
|
|
$key++;
|
|
}
|
|
|
|
$template->assign('tag_tour', $tag_tour);
|
|
|
|
//---------------------------
|
|
|
|
|
|
$template->assign('monat', $monat);
|
|
$template->assign('jahr', $jahr);
|
|
if(isset($_GET['id'])) {
|
|
$template->assign('anzeige', $_GET['id']);
|
|
$template->assign('infoanz', $anz);
|
|
$template->assign('ersanz', $ers);
|
|
$template->assign('info', $info);
|
|
$template->assign('ersatz', $ersatz);
|
|
$template->assign('tourname', $tourname);
|
|
$template->assign('tour_edit', $tour_edit);
|
|
$template->assign('s_fahrer', $s_fahrer);
|
|
$template->assign('s_auto', $s_auto);
|
|
$template->assign('auto_array', $auto_array);
|
|
$template->assign('fahrer_array', $fahrer_array);
|
|
}
|
|
$template->assign('datum_unix', mktime(0,0,0, $monat,1,$jahr));
|
|
//$template->assign('sms_tour1', $sms_tour1);
|
|
//$template->assign('vorlage', $vorlage);
|
|
|
|
$template->assign('content', 'tpl/pwtagx.tpl');
|
|
?>
|