init
This commit is contained in:
commit
72a26edcff
22092 changed files with 2101903 additions and 0 deletions
62
scripts/ajax/pi_halloB.php
Normal file
62
scripts/ajax/pi_halloB.php
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
<?php
|
||||
ini_set('display_errors',0);
|
||||
|
||||
$tage = array("Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag");
|
||||
$anlage = $GLOBALS['mysql']->query_single("SELECT * FROM kartenlog ORDER BY logID DESC LIMIT 1"); $anz=0;
|
||||
|
||||
|
||||
|
||||
$jahr = (int)date('Y');
|
||||
$monat=(int)date('m');
|
||||
$tag=(int)date('j');
|
||||
$wochentag=date(w);
|
||||
|
||||
if($wochentag==0 && date('G')>10) { $tag++; if($tag>date(t)) { $monat++; $tag=1; } if($monat==13) { $jahr++; $monat=1; }}
|
||||
if($wochentag!=0 && date('G')>17) { $tag++; if($tag>date(t)) { $monat++; $tag=1; } if($monat==13) { $jahr++; $monat=1; }}
|
||||
|
||||
$tmptime=mktime(0,0,0,$monat,$tag,$jahr);
|
||||
|
||||
$key=0;
|
||||
$test = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE tag='".$tag."' and monat='".$monat."' and jahr='".$jahr."' and fahrer='".$anlage['user']."' ORDER BY logID ");
|
||||
if($test['num_rows'] != 0) {
|
||||
//------------------------------------------------ Zeitumrechnung nach bedarf
|
||||
$testb1 = $GLOBALS['mysql']->query_single("SELECT * FROM baustellen WHERE startts=0");
|
||||
if($testb1['num_rows'] != 0) {
|
||||
$testbx = $GLOBALS['mysql']->query("SELECT * FROM baustellen WHERE startts=0");
|
||||
while($row = $testbx->fetch_assoc()) {
|
||||
$st = explode(".", $row['start']);
|
||||
$startzeit=mktime(0,0,0, $st[1],$st[0],$st[2]);
|
||||
$GLOBALS['mysql']->insert("UPDATE baustellen SET startts='".$startzeit."' WHERE id='".$row['id']."'");
|
||||
|
||||
$et = explode(".", $row['ende']);
|
||||
$endzeit=mktime(0,0,0, $et[1],$et[0],$et[2]); //echo $endzeit;
|
||||
$GLOBALS['mysql']->insert("UPDATE baustellen SET endts='".$endzeit."' WHERE id='".$row['id']."'");
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------ baustellen auslesen
|
||||
|
||||
$time=time();
|
||||
$tourx = $GLOBALS['mysql']->query_single("SELECT * FROM baustellen WHERE startts<'".$time."' and endts>'".$time."'");
|
||||
if($tourx['num_rows'] != 0) {
|
||||
if($test['typ']!=0) {
|
||||
$tour = $GLOBALS['mysql']->query("SELECT * FROM baustellen WHERE startts<'".$time."' and endts>'".$time."'");
|
||||
while($row = $tour->fetch_assoc()) {
|
||||
$bdata[$key]['ort']= $row['ort']; //echo "-".$row['ort'];
|
||||
$bdata[$key]['grund']= $row['grund'];
|
||||
$bdata[$key]['bezeichnung']= $row['bezeichnung'];
|
||||
$bdata[$key]['ende']= $row['ende'];
|
||||
$key++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
$template->assign('bdata',$bdata);
|
||||
$template->assign('content', 'tpl/ajax/pi_halloB.tpl');
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue