<?php echo $header; ?>

<script type="text/javascript" src="//cdn.jsdelivr.net/jquery.maskmoney/3.0.2/jquery.maskMoney.min.js"></script>
<script>
$(function(){
$(".dinheiro").maskMoney({thousands:'', decimal:'.', allowZero:true, suffix: ''});
});
</script>

<div id="content">

<div class="breadcrumb">
  <?php foreach ($breadcrumbs as $breadcrumb) { ?>
  <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
  <?php } ?>
</div>

<?php if ($error_warning) { ?>
  <div class="warning"><?php echo $error_warning; ?></div>
<?php } ?>

<div class="box">
  <div class="heading">
    <h1><img src="view/image/payment.png" alt="" /> <?php echo $heading_title; ?></h1>
    <div class="buttons"><a onclick="$('#form').submit();" class="button"><span><?php echo $button_save; ?></span></a><a onclick="location = '<?php echo $cancel; ?>';" class="button"><span><?php echo $button_cancel; ?></span></a></div>
  </div>
  <div class="adm-wait-urgent flex middle-xs vertical-padding-small horizontal-padding-medium">
    <i class="fas fa-exclamation-triangle text-light padding-small bottom-margin-x-small"></i>
    <span class="text-small text-light padding-small col-sm"><b class="visible-block"><?php echo $text_module_info ?></b><?php echo $text_module_sub_info ?></span>
  </div>

  <div class="content">

    <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">

      <table class="form">
        <tr>
          <td><?php echo $entry_cielo_description; ?></td>
          <td>
            <input type="text" name="cielo_transparente_descricao" value="<?php echo (isset($cielo_transparente_descricao)) ? $cielo_transparente_descricao : ''; ?>" />
	         <?php if (isset($err_cielo_transparente_descricao)) { ?>
                    <span class="error"><?php echo $err_cielo_transparente_descricao; ?></span>
	         <?php  } ?>
          </td>
        </tr>

        <tr>
          <td><?php echo $entry_cielo_numero; ?></td>
          <td>
            <input type="text" name="cielo_transparente_numero" value="<?php echo $cielo_transparente_numero; ?>" placeholder="<?php echo $entry_cielo_numero_teste; ?>" />
	         <?php if ($err_cielo_transparente_numero) { ?>
                    <span class="error"><?php echo $err_cielo_transparente_numero; ?></span>
	         <?php  } ?>
          </td>
        </tr>

        <tr>
          <td><?php echo $entry_cielo_chave; ?></td>
          <td>
            <input type="text" name="cielo_transparente_chave" value="<?php echo $cielo_transparente_chave; ?>" placeholder="<?php echo $entry_cielo_chave; ?>" />
	         <?php if ($err_cielo_transparente_chave) { ?>
                    <span class="error"><?php echo $err_cielo_transparente_chave; ?></span>
	         <?php  } ?>
          </td>
        </tr>

        <tr>
          <td><?php echo $entry_cielo_url_site; ?></td>
          <td>
            <input type="text" name="cielo_transparente_url_site" value="<?php echo $cielo_transparente_url_site; ?>" placeholder="<?php echo $entry_cielo_url_site_exemplo; ?>" />
	         <?php if ($err_cielo_transparente_url_site) { ?>
                    <span class="error"><?php echo $err_cielo_transparente_url_site; ?></span>
	         <?php  } ?>
          </td>
        </tr>

        <tr>
          <td><?php echo $entry_cielo_parcela_semjuros; ?></td>
          <td>
            <input type="text" name="cielo_transparente_parcela_semjuros" value="<?php echo $cielo_transparente_parcela_semjuros; ?>" placeholder="<?php echo $entry_cielo_parcela_semjuros; ?>" />
	         <?php if ($err_cielo_transparente_parcela_semjuros) { ?>
                    <span class="error"><?php echo $err_cielo_transparente_parcela_semjuros; ?></span>
	         <?php  } ?>
          </td>
        </tr>

        <tr>
          <td><?php echo $entry_cielo_parcela_juros; ?></td>
          <td>
            <input type="text" name="cielo_transparente_parcela_juros" value="<?php echo $cielo_transparente_parcela_juros; ?>" placeholder="<?php echo $entry_cielo_parcela_juros; ?>" class="dinheiro"/>
	         <?php if ($err_cielo_transparente_parcela_juros) { ?>
                    <span class="error"><?php echo $err_cielo_transparente_parcela_juros; ?></span>
	         <?php  } ?>
          </td>
        </tr>

        <tr>
          <td><?php echo $entry_cielo_parcela_minimo; ?></td>
          <td>
            <input type="text" name="cielo_transparente_parcela_minimo" value="<?php echo $cielo_transparente_parcela_minimo; ?>" placeholder="<?php echo $entry_cielo_parcela_minimo; ?>" class="dinheiro"/>
	         <?php if ($err_cielo_transparente_parcela_minimo) { ?>
                    <span class="error"><?php echo $err_cielo_transparente_parcela_minimo; ?></span>
	         <?php  } ?>
          </td>
        </tr>

        <tr>
          <td><?php echo $entry_cielo_transparente_total; ?></td>
          <td>
            <input type="text" name="cielo_transparente_total" value="<?php echo $cielo_transparente_total; ?>" placeholder="<?php echo $entry_cielo_transparente_total; ?>" class="dinheiro"/>
	         <?php if ($err_cielo_transparente_total) { ?>
                    <span class="error"><?php echo $err_cielo_transparente_total; ?></span>
	         <?php  } ?>
          </td>
        </tr>

        <tr>
          <td><?php echo $entry_cielo_parcela_qtdmax; ?></td>
          <td>
            <input type="text" name="cielo_transparente_parcela_qtdmax" value="<?php echo $cielo_transparente_parcela_qtdmax; ?>" placeholder="<?php echo $entry_cielo_parcela_qtdmax; ?>" />
	         <?php if ($err_cielo_transparente_parcela_qtdmax) { ?>
                    <span class="error"><?php echo $err_cielo_transparente_parcela_qtdmax; ?></span>
	         <?php  } ?>
          </td>
        </tr>

        <tr>
          <td><?php echo $entry_cielo_bandeiraspagamento; ?></td>
          <td>
            <div class="scrollbox">
                <div class="odd">
                  <?php if ($cielo_transparente_visa) { ?>
                  <input type="checkbox" name="cielo_transparente_visa" value="1" checked="checked" />
                  <?php echo "Visa"; ?>
                  <?php } else { ?>
                  <input type="checkbox" name="cielo_transparente_visa" value="1" />
                  <?php echo "Visa"; ?>
                  <?php } ?>
                </div>
                <div class="odd">
                  <?php if ($cielo_transparente_master) { ?>
                  <input type="checkbox" name="cielo_transparente_master" value="1" checked="checked" />
                  <?php echo "Mastercard"; ?>
                  <?php } else { ?>
                  <input type="checkbox" name="cielo_transparente_master" value="1" />
                  <?php echo "Mastercard"; ?>
                  <?php } ?>
                </div>
                <div class="odd">
                  <?php if ($cielo_transparente_amex) { ?>
                  <input type="checkbox" name="cielo_transparente_amex" value="1" checked="checked" />
                  <?php echo "American Espress"; ?>
                  <?php } else { ?>
                  <input type="checkbox" name="cielo_transparente_amex" value="1" />
                  <?php echo "American Espress"; ?>
                  <?php } ?>
                </div>
                <div class="odd">
                  <?php if ($cielo_transparente_elo) { ?>
                  <input type="checkbox" name="cielo_transparente_elo" value="1" checked="checked" />
                  <?php echo "Elo"; ?>
                  <?php } else { ?>
                  <input type="checkbox" name="cielo_transparente_elo" value="1" />
                  <?php echo "Elo"; ?>
                  <?php } ?>
                </div>
                <div class="odd">
                  <?php if ($cielo_transparente_diners) { ?>
                  <input type="checkbox" name="cielo_transparente_diners" value="1" checked="checked" />
                  <?php echo "Diners"; ?>
                  <?php } else { ?>
                  <input type="checkbox" name="cielo_transparente_diners" value="1" />
                  <?php echo "Diners"; ?>
                  <?php } ?>
                </div>
                <div class="odd">
                  <?php if ($cielo_transparente_discover) { ?>
                  <input type="checkbox" name="cielo_transparente_discover" value="1" checked="checked" />
                  <?php echo "Discover"; ?>
                  <?php } else { ?>
                  <input type="checkbox" name="cielo_transparente_discover" value="1" />
                  <?php echo "Discover"; ?>
                  <?php } ?>
                </div>

            </div>
          </td>
        </tr>

        <tr>
          <td><?php echo $entry_order_status; ?></td>
          <td>
            <select name="cielo_transparente_order_status_id" id="cielo_transparente_order_status_id" >
              <?php foreach ($order_statuses as $order_status) { ?>
              <?php if ($order_status['order_status_id'] == $cielo_transparente_order_status_id) { ?>
              <option value="<?php echo $order_status['order_status_id']; ?>" selected="selected"><?php echo $order_status['name']; ?></option>
              <?php } else { ?>
              <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
              <?php } ?>
              <?php } ?>
            </select>
          </td>
        </tr>

        <tr>
          <td><?php echo $entry_order_status_pago; ?></td>
          <td>
            <select name="cielo_transparente_order_pg_id" id="cielo_transparente_order_pg_id" >
            <?php foreach ($order_statuses as $order_status) { ?>
            <?php if ($order_status['order_status_id'] == $cielo_transparente_order_pg_id) { ?>
            <option value="<?php echo $order_status['order_status_id']; ?>" selected="selected"><?php echo $order_status['name']; ?></option>
            <?php } else { ?>
            <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
            <?php } ?>
            <?php } ?>
            </select>
          </td>
        </tr>

        <tr>
          <td><?php echo $entry_order_status_pendente; ?></td>
          <td>
            <select name="cielo_transparente_order_pe_id" id="cielo_transparente_order_pe_id" >
            <?php foreach ($order_statuses as $order_status) { ?>
            <?php if ($order_status['order_status_id'] == $cielo_transparente_order_pe_id) { ?>
            <option value="<?php echo $order_status['order_status_id']; ?>" selected="selected"><?php echo $order_status['name']; ?></option>
            <?php } else { ?>
            <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
            <?php } ?>
            <?php } ?>
            </select>
          </td>
        </tr>

        <tr>
          <td><?php echo $entry_order_status_negado; ?></td>
          <td>
            <select name="cielo_transparente_order_ne_id" id="cielo_transparente_order_ne_id" >
            <?php foreach ($order_statuses as $order_status) { ?>
            <?php if ($order_status['order_status_id'] == $cielo_transparente_order_ne_id) { ?>
            <option value="<?php echo $order_status['order_status_id']; ?>" selected="selected"><?php echo $order_status['name']; ?></option>
            <?php } else { ?>
            <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
            <?php } ?>
            <?php } ?>
            </select>
          </td>
        </tr>

        <tr>
          <td><?php echo $entry_order_status_autorizado; ?></td>
          <td>
            <select name="cielo_transparente_order_au_id" id="cielo_transparente_order_au_id" >
            <?php foreach ($order_statuses as $order_status) { ?>
            <?php if ($order_status['order_status_id'] == $cielo_transparente_order_au_id) { ?>
            <option value="<?php echo $order_status['order_status_id']; ?>" selected="selected"><?php echo $order_status['name']; ?></option>
            <?php } else { ?>
            <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
            <?php } ?>
            <?php } ?>
            </select>
          </td>
        </tr>

        <tr>
          <td><?php echo $entry_order_status_cancelado; ?></td>
          <td>
            <select name="cielo_transparente_order_status_cancelado_id" id="cielo_transparente_order_status_cancelado_id" >
              <?php foreach ($order_statuses as $order_status) { ?>
              <?php if ($order_status['order_status_id'] == $cielo_transparente_order_status_cancelado_id) { ?>
              <option value="<?php echo $order_status['order_status_id']; ?>" selected="selected"><?php echo $order_status['name']; ?></option>
              <?php } else { ?>
              <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
              <?php } ?>
              <?php } ?>
            </select>
          </td>
        </tr>

        <tr>
          <td><?php echo $entry_geo_zone; ?></td>
          <td>
            <select name="cielo_transparente_geo_zone_id" id="input-geo-zone" >
              <option value="0"><?php echo $text_all_zones; ?></option>
              <?php foreach ($geo_zones as $geo_zone) { ?>
              <?php if ($geo_zone['geo_zone_id'] == $cielo_transparente_geo_zone_id) { ?>
              <option value="<?php echo $geo_zone['geo_zone_id']; ?>" selected="selected"><?php echo $geo_zone['name']; ?></option>
              <?php } else { ?>
              <option value="<?php echo $geo_zone['geo_zone_id']; ?>"><?php echo $geo_zone['name']; ?></option>
              <?php } ?>
              <?php } ?>
            </select>
          </td>
        </tr>

        <tr>
          <td><?php echo $text_client; ?></td>
          <td>
            <input type="text" name="cielo_transparente_client_teste" value="<?php echo $cielo_transparente_client_teste; ?>" placeholder="ID do cliente de teste" id="input"  />
          </td>
        </tr>

        <tr>
          <td><?php echo $text_ambiente; ?></td>
          <td>
            <select name="cielo_transparente_ambiente_teste" id="input-status" >
            <?php if ($cielo_transparente_ambiente_teste) { ?>
            <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
            <option value="0"><?php echo $text_disabled; ?></option>
            <?php } else { ?>
            <option value="1"><?php echo $text_enabled; ?></option>
            <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
            <?php } ?>
            </select>
          </td>
        </tr>

        <tr>
          <td><?php echo $entry_display; ?></td>
          <td>
            <select name="cielo_transparente_display" >
              <?php foreach(Type_DisplayModuleOption::getEnumList() as $key  => $value){ ?>
                <option value="<?php echo $key; ?>" <?php echo Ftr_Geral::isSelected($key, $cielo_transparente_display, Type_DisplayModuleOption::Tp_Todos); ?>><?php echo $value; ?></option>
              <?php } ?>
            </select>
          </td>
        </tr>

        <tr>
          <td><?php echo $entry_status; ?></td>
          <td>
            <select name="cielo_transparente_status" id="input-status" >
              <?php if ($cielo_transparente_status) { ?>
              <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
              <option value="0"><?php echo $text_disabled; ?></option>
              <?php } else { ?>
              <option value="1"><?php echo $text_enabled; ?></option>
              <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
              <?php } ?>
            </select>
          </td>
        </tr>

        <tr>
          <td><?php echo $entry_sort_order; ?></td>
          <td>
            <input type="text" name="cielo_transparente_sort_order" value="<?php echo $cielo_transparente_sort_order; ?>" placeholder="<?php echo $entry_sort_order; ?>" id="input-sort-order"  />
          </td>
        </tr>

      </table>

    </form>

  </div>

</div>

<?php echo $footer; ?>
