init
This commit is contained in:
commit
72a26edcff
22092 changed files with 2101903 additions and 0 deletions
155
scripts/iwerbung.php
Normal file
155
scripts/iwerbung.php
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
<?php
|
||||
$_SESSION['m1']=3; $_SESSION['m2']=9;
|
||||
error_reporting(E_ALL);
|
||||
error_reporting(E_ALL ^ E_NOTICE);
|
||||
// Melde alle PHP Fehler
|
||||
error_reporting(1);
|
||||
|
||||
|
||||
|
||||
|
||||
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";
|
||||
|
||||
$pjahr=date('W', (mktime(0, 0, 0, 1, 1, $jahr+1) - 4*86400));
|
||||
$ijahr=date('W', (mktime(0, 0, 0, 1, 1, $jahr) - 4*86400));
|
||||
$mjahr=date('W', (mktime(0, 0, 0, 1, 1, $jahr-1) - 4*86400));
|
||||
|
||||
if($_GET['wahl']==1){ if($_GET['kw']==1) { $kw=$mjahr; $jahr=$_GET['jahr']-1;} else { $kw=$_GET['kw']-1; $jahr=$_GET['jahr'];}}
|
||||
|
||||
elseif($_GET['wahl']==2){ if($_GET['kw']==$ijahr) { $kw=1; $jahr=$_GET['jahr']+1; } else { $kw=$_GET['kw']+1; $jahr=$_GET['jahr']; }
|
||||
} else {
|
||||
$jahr = (int)date('Y');
|
||||
$kw = (int)date('W');
|
||||
}
|
||||
|
||||
|
||||
if(isset($_POST['amtsblatt'])) {//funst
|
||||
if(isset($_POST['ablatt'])) {
|
||||
$ab_tour = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE kw='".$kw."' and jahr='".$jahr."' and typ=11 OR kw='".$kw."' and jahr='".$jahr."' and typ=14 ORDER BY tour");
|
||||
while($row = $ab_tour->fetch_assoc()) {
|
||||
$row_tour = $GLOBALS['mysql']->query_single("SELECT * FROM touren WHERE id='".$row['tour']."'");
|
||||
if($row_tour['utyp']==1) {
|
||||
$newabnr=$row['tour']+2000; $abvorgewicht=150;
|
||||
$GLOBALS['mysql']->insert("INSERT INTO tourenliste (tour,zeit,gewicht,kw,tag,monat,jahr,typ,fahrer,auto,infotext,logid)
|
||||
VALUES(
|
||||
'".$newabnr."',
|
||||
'".$row['zeit']."',
|
||||
'".$abvorgewicht."',
|
||||
'".$row['kw']."',
|
||||
'".$row['tag']."',
|
||||
'".$row['monat']."',
|
||||
'".$row['jahr']."',
|
||||
'".$row['typ']."',
|
||||
'".$row['fahrer']."',
|
||||
'".$row['auto']."',
|
||||
'".$row['infotext']."',
|
||||
'".time()."')
|
||||
");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$ab_tour = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE kw='".$kw."' and jahr='".$jahr."' and typ=11 ORDER BY tour");
|
||||
while($row = $ab_tour->fetch_assoc()) {
|
||||
$row_tour = $GLOBALS['mysql']->query_single("SELECT * FROM touren WHERE id='".$row['tour']."'");
|
||||
if($row_tour['utyp']==1) {
|
||||
$newabnr=$row['tour']+2000;
|
||||
$GLOBALS['mysql']->query("DELETE FROM tourenliste WHERE kw='".$kw."' and jahr='".$jahr."' and tour='".$newabnr."' ");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if(isset($_POST['amtsblatt2'])) {//funst
|
||||
if(isset($_POST['ablatt2'])) {
|
||||
|
||||
$ab_tour = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE kw='".$kw."' and jahr='".$jahr."' and typ=11 ORDER BY tour");
|
||||
while($row = $ab_tour->fetch_assoc()) {
|
||||
$row_tour = $GLOBALS['mysql']->query_single("SELECT * FROM touren WHERE id='".$row['tour']."'");
|
||||
if($row_tour['utyp']==2) {
|
||||
$newabnr=$row['tour']+2000; $abvorgewicht=150;
|
||||
$GLOBALS['mysql']->insert("INSERT INTO tourenliste (tour,zeit,gewicht,kw,tag,monat,jahr,typ,fahrer,auto,infotext.logid)
|
||||
VALUES(
|
||||
'".$newabnr."',
|
||||
'".$row['zeit']."',
|
||||
'".$abvorgewicht."',
|
||||
'".$row['kw']."',
|
||||
'".$row['tag']."',
|
||||
'".$row['monat']."',
|
||||
'".$row['jahr']."',
|
||||
'".$row['typ']."',
|
||||
'".$row['fahrer']."',
|
||||
'".$row['auto']."',
|
||||
'".$row['infotext']."'),
|
||||
'".time()."'
|
||||
");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$ab_tour = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE kw='".$kw."' and jahr='".$jahr."' and typ=11 ORDER BY tour");
|
||||
while($row = $ab_tour->fetch_assoc()) {
|
||||
$row_tour = $GLOBALS['mysql']->query_single("SELECT * FROM touren WHERE id='".$row['tour']."'");
|
||||
if($row_tour['utyp']==2) {
|
||||
$newabnr=$row['tour']+2000;
|
||||
$GLOBALS['mysql']->query("DELETE FROM tourenliste WHERE kw='".$kw."' and jahr='".$jahr."' and tour='".$newabnr."' ");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//------------------- NEU ----------------------------------------------
|
||||
//----------------------------------------------------------------------
|
||||
//------------------------------------------ komplette Tabelle speichern
|
||||
if(isset($_POST['testsave'])) {
|
||||
foreach($_POST['list'] as $row) {
|
||||
$teilen1 = explode(".",$row['datum']); $tag=$teilen1[0]; $monat=$teilen1[1]; $jahr=$teilen1[2];
|
||||
$datum1=$tag.".".$monat.".".$jahr;
|
||||
$GLOBALS['mysql']->insert("UPDATE tourenliste SET zeit='".$row['zeit']."',tag='".$teilen1[0]."',monat='".$teilen1[1]."',jahr='".$teilen1[2]."',infotext='".$row['infotext']."',logid='".time()."' WHERE id='".$row['tid']."'");
|
||||
if ($row['tnr']<2000) {
|
||||
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht='".$row['gewicht']."',gewicht3='".$row['gewicht3']."',gewicht4='".$row['gewicht4']."' WHERE id='".$row['tid']."'");
|
||||
}
|
||||
$newtnr=$row['tnr']+2000;
|
||||
$GLOBALS['mysql']->insert("UPDATE tourenliste SET gewicht='".$row['gewicht3']."' WHERE kw='".$row['kw']."' and jahr='".$row['jahr']."' and tour='".$newtnr."'");
|
||||
}
|
||||
$success[]='Alle Touren wurden geändert.'; $template->assign('success', $success);
|
||||
}
|
||||
|
||||
//------------------------------------- MPV Werbung
|
||||
//------ amtsblatt ja / nein
|
||||
$abla = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE typ=11 and tour>2000 and tour<3800 and kw='".$kw."' and jahr='".$jahr."'");
|
||||
if($abla['num_rows'] == 0) { $amtsbl=0; }else{ $amtsbl=1; }
|
||||
$ablb = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE typ=11 and tour=3808 and kw='".$kw."' and jahr='".$jahr."'");
|
||||
if($ablb['num_rows'] == 0) { $amtsbl2=0; }else{ $amtsbl2=1; }
|
||||
|
||||
//-------------------------------------
|
||||
$key=0;
|
||||
$rs_tour = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE kw='".$kw."' and jahr='".$jahr."' and typ=11 OR kw='".$kw."' and jahr='".$jahr."' and typ=14 ORDER BY tour");
|
||||
while($row = $rs_tour->fetch_assoc()) {
|
||||
$werb_tour3[$key]['id']=$row['id'];
|
||||
$werb_tour3[$key]['tnr']=$row['tour'];
|
||||
$werb_tour3[$key]['datum']=$row['tag'].".".$row['monat'].".".$row['jahr'];
|
||||
$werb_tour3[$key]['tid']=$key;
|
||||
$row_tour = $GLOBALS['mysql']->query_single("SELECT * FROM touren WHERE id='".$row['tour']."'");
|
||||
$werb_tour3[$key]['tour']=$row_tour['tour'];
|
||||
$werb_tour3[$key]['utyp']=$row_tour['utyp'];
|
||||
//----------------
|
||||
$werb_tour3[$key]['zeit']=$row['zeit'];
|
||||
$werb_tour3[$key]['gewicht']=$row['gewicht'];
|
||||
$werb_tour3[$key]['gewicht3']=$row['gewicht3'];
|
||||
$werb_tour3[$key]['gewicht4']=$row['gewicht4'];
|
||||
$werb_tour3[$key]['infotext']=$row['infotext'];
|
||||
$key++;
|
||||
}
|
||||
|
||||
|
||||
$template->assign('amtsbl', $amtsbl);
|
||||
$template->assign('amtsbl2', $amtsbl2);
|
||||
$template->assign('jahr', $jahr);
|
||||
$template->assign('kw', $kw);
|
||||
$template->assign('datum', $datum);
|
||||
$template->assign('werb_tour3', $werb_tour3);
|
||||
$template->assign('content', 'tpl/iwerbung.tpl');
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue