<big>Ouverture caisse</big><br />
<?php
  echo "<form name='ouverture'><input type='hidden' name='Type' value=$Type><input type='hidden' name='Sous_Type' value=$Sous_Type><input type='hidden' name='Etape' value=1>";
  echo "Initiales <input type='text' name='personne' /><br/>Motif <input type='text' name='motif' /><br/><button type='submit'>Ouverture</button><br/>";
  echo "</form>\n";
  switch($Etape)
  {
    case 0:
    break;
    case 1:
	  // $f=fopen("oc.pos","w");
	  // fwrite($f,t88_pulse());
	  // fclose($f);
	  if ($personne != "" && $motif != "")
	  {  
	    $no_caisse=1;
          if($ligne1=Poste::getPostesByIP())
          {
            $no_caisse=$ligne1['NoCaisse'];
          }
	    exec("lp -d ticket$no_caisse oc.pos");
	    $requette="INSERT INTO ouverture_caisse".ID_GARAGE." (Initiales, Motif, NoCaisse) VALUES ('".Connection::getConnection()->quote($personne)."', '".Connection::getConnection()->quote($motif)."', $no_caisse)";
	    Connection::executeRawQuery($requette);
	  }
	break;
  }
?>
<script language="JavaScript">
  this.document.forms['ouverture'].elements[3].focus();
</script>
