<?php declare(strict_types=1);

// needs globals $qrbCfg, $qrbXl

// included by index.php

// POSTs to target "saveQrBillsConfiguration" in QrBillsSaveCfg.

?>

  <div>
    <p id="choice-title">
<?php 
print $qrbApi->xl('choice.title'); 
?>
    </p>
    
    <div id="choice">

<?php
// preset for QR bill PDF with payment slip 
?>
      <div>
        <form method="post">
          <input type="hidden" name="UseCaseSelection" value="PdfWithPaymentSlip" />
          <input type="hidden" name="createPdf" value="true" />
          <input type="hidden" name="printPaymentSlip" value="true" />
          <input type="submit" class="btn btn-dark" name="saveQrBillsConfiguration" 
<?php    
print ' value="' . $qrbApi->xl('choice.qrBill') . '" ';
if ($qrbCfg->getCreatePdf() && $qrbCfg->getPrintPaymentSlip()) print 'disabled'; 
?>
          />
        </form>
      </div>
      
<?php 
// preset for PDF without payment slip 
?>
      <div>
        <form method="post">
          <input type="hidden" name="UseCaseSelection" value="PdfWithoutPaymentSlip" />
          <input type="hidden" name="createPdf" value="true" />
          <input type="hidden" name="printPaymentSlip" value="false" />
          <input type="submit" class="btn btn-dark" name="saveQrBillsConfiguration" 
<?php    
print ' value="' . $qrbApi->xl('choice.pdfMail') . '" ';
if ($qrbCfg->getCreatePdf() && !$qrbCfg->getPrintPaymentSlip()) print 'disabled'; 
?>
          />
        </form>
      </div>

<?php
// preset for HTML mail without PDF 
?>
      <div>
        <form method="post">
          <input type="hidden" name="UseCaseSelection" value="MailWithoutPdf" />
          <input type="hidden" name="createPdf" value="false" />
          <input type="hidden" name="printPaymentSlip" value="false" />
          <input type="hidden" name="sendMail" value="true" />
          <input type="submit" class="btn btn-dark" name="saveQrBillsConfiguration"
<?php    
print ' value="' . $qrbApi->xl('choice.htmlMail') . '" ';
if (!$qrbCfg->getCreatePdf()) print 'disabled'; 
?>
          />
        </form>
      </div>

    </div>
  </div>
