<?php
  switch($Etape)
  {
    case 0:
      echo "  <form>\n";
      echo "   <input type='hidden' name='Type' value=$Type>\n";
      echo "   <input type='hidden' name='Sous_Type' value=$Sous_Type>\n";
      echo "   <input type='hidden' name='Etape' value='1'>\n";
      echo "<table border=1>";
      echo "<tr><th>Date</th><td>".Cree_Entree_Type("date",2,0,date("Y-m-d"),MODIFICATION)."</td></tr>";
      echo "</table>";
      echo "<button type='button' onClick='submit_ok(this.form);'>Valider</button>";
      echo "</form>";
    break;
    case 1:
      if($ligne=Caisse::getOneLesserDate(substr(Decode_Entree_Type($date,2),0,10)))
      {
        echo $ligne['Date']." ".$ligne['Montant']."<BR>\n";
        $resultat2=DBCash::getByPeriod($ligne['Date'].' 23:59:59', substr(Decode_Entree_Type($date,2),0,10).' 23:59:59');
        $somme=0;
        foreach($resultat2 as $ligne2)
        {
          $somme+=$ligne2['Somme'];
          echo $ligne2['Somme']."<BR>\n";
        }
        $total=$ligne['Montant']+$somme;
        echo $ligne['Montant']."+".$somme."=".$total;
      }
    break;
  }
?>
