init
This commit is contained in:
commit
72a26edcff
22092 changed files with 2101903 additions and 0 deletions
50
scripts/c_leasing.php
Normal file
50
scripts/c_leasing.php
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
$_SESSION['m1']=8; $_SESSION['m2']=0;
|
||||
|
||||
$tp1 = strtotime("+0 day");
|
||||
$tag = date("d",$tp1);
|
||||
$monat = date("m",$tp1);
|
||||
$jahr = date("Y",$tp1);
|
||||
|
||||
$key=0; $time=time();
|
||||
$cars=$GLOBALS['mysql']->query("SELECT * FROM fahrzeuge WHERE leasing!=0 ORDER BY id");
|
||||
while($row = $cars->fetch_assoc()) {
|
||||
$data[$key]['kz']=$row['kz'];
|
||||
$data[$key]['istkm']=$row['istkm'];
|
||||
$data[$key]['istkmdate']=$row['istkmdate'];
|
||||
$ez = mktime(0, 0, 0, $row['jbmonat'], $row['jbtag'], $row['jbjahr']); $now =time();
|
||||
$t1=$now-$ez;
|
||||
$t1=round($t1/86400);
|
||||
$t2=$row['leasing']/365;
|
||||
|
||||
|
||||
//$t1=$t1-(round($t1/7));
|
||||
//$t2=$row['leasing']/300;
|
||||
$data[$key]['pkm']=$t1*$t2;
|
||||
$data[$key]['pkm']=round($data[$key]['pkm']);
|
||||
$data[$key]['gkm']=0;
|
||||
|
||||
$z = $GLOBALS['mysql']->query_single("SELECT SUM(km) As skm FROM tourenliste WHERE auto='".$row['id']."' and time<'".$time."'");
|
||||
$data[$key]['gkm']=$z['skm']."</br>";
|
||||
|
||||
if($data[$key]['pkm']<$data[$key]['gkm']) { $data[$key]['anz']=1; } else { $data[$key]['anz']=0; }
|
||||
if($data[$key]['pkm']<$row['istkm']) { $data[$key]['anz2']=1; } else { $data[$key]['anz2']=0; }
|
||||
|
||||
$key++;
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
$test = $GLOBALS['mysql']->query_single("SELECT * FROM fahrzeuge WHERE leasing!=0 AND aktiv=1 and typ=1"); $template->assign('pkw',$test['num_rows']);
|
||||
$test = $GLOBALS['mysql']->query_single("SELECT * FROM fahrzeuge WHERE leasing!=0 AND aktiv=1 and typ=2"); $template->assign('cad',$test['num_rows']);
|
||||
$test = $GLOBALS['mysql']->query_single("SELECT * FROM fahrzeuge WHERE leasing!=0 AND aktiv=1 and typ>2"); $template->assign('trp',$test['num_rows']);
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
$ckm=$GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE auto in(251,252,253,254,255,256,258,259,7101,7106,7109,7112,7113,7115,7116,7119,7120,7122,7123,967,968) and time<'".$time."'");
|
||||
while($row = $ckm->fetch_assoc()) {
|
||||
$GLOBALS['mysql']->insert("UPDATE tourenliste SET km='".$_SESSION['tour'][$row['tour']]['km']."' WHERE id='".$row['id']."'");
|
||||
}
|
||||
|
||||
|
||||
$template->assign('kmdata', $data);
|
||||
//--------------------------------------------
|
||||
$template->assign('content', 'tpl/c_leasing.tpl');
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue