Skip to content

Commit

Permalink
hours solde2
Browse files Browse the repository at this point in the history
  • Loading branch information
Zpartakov committed Apr 25, 2016
1 parent 801072d commit 87d54b4
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion views/hours/index.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
//$delailib=date("",$delai);
setlocale (LC_TIME, 'fr_FR.utf8','fra');
$delailib=(strftime("%A %d %B %Y",$delai));
$today=mktime(0, 0, 0, date("m"), date("d"), date("Y"));
$weektoday = (int)date('W', $today);
$weekdelai = (int)date('W', $delai);
//echo "<br>Weeknummer1: " . $weektoday;
//echo "<br>Weeknummer2: " . $weekdelai;
//echo "<br>#weeks: " . ($weekdelai-$weektoday);

/*
* changement de tarif automatiques
*/
Expand Down Expand Up @@ -87,7 +94,17 @@
<tr><td>Solde initial</td><td><?php echo $holidaysforyear;?>h</td><td><?php echo intval($holidaysforyear/8);?>j</td></tr>
<tr><td>Vacances</td><td><?php echo $soldeVac;?>h</td><td><?php echo intval($soldeVac/8);?>j</td></tr>
<tr><td>Solde final</td><td><?php echo $holidaysforyear-$soldeVac;?>h</td><td><?php echo intval(($holidaysforyear-$soldeVac)/8);?>j</td></tr>
<tr><td>Heures à gagner d'ici au <?php echo $delailib;?></td><td><?php echo $hourstogain-$solde;?>h</td><td><?php echo intval(($hourstogain-$solde)/8);?>j</td></tr>
<tr><td>
<?php
$nsem=($weekdelai-$weektoday);
$soldeheures=($hourstogain-$solde);
$soldeheuresparsemaine=($soldeheures/$nsem);
//$soldeheuresparsemaine=intval($soldeheuresparsemaine);
$soldeheuresparsemaine=round($soldeheuresparsemaine,1);
?>
Heures à gagner d'ici au <?php echo $delailib;?>, soit <?php echo $nsem;?> semaines,
soit <?php echo $soldeheuresparsemaine;?> h par semaine
</td><td><?php echo $soldeheures;?>h</td><td><?php echo intval(($hourstogain-$solde)/8);?>j</td></tr>
</table>
<?php
echo $this->Paginator->counter(array(
Expand Down

0 comments on commit 87d54b4

Please sign in to comment.