83 lines
3.6 KiB
PHP
83 lines
3.6 KiB
PHP
<?php
|
|
$_SESSION['m1']=0; $_SESSION['m2']=5;
|
|
$kw_aktuell = (int)date('W');
|
|
$jahr_aktuell = (int)date('Y');
|
|
|
|
//------------- Marktbeläge
|
|
$key=0;
|
|
$werb1_tour = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr_aktuell."' and typ=12");
|
|
while($row = $werb1_tour->fetch_assoc()) {
|
|
$werb1[$key]['datum']=$row['tag'].".".$row['monat'].".".$row['jahr'];
|
|
$werb1[$key]['id']=$row['id'];
|
|
$row_tour = $GLOBALS['mysql']->query_single("SELECT * FROM touren WHERE id='".$row['tour']."'");
|
|
$werb1[$key]['tour']=$row_tour['tour'];
|
|
$row_fahrerx = $GLOBALS['mysql']->query_single("SELECT * FROM mitarbeiter WHERE id='".$row['fahrer']."'");
|
|
$werb1[$key]['fahrer']=$row_fahrerx['name'];
|
|
$werb1[$key]['zeit']=$row['zeit'];
|
|
$werb1[$key]['gewicht']=$row['gewicht'];
|
|
$row_autox = $GLOBALS['mysql']->query_single("SELECT * FROM fahrzeuge WHERE id='".$row['auto']."'");
|
|
$werb1[$key]['kennz']=$row_autox['kz'];
|
|
$werb1[$key]['infotext']=$row_tour['infotitel'];
|
|
$werb1[$key]['sms']=$row['smsid'];
|
|
$key++;
|
|
}
|
|
//--------- TIP
|
|
$key=0;
|
|
$werb2_tour = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr_aktuell."' and typ=13");
|
|
while($row = $werb2_tour->fetch_assoc()) {
|
|
$werb2[$key]['datum']=$row['tag'].".".$row['monat'].".".$row['jahr'];
|
|
$werb2[$key]['id']=$row['id'];
|
|
$row_tour = $GLOBALS['mysql']->query_single("SELECT * FROM touren WHERE id='".$row['tour']."'");
|
|
$werb2[$key]['tour']=$row_tour['tour'];
|
|
$row_fahrerx = $GLOBALS['mysql']->query_single("SELECT * FROM mitarbeiter WHERE id='".$row['fahrer']."'");
|
|
$werb2[$key]['fahrer']=$row_fahrerx['name'];
|
|
$werb2[$key]['zeit']=$row['zeit'];
|
|
$werb2[$key]['gewicht']=$row['gewicht'];
|
|
$row_autox = $GLOBALS['mysql']->query_single("SELECT * FROM fahrzeuge WHERE id='".$row['auto']."'");
|
|
$werb2[$key]['kennz']=$row_autox['kz'];
|
|
$werb2[$key]['infotext']=$row_tour['infotitel'];
|
|
$werb2[$key]['sms']=$row['smsid'];
|
|
$key++;
|
|
}
|
|
//------------- Werbung MPV
|
|
$key=0;
|
|
$werb3_tour = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr_aktuell."' and typ=11");
|
|
while($row = $werb3_tour->fetch_assoc()) {
|
|
$werb3[$key]['datum']=$row['tag'].".".$row['monat'].".".$row['jahr'];
|
|
$werb3[$key]['id']=$row['id'];
|
|
$row_tour = $GLOBALS['mysql']->query_single("SELECT * FROM touren WHERE id='".$row['tour']."'");
|
|
$werb3[$key]['tour']=$row_tour['tour'];
|
|
$row_fahrerx = $GLOBALS['mysql']->query_single("SELECT * FROM mitarbeiter WHERE id='".$row['fahrer']."'");
|
|
$werb3[$key]['fahrer']=$row_fahrerx['name'];
|
|
$werb3[$key]['zeit']=$row['zeit'];
|
|
$werb3[$key]['gewicht']=$row['gewicht'];
|
|
$row_autox = $GLOBALS['mysql']->query_single("SELECT * FROM fahrzeuge WHERE id='".$row['auto']."'");
|
|
$werb3[$key]['kennz']=$row_autox['kz'];
|
|
$werb3[$key]['infotext']=$row_tour['infotitel'];
|
|
$werb3[$key]['sms']=$row['smsid'];
|
|
$key++;
|
|
}
|
|
|
|
|
|
if(($week = date('W', mktime(0, 0, 0, 12, 31,$jahr_aktuell))) == 1) { $kwgesamt=52; } else { $kwgesamt=53; }
|
|
$key=0; $tmp=0;
|
|
for ($i = 1; $i <= $kwgesamt; $i++) {
|
|
$s_tour = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE jahr='".$jahr_aktuell."' and kw='".$i."' and typ=11 OR jahr='".$jahr_aktuell."' and kw='".$i."' and typ=14");
|
|
$kws[$key]=$i;
|
|
while($row = $s_tour->fetch_assoc()) {
|
|
$tmp=$tmp+$row['gewicht'];
|
|
|
|
}
|
|
$data[$key]=$tmp; $tmp=0;
|
|
$key++;
|
|
}
|
|
$template->assign('data',json_encode($data));
|
|
$template->assign('kws',json_encode($kws));
|
|
|
|
|
|
$template->assign('werb1', $werb1);
|
|
$template->assign('werb2', $werb2);
|
|
$template->assign('werb3', $werb3);
|
|
$template->assign('kw', $kw_aktuell);
|
|
$template->assign('content', 'tpl/wtkw.tpl');
|
|
?>
|